{"action":"opened","issue":{"url":"https://api.github.com/repos/BOINC/boinc/issues/663","labels_url":"https://api.github.com/repos/BOINC/boinc/issues/663/labels{/name}","comments_url":"https://api.github.com/repos/BOINC/boinc/issues/663/comments","events_url":"https://api.github.com/repos/BOINC/boinc/issues/663/events","html_url":"https://github.com/BOINC/boinc/issues/663","id":56194999,"number":663,"title":"Handling of multithreaded work units","user":{"login":"romw","id":985772,"avatar_url":"https://avatars.githubusercontent.com/u/985772?v=3","gravatar_id":"","url":"https://api.github.com/users/romw","html_url":"https://github.com/romw","followers_url":"https://api.github.com/users/romw/followers","following_url":"https://api.github.com/users/romw/following{/other_user}","gists_url":"https://api.github.com/users/romw/gists{/gist_id}","starred_url":"https://api.github.com/users/romw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romw/subscriptions","organizations_url":"https://api.github.com/users/romw/orgs","repos_url":"https://api.github.com/users/romw/repos","events_url":"https://api.github.com/users/romw/events{/privacy}","received_events_url":"https://api.github.com/users/romw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"davidpanderson","id":985729,"avatar_url":"https://avatars.githubusercontent.com/u/985729?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpanderson","html_url":"https://github.com/davidpanderson","followers_url":"https://api.github.com/users/davidpanderson/followers","following_url":"https://api.github.com/users/davidpanderson/following{/other_user}","gists_url":"https://api.github.com/users/davidpanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpanderson/subscriptions","organizations_url":"https://api.github.com/users/davidpanderson/orgs","repos_url":"https://api.github.com/users/davidpanderson/repos","events_url":"https://api.github.com/users/davidpanderson/events{/privacy}","received_events_url":"https://api.github.com/users/davidpanderson/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-02-02T04:30:39Z","updated_at":"2015-02-02T04:30:39Z","closed_at":null,"body":"**Reported by MikeMarsUK on 16 Dec 37447796 16:53 UTC**\nHope this isn't a duplicate:\r\n\r\nCarl is working on a 64-bit climate model (HadGEM) which uses 4.7GB of RAM, and would be multithreaded.  Probably will not be live for at least a year.\r\n\r\nBoinc will need to be able to cope with huge multithreaded work units in the future (in version 7.0 or 8.0 I guess).\r\n\r\nQuote: \r\n> sending out multicore-ready models (via MPI) is something I've been toying with, esp for the higher-res models. although I'm not sure how BOINC will react to that, I suppose it couldn't stop our monitor job from launching a 2 or 4-CPU-usage model, but it would probably schedule other work to be done on these CPUs so we'd all be \"fighting\" for the same cores etc.\r\n\r\n[http://boinc.berkeley.edu/dev/forum_thread.php?id=1863&nowrap=true#10839]\r\n\r\nThe following is just speculation since I'm not familiar with the internals of Boinc, so please forgive me if I go off on an irrelevant tangent:\r\n\r\nI think there is a strong push towards multithreaded software at the moment, and it would have significant advantages for something which uses a huge amount of RAM.\r\n\r\nA giant work unit such as being discussed here would likely run on a PC with many cores (server or very-high-end enthusiast's machine), but a max of 1 or 2GB RAM per core (since core-count is rising quicker than memory). If it was running with a single thread, it would be RAM-bound and most of the CPUs would be idle. On the other hand, if it were allowed to use all available cores for one work unit then it'd run much quicker (i.e., on an 8GB box with 4 cores, you could run one model using one core, and have smaller jobs on the other cores, or run the same model using all the cores in ~1/4 the time).\r\n\r\nSeveral ways to handle multithreaded jobs come to mind, all with different problems... \r\n\r\n * No limit on threads, exclusive access to the machine for it's timeslot (and debt would be charged per physical core available).  But if the work unit's thread usage fluctuates over time, that'd lead to wasted CPU time.\r\n\r\n * or reserve a number of cores but allow other jobs to run at the same time on the remaining cores  (e.g., 1 job exclusively using 2 threads, + 2 jobs using 1 thread each on a 4 core box)\r\n\r\n * or let multiple work units fight for CPU time (i.e., allow more threads of work than there are physical cores, and let the operating system sort it all out.  4 jobs using 4 cores, any number of active threads).  Risk of CPU starvation?\r\n\r\nThe work-request process might need to consider memory size (i.e., don't simultaneously issue 4 5GB work units to a PC with 8GB and 4 cores since only one can practically run at a time).\r\n\r\nThe round-robin simulator would also need to take this into account. In addition it'd need to be able to simulate a task taking up many cores rather than assuming each task is one core. \r\n\r\nThe daemon would need to only start sufficient tasks to use the PC's core count (e.g., 2 tasks with one thread, 1 with 2 threads). On the other hand, if a work unit is not keeping all it's threads busy 100% of the time, perhaps a few extra running tasks would be OK as long as CPU starvation doesn't occur.\r\n\r\n\r\n\r\n\n\nMigrated-From: http://boinc.berkeley.edu/trac/ticket/266"}}