Page 1 of 1

Launch CPU Slots with numactl on linux

Posted: Sun May 03, 2020 6:44 pm
by lafrad
I'm interested in launching my CPU Slots with custom numactl settings on linux... Is there any way to do this?
https://linux.die.net/man/8/numactl

Thanks!

Re: Launch CPU Slots with numactl on linux

Posted: Mon May 04, 2020 4:42 am
by PantherX
Welcome to the F@H Forum lafrad,

AFAIK, FahCore are not NUMA aware so I am not sure if that would work or not.

Re: Launch CPU Slots with numactl on linux

Posted: Wed May 06, 2020 11:40 pm
by lafrad
as far as I know, numactl tells linux how to launch the program... the program itself doesn't need to have NUMA awareness.

I'm trying to keep my Threadripper 2950x from trashing the threads from one NUMA node to the other... It meant a lot in windows (process Lasso did well enough), but linux seems to be a little less... automated... launching it with the numactl command seems the best way...

Re: Launch CPU Slots with numactl on linux

Posted: Wed May 06, 2020 11:48 pm
by DeHackEd
The only way I know to do this would be to launch 2 instances of the client (each would require private work directories, and their config files listening on different management ports), and each instances is launched on the appropriate NUMA node. Set each instance for half the number of cores/threads on the whole system so they only use as many as are actually available. Don't forget to pin both CPU and memory when launching with numactl.

That's gonna be a messy init script though.

Re: Launch CPU Slots with numactl on linux

Posted: Thu May 07, 2020 12:08 am
by lafrad
Yea, and the Control launches the workers too, so it'll have to interpret that too.... hmm

Re: Launch CPU Slots with numactl on linux

Posted: Thu May 07, 2020 1:38 am
by braiam
lafrad wrote:Yea, and the Control launches the workers too, so it'll have to interpret that too.... hmm
Are you sure?
numactl runs processes with a specific NUMA scheduling or memory placement policy. The policy is set for command and inherited by all of its children.

Re: Launch CPU Slots with numactl on linux

Posted: Thu May 07, 2020 2:05 am
by DeHackEd
The advanced control app does not launch the clients, it only connects to it to control it. The actual client (FAHClient binary) is launch independently, typically during system bootup. This is where you'd need to have numactl launch it, or something equivalent to numactl. The advanced control app would have 2 entries in the left side list for a single host which is atypical.

I don't have a NUMA system, but I have a Windows VM with a GPU passed to it for gaming. It folds when not gaming. My advanced control shows and manages both systems.

Re: Launch CPU Slots with numactl on linux

Posted: Thu May 07, 2020 4:42 am
by lafrad
As far as i can tell, the FAHClient actually launches the "cores" as apps, right? It shows up in the process lists as an independent app... The app itself would have to have a "prefix" for that so `numactl` could be added....

Re: Launch CPU Slots with numactl on linux

Posted: Thu May 07, 2020 4:53 am
by Joe_H
Actually FAHClient launches a FAHCoreWrapper process which runs the FAHCore_nn process and passes the starting parameters to it. It has been a while since I looked closely, I forget whether the FAHCore process is independent or a spawned subprocess of the FAHCoreWrapper process.

For example, from a startup of a CPU WU to be processed on one of my Mac systems as shown in the log file:

Code: Select all

06:28:45:WU00:FS00:Running FahCore: /usr/local/bin/FAHCoreWrapper "/Library/Application Support/FAHClient/cores/cores.foldingathome.org/v7/osx/64bit/avx/Core_a7.fah/FahCore_a7" -dir 00 -suffix 01 -version 706 -lifeline 1060 -checkpoint 15 -np 4

Re: Launch CPU Slots with numactl on linux

Posted: Thu May 07, 2020 5:43 pm
by lafrad
So, it'd have to be a property of the wrapper, OR the wrapper would have to have the numactl added to its process command line...

I'll figure out a feature request at some point ;)