-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMPIUtil.jl
27 lines (22 loc) · 889 Bytes
/
MPIUtil.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Contains MPI related things that the library is missing
import MPI
#TODO document
# The RSend constant isn't defined on windows
const MPI_RSEND = if Sys.iswindows()
(:MPI_RSEND, MPI.libmpi)
else
MPI.MPI_RSEND
end
function MPI_Rsend(buf::MPI.MPIBuffertype{T}, count::Integer,
dest::Integer, tag::Integer, comm::MPI.Comm) where T
ccall(MPI_RSEND, Nothing,
(Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
Ref{Cint}),
buf, count, MPI.mpitype(T), dest, tag, comm.val, 0)
end
function MPI_Rsend(buf::AbstractArray{T}, dest::Integer, tag::Integer, comm::MPI.Comm) where T
MPI_Rsend(buf, length(buf), dest, tag, comm)
end
function MPI_Rsend(obj::T, dest::Integer, tag::Integer, comm::MPI.Comm) where T
MPI_Rsend([obj], dest, tag, comm)
end