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

Allow setting thread level for tests #690

Open
giordano opened this issue Dec 12, 2022 · 2 comments
Open

Allow setting thread level for tests #690

giordano opened this issue Dec 12, 2022 · 2 comments

Comments

@giordano
Copy link
Member

MVAPICH on Ookami doesn't support threading, but we default MPI.Init to threadlevel=:serialized

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

and this creates a lot of noise when running the tests because each test would print a series of

┌ Warning: MPI thread level requested = MPI.ThreadLevel(2), provided = MPI.ThreadLevel(0)                                                                                                                         
└ @ MPI ~/.julia/dev/MPI/src/environment.jl:96                                                                                                                                                                    
┌ Warning: MPI thread level requested = MPI.ThreadLevel(2), provided = MPI.ThreadLevel(0)                                                                                                                         
└ @ MPI ~/.julia/dev/MPI/src/environment.jl:96                                                                                                                                                                    
┌ Warning: MPI thread level requested = MPI.ThreadLevel(2), provided = MPI.ThreadLevel(0)                                                                                                                         
└ @ MPI ~/.julia/dev/MPI/src/environment.jl:96                                                                                                                                                                    
┌ Warning: MPI thread level requested = MPI.ThreadLevel(2), provided = MPI.ThreadLevel(0)                                                                                                                         
└ @ MPI ~/.julia/dev/MPI/src/environment.jl:96                                                                                                                                                                    

The solution should be as easy as setting the default value of threadlevel in tests/common.jl and always initialise with MPI.Init(; threadlevel) in all tests, the only question is how to let the user choose the threadlevel for the tests. Another environment variable?

Alternatively, have a smarter threadlevel default value, but can we query whether the MPI library supports threading before Init?

@simonbyrne
Copy link
Member

I think as part of #627 we should have an environment variable that allows you to set the default threadlevel (JULIA_MPI_THREADLEVEL?)

@sloede
Copy link
Member

sloede commented Dec 12, 2022

Alternatively, have a smarter threadlevel default value, but can we query whether the MPI library supports threading before Init?

As far as I know, no. MPI_Query_thread only returns the provided threadlevel after initialization, thus it does not help here. Further, threading support is both implementation- and system-dependent, thus it is not possible to store it as a constant either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants