Welcome to MilkyWay@home

N-body code - preference to limit # of CPUs?

Message boards : Number crunching : N-body code - preference to limit # of CPUs?
Message board moderation

To post messages, you must log in.

AuthorMessage
Ralph Hyre

Send message
Joined: 16 Aug 09
Posts: 1
Credit: 96,797
RAC: 0
Message 64033 - Posted: 24 Oct 2015, 12:25:36 UTC

I'm looking for a way to limit the max # of CPUs used by the milky-way N-body 1.5 application.

It currently uses the Max CPUs in my boinc configuration, but that prevents any other CPU-based tasks from running while that's going on. Is there a separate config file I need to edit?

Sat 24 Oct 2015 08:11:29 AM EDT | Milkyway@Home | Starting task ps_nbody_10_07_15_orphan_sim_1_1437561602_4262909_2 using milkyway_nbody version 152 (mt) in slot 4
ID: 64033 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile mikey
Avatar

Send message
Joined: 8 May 09
Posts: 3339
Credit: 524,010,781
RAC: 0
Message 64035 - Posted: 25 Oct 2015, 11:14:30 UTC - in response to Message 64033.  

I'm looking for a way to limit the max # of CPUs used by the milky-way N-body 1.5 application.

It currently uses the Max CPUs in my boinc configuration, but that prevents any other CPU-based tasks from running while that's going on. Is there a separate config file I need to edit?

Sat 24 Oct 2015 08:11:29 AM EDT | Milkyway@Home | Starting task ps_nbody_10_07_15_orphan_sim_1_1437561602_4262909_2 using milkyway_nbody version 152 (mt) in slot 4


Nope the N-body units are designed to do that, just exclude them and run the normal cpu units.
ID: 64035 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
captainjack

Send message
Joined: 22 Jun 13
Posts: 44
Credit: 64,258,609
RAC: 0
Message 64037 - Posted: 25 Oct 2015, 12:56:53 UTC
Last modified: 25 Oct 2015, 12:57:48 UTC

Ralph Hyre,

There is a rather obscure option in the app_config.xml file to limit the number of CPU's used by the multi-thread N-Body tasks. Put together an app_conf.xml file that looks like the one below and store it in the Boinc\projects\milkyway.cs.rpi.edu_milkyway directory.

The line that says <avg_ncpus>8</avg_ncpus> tells BOINC how many threads to reserve in it's job scheduling logic for the task.

The line that says <cmdline>--nthreads 8</cmdline> tells the N-Body task how many threads to use.

You will need to set those two lines to the number of threads that you want the N-Body tasks to use.

<app_config>
<app>
<name>milkyway_nbody</name>
<max_concurrent>1</max_concurrent>
</app>
<app_version>
<app_name>milkyway_nbody</app_name>
<plan_class>mt</plan_class>
<avg_ncpus>8</avg_ncpus>
<cmdline>--nthreads 8</cmdline>
</app_version>
</app_config>


After you save the app_config_xml file in the milkyway folder, either restart BOINC or open the BOINC manager and tell it to "Read Config Files" (one of the options that you can get to from the menu bar at the top of BOINC Manager). In the Event Log, you should find a line that says "Milkyway@Home (data time) Found app_config.xml". Then download some N-body tasks and see if they conform to the new parameters.

If you run into problems, you should be able to do a search for app_config.xml and find some useful hints.

Hope that helps.
ID: 64037 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile mikey
Avatar

Send message
Joined: 8 May 09
Posts: 3339
Credit: 524,010,781
RAC: 0
Message 64041 - Posted: 26 Oct 2015, 11:47:40 UTC - in response to Message 64037.  

Ralph Hyre,

There is a rather obscure option in the app_config.xml file to limit the number of CPU's used by the multi-thread N-Body tasks. Put together an app_conf.xml file that looks like the one below and store it in the Boinc\projects\milkyway.cs.rpi.edu_milkyway directory.

The line that says <avg_ncpus>8</avg_ncpus> tells BOINC how many threads to reserve in it's job scheduling logic for the task.

The line that says <cmdline>--nthreads 8</cmdline> tells the N-Body task how many threads to use.

You will need to set those two lines to the number of threads that you want the N-Body tasks to use.

<app_config>
<app>
<name>milkyway_nbody</name>
<max_concurrent>1</max_concurrent>
</app>
<app_version>
<app_name>milkyway_nbody</app_name>
<plan_class>mt</plan_class>
<avg_ncpus>8</avg_ncpus>
<cmdline>--nthreads 8</cmdline>
</app_version>
</app_config>


After you save the app_config_xml file in the milkyway folder, either restart BOINC or open the BOINC manager and tell it to "Read Config Files" (one of the options that you can get to from the menu bar at the top of BOINC Manager). In the Event Log, you should find a line that says "Milkyway@Home (data time) Found app_config.xml". Then download some N-body tasks and see if they conform to the new parameters.

If you run into problems, you should be able to do a search for app_config.xml and find some useful hints.

Hope that helps.


Huh live and learn...THANKS!!
ID: 64041 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
noderaser
Avatar

Send message
Joined: 16 Dec 13
Posts: 23
Credit: 49,017,905
RAC: 4,288
Message 64045 - Posted: 28 Oct 2015, 23:24:51 UTC

Personally, I prefer the multi-threaded apps for the lower memory overhead and other benefits. If you're concerned about splitting up your contribution between multiple projects, the BOINC resource share is supposed to do that.
Click here to see My Detailed BOINC Stats
ID: 64045 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Thunder
Avatar

Send message
Joined: 9 Jul 08
Posts: 85
Credit: 44,842,651
RAC: 0
Message 64548 - Posted: 14 May 2016, 22:03:07 UTC

This was exactly what I needed.

I knew about <avg_ncpus> from other projects, but without <cmdline>--nthreads, n-body tasks were still behaving as *Must use ALL the THREADS* and choking off GPU utilization.

Now I'm still able to use most cores for CPU work and still keep the GPU over 90% utilized. :-)

Thanks captainjack.
ID: 64548 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Super Nova Nerd
Avatar

Send message
Joined: 17 Feb 16
Posts: 14
Credit: 11,121,737
RAC: 0
Message 64554 - Posted: 19 May 2016, 1:18:19 UTC
Last modified: 19 May 2016, 1:20:39 UTC

I was looking for this as well. My newly modified app_config file is working great.

<app_config>
<app>
<name>milkyway_nbody</name>
<gpu_versions>
<gpu_usage>.5</gpu_usage>
<cpu_usage>.5</cpu_usage>
</gpu_versions>
</app>
<app>
<name>milkyway</name>
<gpu_versions>
<gpu_usage>.5</gpu_usage>
<cpu_usage>.5</cpu_usage>
</gpu_versions>
</app>
<app>
<name>milkyway_separation__modified_fit</name>
<gpu_versions>
<gpu_usage>.5</gpu_usage>
<cpu_usage>.5</cpu_usage>
</gpu_versions>
</app>
<app>
<name>milkyway_nbody</name>
<max_concurrent>1</max_concurrent>
</app>
<app_version>
<app_name>milkyway_nbody</app_name>
<plan_class>mt</plan_class>
<avg_ncpus>1</avg_ncpus>
<cmdline>--nthreads 1</cmdline>
</app_version>
</app_config>

Everything else runs on one CPU, N-Body should as well. 7 CPU tasks and 2 GPU tasks at a time keep everything loaded nicely.
ID: 64554 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote

Message boards : Number crunching : N-body code - preference to limit # of CPUs?

©2024 Astroinformatics Group