Skip to content
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

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/test_cooperative_wait.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tests for the various kinds of waits
include("common.jl")

MPI.Init()
MPI.Init(threadlevel=:multiple)
Copy link
Member

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?

Copy link
Member Author

@lcw lcw Sep 14, 2023

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

function Init(;threadlevel=:serialized, finalize_atexit=true, errors_return=true)

Copy link
Contributor

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 ?

Copy link
Member Author

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.

Copy link
Member

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)

Copy link
Contributor

@luraess luraess Sep 15, 2023

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()

Copy link
Member

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.


myrank = MPI.Comm_rank(MPI.COMM_WORLD)
commsize = MPI.Comm_rank(MPI.COMM_WORLD)
Expand Down