Message boards : API : determining the number of cpus available to bionc client & scheduling question
Message board moderation
Author | Message |
---|---|
Send message Joined: 8 Dec 09 Posts: 5 |
I was wondering if anyone has an example that shows how to determine the number of CPUs available to the boinc client programatically. What I would like to do is ultimately be able to tell the number of cores available to a boinc client so that I can run one process with access to all of the available cores. For example if the client is configured to use 4 cores, I would like to run one process that utilizes 4 cores rather than 4 process that each utilize one core. Thanks for your help! |
Send message Joined: 29 Aug 05 Posts: 15574 |
Then make a Multi threading application. If you do not want to set up a project and have your own applications, but are asking this for the use on already existing projects, then this isn't possible. The application decides how many CPUs it uses, not BOINC. |
Send message Joined: 19 Jan 07 Posts: 1179 |
You can't and shouldn't try to get the host's CPU count from the client. If your app uses four CPU-intensive threads, BOINC would still run three other apps, thinking your app only uses one core. The decision of how many threads to use should be done in the server, using a plan class. Then the client would receive a workunit description saying it uses 4 CPUs, and schedule it correctly. From your app_plan function in the server, you can also add command line arguments to the workunit, which would tell your application how many threads to use. |
Send message Joined: 8 Dec 09 Posts: 5 |
thanks! |
Send message Joined: 5 Oct 06 Posts: 5134 |
thanks! would either of you happen to have an example for the mt plan class, namely what needs to be done for xadd and update_versions to recognize the mt plan class mentioned on the wiki? an example of the file structure would also help for the apps directory The best idea would be to ask the devs (Neo and Boinc_Admin) at the AQUA project - they've been using it live for about a year now, and have helped to get a lot of the bugs out of the BOINC [mt] system. |
Copyright © 2025 University of California.
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.