You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/operators.jl
+54-5
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,23 @@ An MPI reduction operator, for use with [Reduce/Scan collective operations](@ref
10
10
Wrap the Julia reduction function `op` for arguments of type `T`. `op` is assumed to be
11
11
associative, and if `iscommutative` is true, assumed to be commutative as well.
12
12
13
+
Certain combinations of `op` and `T` will use the predefined MPI intrinsic operations,
14
+
otherwise it will wrap the function in a Julia closure at runtime. The macro [`@Op`](@ref)
15
+
can be used to wrap functions ahead of time, which may reduce runtime overhead, and is
16
+
required on platforms where closures are not supported (such as ARM and PPC).
17
+
18
+
User usage of this function is generally unnecessary since it will be called directly
19
+
by the relevant MPI collective operations.
20
+
13
21
## See also
14
22
15
23
- [`Reduce!`](@ref)/[`Reduce`](@ref)
16
24
- [`Allreduce!`](@ref)/[`Allreduce`](@ref)
17
25
- [`Scan!`](@ref)/[`Scan`](@ref)
18
26
- [`Exscan!`](@ref)/[`Exscan`](@ref)
27
+
19
28
"""
20
-
@mpi_handle Op MPI_Op fptr
29
+
@mpi_handle Op MPI_Op cfunc::Union{Base.CFunction, Nothing}
21
30
22
31
const OP_NULL =_Op(MPI_OP_NULL, nothing)
23
32
const BAND =_Op(MPI_BAND, nothing)
@@ -74,16 +83,56 @@ function Op(f, T=Any; iscommutative=false)
74
83
error("User-defined reduction operators are not supported on 32-bit Windows.\nSee https://github.com/JuliaParallel/MPI.jl/issues/246 for more details.")
0 commit comments