@@ -385,6 +385,8 @@ int ompi_osc_rdma_start_atomic (ompi_group_t *group, int mpi_assert, ompi_win_t
385
385
386
386
OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "start group size %d" , sync -> num_peers );
387
387
388
+ sync -> type = OMPI_OSC_RDMA_SYNC_TYPE_PSCW ;
389
+
388
390
if (0 == ompi_group_size (group )) {
389
391
/* nothing more to do. this is an empty start epoch */
390
392
OPAL_THREAD_UNLOCK (& module -> lock );
@@ -393,8 +395,6 @@ int ompi_osc_rdma_start_atomic (ompi_group_t *group, int mpi_assert, ompi_win_t
393
395
394
396
opal_atomic_wmb ();
395
397
396
- sync -> type = OMPI_OSC_RDMA_SYNC_TYPE_PSCW ;
397
-
398
398
/* prevent us from entering a passive-target, fence, or another pscw access epoch until
399
399
* the matching complete is called */
400
400
sync -> epoch_active = true;
@@ -466,17 +466,21 @@ int ompi_osc_rdma_complete_atomic (ompi_win_t *win)
466
466
sync -> type = OMPI_OSC_RDMA_SYNC_TYPE_NONE ;
467
467
sync -> epoch_active = false;
468
468
469
- /* phase 2 cleanup group */
470
- OBJ_RELEASE (group );
471
-
472
469
peers = sync -> peer_list .peers ;
473
470
if (NULL == peers ) {
474
471
/* empty peer list */
472
+ if (MPI_GROUP_EMPTY != group ) {
473
+ OBJ_RELEASE (group );
474
+ }
475
475
OPAL_THREAD_UNLOCK (& (module -> lock ));
476
- OBJ_RELEASE (group );
477
476
return OMPI_SUCCESS ;
478
477
}
479
478
479
+ /* phase 2 cleanup group */
480
+ if (MPI_GROUP_EMPTY != group ) {
481
+ OBJ_RELEASE (group );
482
+ }
483
+
480
484
sync -> peer_list .peers = NULL ;
481
485
482
486
OPAL_THREAD_UNLOCK (& (module -> lock ));
@@ -508,7 +512,6 @@ int ompi_osc_rdma_wait_atomic (ompi_win_t *win)
508
512
{
509
513
ompi_osc_rdma_module_t * module = GET_MODULE (win );
510
514
ompi_osc_rdma_state_t * state = module -> state ;
511
- ompi_group_t * group ;
512
515
int group_size ;
513
516
514
517
OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "wait: %s" , win -> w_name );
@@ -532,12 +535,12 @@ int ompi_osc_rdma_wait_atomic (ompi_win_t *win)
532
535
}
533
536
534
537
OPAL_THREAD_LOCK (& module -> lock );
535
- group = module -> pw_group ;
538
+ if (MPI_GROUP_EMPTY != module -> pw_group ) {
539
+ OBJ_RELEASE (module -> pw_group );
540
+ }
536
541
module -> pw_group = NULL ;
537
542
OPAL_THREAD_UNLOCK (& module -> lock );
538
543
539
- OBJ_RELEASE (group );
540
-
541
544
OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "wait complete" );
542
545
543
546
return OMPI_SUCCESS ;
0 commit comments