File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,20 @@ int mca_pml_ucx_close(void)
283
283
return OMPI_SUCCESS ;
284
284
}
285
285
286
+ static ucs_thread_mode_t mca_pml_ucx_thread_mode (int ompi_mode )
287
+ {
288
+ switch (ompi_mode ) {
289
+ case MPI_THREAD_MULTIPLE :
290
+ return UCS_THREAD_MODE_MULTI ;
291
+ case MPI_THREAD_SERIALIZED :
292
+ return UCS_THREAD_MODE_SERIALIZED ;
293
+ case MPI_THREAD_FUNNELED :
294
+ case MPI_THREAD_SINGLE :
295
+ default :
296
+ return UCS_THREAD_MODE_SINGLE ;
297
+ }
298
+ }
299
+
286
300
int mca_pml_ucx_init (int enable_mpi_threads )
287
301
{
288
302
ucp_worker_params_t params ;
@@ -292,12 +306,11 @@ int mca_pml_ucx_init(int enable_mpi_threads)
292
306
293
307
PML_UCX_VERBOSE (1 , "mca_pml_ucx_init" );
294
308
295
- /* TODO check MPI thread mode */
296
309
params .field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE ;
297
310
if (enable_mpi_threads ) {
298
311
params .thread_mode = UCS_THREAD_MODE_MULTI ;
299
312
} else {
300
- params .thread_mode = UCS_THREAD_MODE_SINGLE ;
313
+ params .thread_mode = mca_pml_ucx_thread_mode ( ompi_mpi_thread_provided ) ;
301
314
}
302
315
303
316
#if HAVE_DECL_UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK
Original file line number Diff line number Diff line change @@ -322,6 +322,8 @@ static int spml_ucx_init(void)
322
322
wkr_params .field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE ;
323
323
if (oshmem_mpi_thread_requested == SHMEM_THREAD_MULTIPLE ) {
324
324
wkr_params .thread_mode = UCS_THREAD_MODE_MULTI ;
325
+ } else if (oshmem_mpi_thread_requested == SHMEM_THREAD_SERIALIZED ) {
326
+ wkr_params .thread_mode = UCS_THREAD_MODE_SERIALIZED ;
325
327
} else {
326
328
wkr_params .thread_mode = UCS_THREAD_MODE_SINGLE ;
327
329
}
You can’t perform that action at this time.
0 commit comments