We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c4b978 commit d2d694eCopy full SHA for d2d694e
1 file changed
src/api/api.jl
@@ -122,6 +122,11 @@ function Base.show(io::IO, err::FeatureLevelError)
122
print(io, "FeatureLevelError($(err.function_name)): Minimum MPI version is $(err.min_version)")
123
end
124
125
+@noinline function mpi_error(err)
126
+ throw(MPIError(err))
127
+end
128
+
129
130
macro mpichk(expr, min_version=nothing)
131
if !isnothing(min_version) && expr.args[2].head == :tuple
132
fn = expr.args[2].args[1].value
@@ -134,7 +139,13 @@ macro mpichk(expr, min_version=nothing)
134
139
135
140
expr = macroexpand(@__MODULE__, :(@mpicall($expr)))
136
141
# MPI_SUCCESS is defined to be 0
137
- :((errcode = $(esc(expr))) == 0 || throw(MPIError(errcode)))
142
+ quote
143
+ errcode = $(esc(expr))
144
+ if errcode != 0
145
+ $mpi_error(errcode)
146
+ end
147
+ nothing
148
138
149
150
151
0 commit comments