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 05c7f88 commit abbb997Copy full SHA for abbb997
1 file changed
src/api/api.jl
@@ -117,6 +117,11 @@ function Base.show(io::IO, err::FeatureLevelError)
117
print(io, "FeatureLevelError($(err.function_name)): Minimum MPI version is $(err.min_version)")
118
end
119
120
+@noinline function mpi_error(err)
121
+ throw(MPIError(err))
122
+end
123
+
124
125
macro mpichk(expr, min_version=nothing)
126
if !isnothing(min_version) && expr.args[2].head == :tuple
127
fn = expr.args[2].args[1].value
@@ -129,7 +134,13 @@ macro mpichk(expr, min_version=nothing)
129
134
130
135
expr = macroexpand(@__MODULE__, :(@mpicall($expr)))
131
136
# MPI_SUCCESS is defined to be 0
132
- :((errcode = $(esc(expr))) == 0 || throw(MPIError(errcode)))
137
+ quote
138
+ errcode = $(esc(expr))
139
+ if errcode != 0
140
+ $mpi_error(errcode)
141
+ end
142
+ nothing
143
133
144
145
146
0 commit comments