climateprediction.net home page
Windows Task Manager - Automatically set higher priority für CPDN

Windows Task Manager - Automatically set higher priority für CPDN

Message boards : Number crunching : Windows Task Manager - Automatically set higher priority für CPDN
Message board moderation

To post messages, you must log in.

AuthorMessage
Profile Friedrich S.

Send message
Joined: 22 Jan 05
Posts: 40
Credit: 4,390,001
RAC: 5,115
Message 71012 - Posted: 19 Jun 2024, 18:32:29 UTC

Hello,

I recently had a problem with CPDN WU taking an extremely long time. That was resolved, thanks to help in this forum (reduce number of WU per computer, prevent hyper-threading by limiting the number of CPUS9.
However, I noticed that CPDN WU have the lowest priority ("low") when checking in the Windows task manager. When I manually increase the priority, CPDN gets much more done in the same time frame. It just becomes more efficient.
Is there a way to tell BOINC or CPDN to start the WU with a higher priority (e.g. "lower than normal" instead of "low"). I did not find anything on this subject here in the forums or elsewhere.
Thank you very much!

Friedrich
I love CPDN!
--
ID: 71012 · Report as offensive     Reply Quote
Profile Dave Jackson
Volunteer moderator

Send message
Joined: 15 May 09
Posts: 4444
Credit: 17,930,996
RAC: 29,758
Message 71013 - Posted: 19 Jun 2024, 19:08:19 UTC - in response to Message 71012.  

I don't think there is. The problem is I think, the big difference between the time taken for the CPDN tasks along with the longer deadlines, though many tasks recently have had a deadline of one month rather than a year. The year long deadlines were a hangover from the days when on the machines I had then could take seven months or longer to complete a task. The longest tasks I have had in the past couple of years have taken about 20 days to complete. The ones from testing branch I am currently running (WAH2ri) will take about six days, albeit on a slightly faster machine than the one that started playing up recently.
ID: 71013 · Report as offensive     Reply Quote
Richard Haselgrove

Send message
Joined: 1 Jan 07
Posts: 1014
Credit: 35,791,220
RAC: 25,255
Message 71014 - Posted: 19 Jun 2024, 19:14:40 UTC - in response to Message 71012.  

BOINC gives CPU tasks the lowest possible priority - in effect, everything gets a higher priority than BOINC tasks. That's because the earliest idea of BOINC was "to use idle time on home computers": that dates from the time of single-core processors, and that CPU was either working for you, or for science. You won, and science lost.

BOINC doesn't provide any way of changing that situation, but there are third-party applications which do. I use one called 'Process Lasso' - https://bitsum.com/. It's free for personal use, at the cost of putting up with nag screens urging you to 'go pro' at every restart. You might think it's overkill, because a has a very complicated management screen which shows you details of every single process running on the machine, and allows you to set whatever priority you want, either temporally or every time that program is run. So take it carefully...

But in normal daily running, it just sits quietly in the notification area and looks after everything for you.
ID: 71014 · Report as offensive     Reply Quote
Profile Friedrich S.

Send message
Joined: 22 Jan 05
Posts: 40
Credit: 4,390,001
RAC: 5,115
Message 71015 - Posted: 19 Jun 2024, 19:27:44 UTC - in response to Message 71014.  

Thank you very much! It will look into this tool!
Have a great Day!

Friedrich
I love CPDN!
--
ID: 71015 · Report as offensive     Reply Quote
Glenn Carver

Send message
Joined: 29 Oct 17
Posts: 944
Credit: 15,193,000
RAC: 23,306
Message 71016 - Posted: 19 Jun 2024, 22:34:26 UTC - in response to Message 71015.  

In Windows you can change a process priority using Task Manager. Start it up, select the process in question, right mouse menu -> Details -> Select priority and change from Low to High. It's also possible to set the cpu affinity here as well but in practise I've found the changes don't stick for that.

I have not tested whether raising the priority makes any real difference to the runtime. I suspect very little since most of the time BOINC is running I'm not using it.
ID: 71016 · Report as offensive     Reply Quote
Glenn Carver

Send message
Joined: 29 Oct 17
Posts: 944
Credit: 15,193,000
RAC: 23,306
Message 71017 - Posted: 20 Jun 2024, 21:48:40 UTC - in response to Message 71016.  
Last modified: 20 Jun 2024, 21:49:14 UTC

Appreciate task manager is not 'automatic' but as a test I used it to change the priority from 'Low' to 'High' for the regional model process for two tasks I have running. The regional model can be ~3-5x more expensive to run than the global model and is the one to really focus on.

Since doing that this morning the average secs per model step (as reported by the task in the stdout_mon.txt file found in the project directory) has decreased by 2%. Since this is a long term average computed from the model start, it's likely the speedup is more. The PC has only been computing boinc tasks.

Anyway, certainly seems worth a few mouse clicks for long running tasks.
---
CPDN Visiting Scientist
ID: 71017 · Report as offensive     Reply Quote
Glenn Carver

Send message
Joined: 29 Oct 17
Posts: 944
Credit: 15,193,000
RAC: 23,306
Message 71018 - Posted: 21 Jun 2024, 13:00:22 UTC - in response to Message 71017.  
Last modified: 21 Jun 2024, 13:02:38 UTC

Richard's suggestion of 'Process Lasso' was rather heavyweight for me, so after a bit of online searching it's possible to reset the priorities with a powershell two-liner:

get-process -processname  "wah2rm3m2t_um_8.31_windows_intelx86"   | foreach { $_.PriorityClass = "Normal" }
get-process -processname  "wah2am3m2_um_8.31_windows_intelx86"   | foreach { $_.PriorityClass = "Normal" }
Execute this in a powershell with Admin privilege.

Note 'Normal' is case-sensitive and first letter must be capital. Choice is 'Normal', 'Above normal', 'High' (or 'Below normal' which is higher than 'Low' the boinc default). The '.exe' extension is not needed. Change the process name as required. TaskManager can be used to verify the process priority has changed. It's certainly improved my runtimes by a small percentage.

To make it even easier as a powershell script:
.\set-ProcessPriority

where the script is:
function set-ProcessPriority {
    param($processName = $(throw "Enter process name"), $priority = "Normal")

    get-process -processname $processname | foreach { $_.PriorityClass = $priority }
    echo "`"$($processName)`"'s priority is set to `"$($priority)`""
}
set-ProcessPriority "wah2am3m2_um_8.31_windows_intelx86"   "High"
set-ProcessPriority "wah2rm3m2t_um_8.31_windows_intelx86"  "High"
Save this to a file 'set-ProcessPriority.ps1'. Change 'High' to your preference.

If the script does not run, the execution policy may need to be changed:
Set-ExecutionPolicy RemoteSigned -Scope Process
which only changes it for the current session.

Credit to: https://monadblog.blogspot.com/2006/03/msh-how-to-change-processs-priority.html
---
CPDN Visiting Scientist
ID: 71018 · Report as offensive     Reply Quote
Profile Dave Jackson
Volunteer moderator

Send message
Joined: 15 May 09
Posts: 4444
Credit: 17,930,996
RAC: 29,758
Message 71019 - Posted: 21 Jun 2024, 14:58:52 UTC

and in Linux
renice n -p process_id
Process_id is the number of the process. (you can find this by executing the command
top
in a terminal. n is an integer between -20 and 19. Negative numbers are a higher priority and need sudo in Ubuntu to run or another way of gaining root privileges in other distributions.
ID: 71019 · Report as offensive     Reply Quote

Message boards : Number crunching : Windows Task Manager - Automatically set higher priority für CPDN

©2024 climateprediction.net