mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2022-06-17, 02:28   #12
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2×13×257 Posts
Default

Quote:
Originally Posted by kruoli View Post
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.
If I have multiple copies of llr, does it set affinity based upon the runtime directory of llr?
rogue is offline   Reply With Quote
Old 2022-06-17, 08:27   #13
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

26·17 Posts
Default

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.
kruoli is online now   Reply With Quote
Old 2022-06-17, 14:51   #14
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2·13·257 Posts
Default

Quote:
Originally Posted by kruoli View Post
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.
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.
rogue is offline   Reply With Quote
Old 2022-06-17, 18:25   #15
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

26×17 Posts
Default

Yes, take a look at the help the program generates (-h switch). You can set
  • the first core to assign to.
  • the increment (on Windows, this would be 2 when having HT).
  • the maximum worker count.
kruoli is online now   Reply With Quote
Old 2022-06-18, 13:25   #16
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

668210 Posts
Default

I d/l'd your program, ran it in a command window (started as administrator). Used -h. Nothing. It doesn't output anything.
rogue is offline   Reply With Quote
Old 2022-06-18, 13:38   #17
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

26·17 Posts
Default

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.

Last fiddled with by kruoli on 2022-06-18 at 13:39 Reason: Clarification.
kruoli is online now   Reply With Quote
Old 2022-06-18, 17:14   #18
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2×13×257 Posts
Default

Quote:
Originally Posted by kruoli View Post
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.
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.
rogue is offline   Reply With Quote
Old 2022-06-18, 18:55   #19
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

22·1,063 Posts
Default

If you turn off the energy efficient cores in BIOS, does your motherboard allow the performance cores to use AVX512?
paulunderwood is online now   Reply With Quote
Old 2022-06-18, 20:48   #20
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2×13×257 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
If you turn off the energy efficient cores in BIOS, does your motherboard allow the performance cores to use AVX512?
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.
rogue is offline   Reply With Quote
Old 2022-06-19, 07:55   #21
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

26×17 Posts
Default

Quote:
Originally Posted by rogue View Post
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.
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:
AffinitySetter -s 3 -m 7 llr64,
assuming your executable is called llr64. The option -i 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.
kruoli is online now   Reply With Quote
Old 2022-06-19, 12:26   #22
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2·13·257 Posts
Default

Quote:
Originally Posted by kruoli View Post
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:
AffinitySetter -s 3 -m 7 llr64,
assuming your executable is called llr64. The option -i 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.
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.

Last fiddled with by rogue on 2022-06-19 at 12:36
rogue is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prime95 and cpu affinity pepi37 Software 4 2019-04-25 05:51
Unexplained slowdown (affinity problem?) Siegmund Software 6 2017-06-03 05:31
[Patch] CPU affinity prompt problem in mprime Linux / OS X build Explorer09 Software 1 2017-03-01 02:34
Set affinity does not work g33py Software 3 2016-07-27 05:26
Processor Affinity R.D. Silverman Programming 19 2015-04-24 22:46

All times are UTC. The time now is 23:04.


Mon Aug 15 23:04:44 UTC 2022 up 39 days, 17:52, 1 user, load averages: 0.87, 1.19, 1.22

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔