N-Body Search Simulation using all CPUs
log in

Advanced search

Message boards : Number crunching : N-Body Search Simulation using all CPUs

Author Message
Jim Wilkins
Send message
Joined: 1 Jan 08
Posts: 40
Credit: 1,676,165
RAC: 0

Message 59548 - Posted: 8 Aug 2013, 18:26:14 UTC

Hi all,

The N-Body app is using all of my CPUs (4). I really only want it to use 1-2. Can I control this?
____________

Jim Wilkins
Send message
Joined: 1 Jan 08
Posts: 40
Credit: 1,676,165
RAC: 0

Message 59549 - Posted: 8 Aug 2013, 18:39:24 UTC - in response to Message 59548.

Hi all,

The N-Body app is using all of my CPUs (4). I really only want it to use 1-2. Can I control this?


Update: It just aborted with a computation error.

mikey
Avatar
Send message
Joined: 8 May 09
Posts: 2032
Credit: 180,589,235
RAC: 290,191

Message 59550 - Posted: 8 Aug 2013, 18:41:18 UTC - in response to Message 59548.

Hi all,

The N-Body app is using all of my CPUs (4). I really only want it to use 1-2. Can I control this?


Sort of, I am a Windows guy NOT a Linux guy so bear with me...open the Boinc Manager and then click on Tools and then computing preferences. Click on the processor usage tab and the second line up from the bottom that says:
"on multiprocessor systems, use at most {_} % of the processors."
Change it from the current 100 to 50 and your pc will only use half the total processing time available to crunch.

Jim Wilkins
Send message
Joined: 1 Jan 08
Posts: 40
Credit: 1,676,165
RAC: 0

Message 59551 - Posted: 8 Aug 2013, 18:54:30 UTC - in response to Message 59550.
Last modified: 8 Aug 2013, 18:56:21 UTC

Thanks for the response. However, that control applies to all apps that are running. For instance, what I want to do is run MW on one CPU and run other apps on the remaining three CPUs. BTW, this is a Mac system, but your response still applied.

Jim

Richard Haselgrove
Send message
Joined: 4 Sep 12
Posts: 218
Credit: 448,778
RAC: 0

Message 59553 - Posted: 8 Aug 2013, 20:10:33 UTC - in response to Message 59548.

The N-Body app is using all of my CPUs (4). I really only want it to use 1-2. Can I control this?

Not currently. This is a BOINC feature, not a Milkyway feature, and it will vary a bit from BOINC version to version, but the best recipe I've been able to find is:

Set 'No New Tasks' for the Milkyway project, and reduce the amount of CPU work (from all projects) that you have cached on your computer as far as possible.

As Mikey suggested, change "on multiprocessor systems, use at most {_} % of the processors." to 50%

Allow work fetch for Milkyway, and download as much new N-Body work as you can.

Set 'No New Tasks' for Milkyway again.

Set "on multiprocessor systems, use at most {_} % of the processors." back to 100%

You should now have a bunch of Milkyway work on your machine which will compute using two cores, and BOINC should schedule other projects to use the other two cores.

Rinse and repeat....
------------------------------------------------------------------------------
The reason this works (if I've got the description right - it's been a while since I researched this, and I only researched it under Windows) is that whenever you download new work, the N-Body program is reset to use the number of CPUs BOINC was allowed to use at the time of the download.

That's because the <app_version> block downloaded with the new work contains two distinct values:

<max_ncpus> 4 [or 2]
<cmdline>--nthreads 4 [or 2]

The first controls how many cores BOINC will allocate to N-Body, and the second controls how much CPU power N-Body will actually use (they need to be the same for efficient cunching). If you have cpu usage set to 50% when you request new work, both will be set to 2, and you have the slack for other projects that you want. As soon as you download new N-Body work while cpu usage is set to 100%, both numbers will jump up to 4, and you'll be back in your current position.

Jim Wilkins
Send message
Joined: 1 Jan 08
Posts: 40
Credit: 1,676,165
RAC: 0

Message 59554 - Posted: 8 Aug 2013, 20:28:09 UTC - in response to Message 59553.

Thanks,

Jim

mikey
Avatar
Send message
Joined: 8 May 09
Posts: 2032
Credit: 180,589,235
RAC: 290,191

Message 59593 - Posted: 14 Aug 2013, 14:13:52 UTC - in response to Message 59553.


------------------------------------------------------------------------------
The reason this works (if I've got the description right - it's been a while since I researched this, and I only researched it under Windows) is that whenever you download new work, the N-Body program is reset to use the number of CPUs BOINC was allowed to use at the time of the download.

That's because the <app_version> block downloaded with the new work contains two distinct values:

<max_ncpus> 4 [or 2]
<cmdline>--nthreads 4 [or 2]

The first controls how many cores BOINC will allocate to N-Body, and the second controls how much CPU power N-Body will actually use (they need to be the same for efficient cunching). If you have cpu usage set to 50% when you request new work, both will be set to 2, and you have the slack for other projects that you want. As soon as you download new N-Body work while cpu usage is set to 100%, both numbers will jump up to 4, and you'll be back in your current position.


Can you set this thru a cc_config.xml or app_config.xml file you put inside the project directory? So it tells the project to ONLY EVER use the number specified.

Richard Haselgrove
Send message
Joined: 4 Sep 12
Posts: 218
Credit: 448,778
RAC: 0

Message 59594 - Posted: 14 Aug 2013, 18:44:28 UTC - in response to Message 59593.

------------------------------------------------------------------------------
The reason this works (if I've got the description right - it's been a while since I researched this, and I only researched it under Windows) is that whenever you download new work, the N-Body program is reset to use the number of CPUs BOINC was allowed to use at the time of the download.

That's because the <app_version> block downloaded with the new work contains two distinct values:

<max_ncpus> 4 [or 2]
<cmdline>--nthreads 4 [or 2]

The first controls how many cores BOINC will allocate to N-Body, and the second controls how much CPU power N-Body will actually use (they need to be the same for efficient cunching). If you have cpu usage set to 50% when you request new work, both will be set to 2, and you have the slack for other projects that you want. As soon as you download new N-Body work while cpu usage is set to 100%, both numbers will jump up to 4, and you'll be back in your current position.

Can you set this thru a cc_config.xml or app_config.xml file you put inside the project directory? So it tells the project to ONLY EVER use the number specified.

No, you can't.

cc_config.xml is global across all projects - no use for single-project stuff.
app_config.xml works - individually - for each separate app supplied by a single project - so it would be exactly the right place to do this, if possible. The <max_cpus> might work, but at the moment there's no way of controlling <cmdline> from app_config.

I did ask David Anderson to add the feature, for precisely this reason, but he declined - saying (a) he didn't think it would work [I disagree, because I've done the same thing via an app_info, several times on several projects], and (b) because he views app_config as a temporary kludge until greater application control is added to the Manager - that may be the BOINC 8 reference you were half-remembering in the News thread a couple of days ago.

So, for the time being, we're stuck half-way, with an app_config that works within limits: but won't be extended until some vapourware that I haven't seen any sign of yet comes along.

Unless project admins gang up to put some pressure on David to give it a try? I believe the original impetus for app_config.xml came from World Community Grid - maybe it would be worth asking there, if anyone here is also a member there? (I'm not)
------------------------------------------------------------------------------
I tried the 'fetch new work while the number of CPUs is restricted' trick I described with development BOINC v7.2.10 - and it worked fine. But I found I could only get a limited amount of Milkyway work at a time ("You have reached a limit for the number of tasks in progress"), which made it very tedious. Having proved the point (to my personal satisfaction, at least), I gave up, and my laptop is now crunching Milkyway of all cores for a while, then switching away and running four separate tasks from other projects. That doesn't need babysitting, and it all comes out the same in the end.

mikey
Avatar
Send message
Joined: 8 May 09
Posts: 2032
Credit: 180,589,235
RAC: 290,191

Message 59596 - Posted: 14 Aug 2013, 20:15:37 UTC - in response to Message 59594.
Last modified: 14 Aug 2013, 20:16:10 UTC

------------------------------------------------------------------------------
The reason this works (if I've got the description right - it's been a while since I researched this, and I only researched it under Windows) is that whenever you download new work, the N-Body program is reset to use the number of CPUs BOINC was allowed to use at the time of the download.

That's because the <app_version> block downloaded with the new work contains two distinct values:

<max_ncpus> 4 [or 2]
<cmdline>--nthreads 4 [or 2]

The first controls how many cores BOINC will allocate to N-Body, and the second controls how much CPU power N-Body will actually use (they need to be the same for efficient cunching). If you have cpu usage set to 50% when you request new work, both will be set to 2, and you have the slack for other projects that you want. As soon as you download new N-Body work while cpu usage is set to 100%, both numbers will jump up to 4, and you'll be back in your current position.

Can you set this thru a cc_config.xml or app_config.xml file you put inside the project directory? So it tells the project to ONLY EVER use the number specified.

No, you can't.

cc_config.xml is global across all projects - no use for single-project stuff.
app_config.xml works - individually - for each separate app supplied by a single project - so it would be exactly the right place to do this, if possible. The <max_cpus> might work, but at the moment there's no way of controlling <cmdline> from app_config.

I did ask David Anderson to add the feature, for precisely this reason, but he declined - saying (a) he didn't think it would work [I disagree, because I've done the same thing via an app_info, several times on several projects], and (b) because he views app_config as a temporary kludge until greater application control is added to the Manager - that may be the BOINC 8 reference you were half-remembering in the News thread a couple of days ago.

So, for the time being, we're stuck half-way, with an app_config that works within limits: but won't be extended until some vapourware that I haven't seen any sign of yet comes along.

Unless project admins gang up to put some pressure on David to give it a try? I believe the original impetus for app_config.xml came from World Community Grid - maybe it would be worth asking there, if anyone here is also a member there? (I'm not)
------------------------------------------------------------------------------
I tried the 'fetch new work while the number of CPUs is restricted' trick I described with development BOINC v7.2.10 - and it worked fine. But I found I could only get a limited amount of Milkyway work at a time ("You have reached a limit for the number of tasks in progress"), which made it very tedious. Having proved the point (to my personal satisfaction, at least), I gave up, and my laptop is now crunching Milkyway of all cores for a while, then switching away and running four separate tasks from other projects. That doesn't need babysitting, and it all comes out the same in the end.


I am at WCG but do not crunch the cpu units here, I was thinking I could start but not if it can't be controlled better.
Thanks!!


Post to thread

Message boards : Number crunching : N-Body Search Simulation using all CPUs


Main page · Your account · Message boards


Copyright © 2017 AstroInformatics Group