-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds `MPI.Init_thread` and the `ThreadLevel` enum, along with a threaded test. Additionally, set the UCX_ERROR_SIGNALS environment variable if not already set to fix #337.
- Loading branch information
1 parent
ac4ed7a
commit 3aa9a11
Showing
9 changed files
with
136 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ mpiexec | |
```@docs | ||
MPI.Abort | ||
MPI.Init | ||
MPI.Init_thread | ||
MPI.Initialized | ||
MPI.Finalize | ||
MPI.Finalized | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Test, Pkg | ||
using MPI | ||
|
||
if get(ENV,"JULIA_MPI_TEST_ARRAYTYPE","") == "CuArray" | ||
using CuArrays | ||
ArrayType = CuArray | ||
else | ||
ArrayType = Array | ||
end | ||
|
||
provided = MPI.Init_thread(MPI.THREAD_MULTIPLE) | ||
|
||
comm = MPI.COMM_WORLD | ||
size = MPI.Comm_size(comm) | ||
rank = MPI.Comm_rank(comm) | ||
|
||
const N = 10 | ||
|
||
dst = mod(rank+1, size) | ||
src = mod(rank-1, size) | ||
|
||
if provided == MPI.THREAD_MULTIPLE | ||
send_arr = collect(1.0:N) | ||
recv_arr = zeros(N) | ||
|
||
reqs = Array{MPI.Request}(undef, 2N) | ||
|
||
Threads.@threads for i = 1:N | ||
reqs[N+i] = MPI.Irecv!(@view(recv_arr[i:i]), src, i, comm) | ||
reqs[i] = MPI.Isend(@view(send_arr[i:i]), dst, i, comm) | ||
end | ||
|
||
MPI.Waitall!(reqs) | ||
|
||
@test recv_arr == send_arr | ||
end | ||
|
||
MPI.Finalize() |