-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use max_cores in taskQueue instead of system cores #2038
Conversation
The class TascQueue accepts an argument `thread_count` that is used for the max size of a queue. In the `MultithreadedJobExecutor `class there is a variable defined (`max_cores`) that is getting its value from the available cores of the machine. Further down in the same class when TaskQueue is called instead of using the `max_cores` it is using `psutil.cpu_count()`. I suggest to use the self.max_cores in the call of TaskQueue in the file executor.py instead of psutil.cpu_count() Use case: when a job executor is setup as MultithreadedJobExecutor one can override the max_cores after the initialization of the object and limit the use to the specified cores. Additional enhancement would be to include an argument to allow the use to provide the number of cores available for use
Update executors.py
Hello, is there any update on this? |
hi @kmavrommatis, I'm taking a look at it. It should already be the case that it will not start more than On the other hand if you want to start more than That said, it would be a useful feature to add command line options like |
Hi @tetron |
@kmavrommatis just to confirm, are you requesting a fractional core in your CWL file? e.g. |
Hey @kmavrommatis , thank you for opening this PR. Why do you want to run so many CWL Processes at the same time? Are they very short processes and you want to launch many to avoid delays from the setup and tear-down? Or are they IO-bound, so by over-subscribing the system it is still faster to be processing other jobs while some are waiting for IO? Ah, I see that you are working with Okay, this PR makes more sense to me now. It should produce identical behavior for everyone, except those that override |
Exactly right, |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2038 +/- ##
=======================================
Coverage 84.01% 84.01%
=======================================
Files 46 46
Lines 8302 8302
Branches 1957 1957
=======================================
Hits 6975 6975
Misses 853 853
Partials 474 474 ☔ View full report in Codecov by Sentry. |
A new https://github.com/common-workflow-language/cwltool/releases/tag/3.1.20241112140730 / https://github.com/common-workflow-language/cwltool/releases/tag/3.1.20241112140730 |
The class
TascQueue
accepts an argumentthread_count
that is used for the max size of a queue.In the MultithreadedJobExecutor class there is a variable defined (
max_cores
) that is getting its value from the available cores of the machine. Further in the same class when TaskQueue is called instead of using the max_cores it is usingpsutil.cpu_count()
.I propose to use the
max_cores
variable when initializing the TaskQueue.Use case. one can override the max_cores in the MutlithreadedJobExecutor after initialization and force cwltool to use only up to a certain number of cores.