mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   LLR Affinity Problem (https://www.mersenneforum.org/showthread.php?t=26037)

rogue 2022-06-17 02:28

[QUOTE=kruoli;607995]For your request that LLR will respect it by itself, I definitely concur. If a process wants to limit its own affinity, it can do it without further privileges (as of Windows 10, at least).

My program does only need to be started once. It will monitor all started processes and apply affinity in accordance with the parameters the program was started with.[/QUOTE]

If I have multiple copies of llr, does it set affinity based upon the runtime directory of llr?

kruoli 2022-06-17 08:27

At the program's start, it will build a queue of cores available to LLR. When detecting a newly spawned process, it will assign it to a core and mark that core as used. This gets undone if the LLR process ends.

So it is not about the directory, but multiple processes are definitely supported. I found no advantage in assigning affinities by the working directory. It is more important to have one physical core per lifetime of a process.

rogue 2022-06-17 14:51

[QUOTE=kruoli;608013]At the program's start, it will build a queue of cores available to LLR. When detecting a newly spawned process, it will assign it to a core and mark that core as used. This gets undone if the LLR process ends.

So it is not about the directory, but multiple processes are definitely supported. I found no advantage in assigning affinities by the working directory. It is more important to have one physical core per lifetime of a process.[/QUOTE]

Can I limit your app to the cores I want it to assign the llr processes to? Since the computer has hyper threading and efficiency cores, I would only want to direct llr to one of each pair of hyper threaded cores and to avoid the efficiency cores.

kruoli 2022-06-17 18:25

Yes, take a look at the help the program generates ([C]-h[/C] switch). You can set[LIST][*]the first core to assign to.[*]the increment (on Windows, this would be 2 when having HT).[*]the maximum worker count.[/LIST]

rogue 2022-06-18 13:25

I d/l'd your program, ran it in a command window (started as administrator). Used -h. Nothing. It doesn't output anything.

kruoli 2022-06-18 13:38

You are correct, I could not believe it but tested it myself. That's dumb. I have not tested this before I uploaded it, sorry. Running it without parameter will give this (this is tested):
[CODE]Usage:
AffinitySetter [options] {process name}

Options:
-h Shows help and exits.
-i {number} Increment of cores to set affinity to (default: 2).
-m {number} Maximum number of processes to set affinity of at one given time (default: number of cores / 2).
-q Hides the console window.
-s {number} Zero-based first core to set affinity to (default: 1).
-t {number} Thread count of each process (default: 1).

Remarks: This program assumes HT. If not, you will have to specify -i, -m and -s manually.
The program will only work up to 64 logical cores.[/CODE]

rogue 2022-06-18 17:14

[QUOTE=kruoli;608070]You are correct, I could not believe it but tested it myself. That's dumb. I have not tested this before I uploaded it, sorry. Running it without parameter will give this (this is tested):
[CODE]Usage:
AffinitySetter [options] {process name}

Options:
-h Shows help and exits.
-i {number} Increment of cores to set affinity to (default: 2).
-m {number} Maximum number of processes to set affinity of at one given time (default: number of cores / 2).
-q Hides the console window.
-s {number} Zero-based first core to set affinity to (default: 1).
-t {number} Thread count of each process (default: 1).

Remarks: This program assumes HT. If not, you will have to specify -i, -m and -s manually.
The program will only work up to 64 logical cores.[/CODE][/QUOTE]

So if I have 7 copies of llr running, what parameters do I use to ensure that they are running on the performance cores? That assumes that performance cores (with HT) are 0-15.

paulunderwood 2022-06-18 18:55

If you turn off the energy efficient cores in BIOS, does your motherboard allow the performance cores to use AVX512?

rogue 2022-06-18 20:48

[QUOTE=paulunderwood;608079]If you turn off the energy efficient cores in BIOS, does your motherboard allow the performance cores to use AVX512?[/QUOTE]

I haven't tried that and I'm not certain I want to. It is my wife's computer, so performance will be an issue if she doesn't have cores available for her stuff.

kruoli 2022-06-19 07:55

[QUOTE=rogue;608076]So if I have 7 copies of llr running, what parameters do I use to ensure that they are running on the performance cores? That assumes that performance cores (with HT) are 0-15.[/QUOTE]

You first decide on which core to start on. In your example, everything from 0–3 would be feasible as a start core. That would either involve performance cores 0–6 or 1–7. I would leave performance core 0 free because a lot of kernel thongs are still done on core 0 on windows. This would lead to:
[C]AffinitySetter -s 3 -m 7 llr64[/C],
assuming your executable is called [C]llr64[/C]. The option [C]-i[/C] does not need to be added since it is the default on Windows. Leave it running in background. It will automatically detect newly spawned processes.

rogue 2022-06-19 12:26

[QUOTE=kruoli;608096]You first decide on which core to start on. In your example, everything from 0–3 would be feasible as a start core. That would either involve performance cores 0–6 or 1–7. I would leave performance core 0 free because a lot of kernel thongs are still done on core 0 on windows. This would lead to:
[C]AffinitySetter -s 3 -m 7 llr64[/C],
assuming your executable is called [C]llr64[/C]. The option [C]-i[/C] does not need to be added since it is the default on Windows. Leave it running in background. It will automatically detect newly spawned processes.[/QUOTE]

Does it keep running and poll the system every few minutes to determine if the affinity of a process needs to be changed?

After running for a few minutes, it is doing nothing. I see no change in the affinity of the processes. I suggest a few things:

1) Add a switch that indicates if hyper threading is enabled. That way -s 1 -H -m 3 would use cores 1, 3, 5 and -S -m 3 would use cores 1, 2, 3.
2) Output information such as "no process found with that name".
3) Output information such as "process <processname> with pid <pid>" changed to use core <core>.
4) Add a switch to specify the number of seconds to poll the OS for running processes to change. Default to 60 seconds.

This means that your program will need to have a table of pids for which it changed the affinity so that it doesn't need to change them each time (and output that the affinity was changed) the system is polled.


All times are UTC. The time now is 11:43.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.