@@ -158,8 +158,7 @@ ompi_mtl_ofi_context_progress(int ctxt_id)
158
158
"%s:%d: Error returned by request (type: %d) event callback: %zd.\n"
159
159
"*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n" ,
160
160
__FILE__ , __LINE__ , req_type , ret );
161
- fflush (stderr );
162
- exit (1 );
161
+ goto bail ;
163
162
}
164
163
}
165
164
}
@@ -181,16 +180,23 @@ ompi_mtl_ofi_context_progress(int ctxt_id)
181
180
* thread fetches the entry while others get -FI_EAGAIN
182
181
* indicating an empty queue, which is not erroneous.
183
182
*/
184
- if (ret == - FI_EAGAIN )
183
+ if (ret == - FI_EAGAIN ) {
185
184
return count ;
185
+ }
186
186
opal_output (0 , "%s:%d: Error returned from fi_cq_readerr: %s(%zd).\n"
187
187
"*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n" ,
188
188
__FILE__ , __LINE__ , fi_strerror (- ret ), ret );
189
- fflush (stderr );
190
- exit (1 );
189
+ goto bail ;
190
+ }
191
+
192
+ if (!error .op_context ) {
193
+ opal_output (0 , "%s:%d: Error returned from fi_cq_readerr with null context. "
194
+ "Completion flags: %016lx\n"
195
+ "*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n" ,
196
+ __FILE__ , __LINE__ , error .flags );
197
+ goto bail ;
191
198
}
192
199
193
- assert (error .op_context );
194
200
ofi_req = TO_OFI_REQ (error .op_context );
195
201
assert (ofi_req );
196
202
req_type = ofi_req -> type ;
@@ -200,18 +206,20 @@ ompi_mtl_ofi_context_progress(int ctxt_id)
200
206
"%s:%d: Error returned by request (type: %d) error callback: %zd.\n"
201
207
"*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n" ,
202
208
__FILE__ , __LINE__ , req_type , ret );
203
- fflush (stderr );
204
- exit (1 );
209
+ goto bail ;
205
210
}
206
211
} else if (ret != - FI_EAGAIN && ret != - EINTR ) {
207
212
opal_output (0 , "%s:%d: Error returned from fi_cq_read: %s(%zd).\n"
208
213
"*** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n" ,
209
214
__FILE__ , __LINE__ , fi_strerror (- ret ), ret );
210
- fflush (stderr );
211
- exit (1 );
215
+ goto bail ;
212
216
}
213
217
214
218
return count ;
219
+
220
+ bail :
221
+ fflush (stderr );
222
+ exit (1 );
215
223
}
216
224
217
225
__opal_attribute_always_inline__ static inline int
0 commit comments