10
10
* University of Stuttgart. All rights reserved.
11
11
* Copyright (c) 2004-2005 The Regents of the University of California.
12
12
* All rights reserved.
13
- * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
13
+ * Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights
14
14
* reserved.
15
15
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
16
16
* Copyright (c) 2015 Research Organization for Information Science
@@ -230,16 +230,17 @@ int mca_pml_ob1_send(const void *buf,
230
230
}
231
231
}
232
232
233
- #if !OMPI_ENABLE_THREAD_MULTIPLE
234
- sendreq = mca_pml_ob1_sendreq ;
235
- mca_pml_ob1_sendreq = NULL ;
236
- if ( OPAL_UNLIKELY (NULL == sendreq ) )
237
- #endif /* !OMPI_ENABLE_THREAD_MULTIPLE */
238
- {
239
- MCA_PML_OB1_SEND_REQUEST_ALLOC (comm , dst , sendreq );
240
- if (NULL == sendreq )
241
- return OMPI_ERR_TEMP_OUT_OF_RESOURCE ;
242
- }
233
+ if (OPAL_LIKELY (!ompi_mpi_thread_multiple )) {
234
+ sendreq = mca_pml_ob1_sendreq ;
235
+ mca_pml_ob1_sendreq = NULL ;
236
+ }
237
+
238
+ if ( OPAL_UNLIKELY (NULL == sendreq ) ) {
239
+ MCA_PML_OB1_SEND_REQUEST_ALLOC (comm , dst , sendreq );
240
+ if (NULL == sendreq )
241
+ return OMPI_ERR_TEMP_OUT_OF_RESOURCE ;
242
+ }
243
+
243
244
sendreq -> req_send .req_base .req_proc = dst_proc ;
244
245
sendreq -> rdma_frag = NULL ;
245
246
@@ -261,16 +262,12 @@ int mca_pml_ob1_send(const void *buf,
261
262
rc = sendreq -> req_send .req_base .req_ompi .req_status .MPI_ERROR ;
262
263
}
263
264
264
- #if OMPI_ENABLE_THREAD_MULTIPLE
265
- MCA_PML_OB1_SEND_REQUEST_RETURN (sendreq );
266
- #else
267
- if ( NULL != mca_pml_ob1_sendreq ) {
265
+ if (OPAL_UNLIKELY (ompi_mpi_thread_multiple || NULL != mca_pml_ob1_sendreq )) {
268
266
MCA_PML_OB1_SEND_REQUEST_RETURN (sendreq );
269
267
} else {
270
268
mca_pml_ob1_send_request_fini (sendreq );
271
269
mca_pml_ob1_sendreq = sendreq ;
272
270
}
273
- #endif
274
271
275
272
return rc ;
276
273
}
0 commit comments