-
Notifications
You must be signed in to change notification settings - Fork 4
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
COMP: apply split between threads and work units in ITK5 #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💚
@@ -154,7 +154,7 @@ void | |||
LabelSetMorphBaseImageFilter< TInputImage, doDilate, TOutputImage > | |||
::GenerateData(void) | |||
{ | |||
ThreadIdType nbthreads = this->GetNumberOfThreads(); | |||
ThreadIdType nbthreads = this->GetNumberOfWorkUnits(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also change the variable name: nbthreads
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had noticed it at various points in ITK itself and the remotes as well. Since the name of the variable is not consistent across all of them, this would require a non-negligible amount of work. May be an issue in ITK would help having this in mind. If no objections exist, I'll open the issue tonight, and the desired variable naming can be discussed there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to address it in other places.
To avoid confusion, workUnits
or numberOfWorkUnits
will be more accurate than a variable that indicates it is the number of threads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like pieces
. It is short, and its use can be inferred from the method names it is used with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like pieces
also: can remain unchanged when at some point in time multi-threading gets a new refactoring (not in the near future we hope 😁 ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nbthreads
is not an English word, I may suggest something like numberOfThreads
(already used in ITK), this would also help keep tool like codespell happy.
To get an idea, here are some stats from ITK master:
$ ack numberOfThreads | wc -l
179
$ ack nbthreads | wc -l
7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the stats Jean-Christophe: opened in InsightSoftwareConsortium/ITK#86
No description provided.