Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @Guilucand — When processing some data with GGCAT, @jamshed and I noticed that sometimes the number of threads in use can substantially exceed the thread count requested by the user. This increased CPU usage typically does not last the entire duration of the run, but it does happen for an extended duration of time during the initial phases of the algorithm. Specifically, we noticed that when requesting 16 threads, we were seeing peak CPU usage ~2800% or about (7/4) * the user requested thread count.
There are several places in the code where the thread count is passes around between components, but this was the first one that stood out. Here, the number of compute and read threads is set based on dividing up the total number of threads, and later those threads are spawned. However, the current allocation allots a sum equal to substantially more threads than the initial
threads_count
. This addresses that discrepancy by ensuring thatcompute_threads_count
+read_threads_count
doesn't exceedthreads_count
.Of course, I'm not sure if this is the partition of the work you want, or if you want to use a fixed partition to begin with, but hopefully this will be useful in figuring out how to address the discrepancy between the requested thread count and the actual peak usage.