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

Add tests for serialized isend/irecv #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions test/test_sendrecv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,18 @@ rreq = nothing
sreq = nothing
gc()

root = 0
g = x -> x^2 + 2x - 1
if MPI.Comm_rank(comm) == root + 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this test is run on a single process, then rank+1 is an invalid process. A better way is to use the dst and src variables defined earlier.

Also, since src and dst can be equal, you need to use if instead of `elseif.

done, f, stat = MPI.irecv( root, root+32, comm )
if done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code calls irecv once. If there is no message at this time, then it will never be received. You should probably call irecv in a loop until done is true.

@test f(3) == g(3)
@test f(5) == g(5)
@test f(7) == g(7)
end
elseif MPI.Comm_rank(comm) == root
f = g
sreq = MPI.isend(f, dst, rank+32, comm)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isend returns a request. You either need to wait for that request to complete, or use send instead of `isend.

end

MPI.Finalize()