-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Init cooperative wait test for multiple threads #770
Conversation
In the cooperative wait test multiple threads are calling MPI functions in a non-serialized way. Thus, MPI needs to be initialized with `threadlevel=:multiple`.
@@ -1,7 +1,7 @@ | |||
# tests for the various kinds of waits | |||
include("common.jl") | |||
|
|||
MPI.Init() | |||
MPI.Init(threadlevel=:multiple) |
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.
Isn't that our default?
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.
Nope, the default is :serialized
, see
Line 114 in a57528f
function Init(;threadlevel=:serialized, finalize_atexit=true, errors_return=true) |
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.
Is this always the case here or only if one launches Julia with threads > 1
?
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 question. I guess it would be only when julia is launched with more than one thread. But Valentin would know better.
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 went with :serialized
as that is the most common use case, and not all MPI libraries support :multiple
by default (or they might incur additional overhead)
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.
So ideally one should always have
(Threads.nthreads() > 1) ? MPI.Init(threadlevel=:multiple) : MPI.Init()
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.
This doesn't account for interactive threadpool usage, or foreign threads being dynamically added.
maxthreadid
is probably okay, but that get's skewed by GC threads and the IO thread.
In the cooperative wait test multiple threads are calling MPI functions in a non-serialized way. Thus, MPI needs to be initialized with
threadlevel=:multiple
.