@@ -285,11 +285,10 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
285
285
286
286
if (error_called == 1 )
287
287
{
288
- /* communicator_shrink(&lock_comm); */
289
288
communicator_shrink (& CAF_COMM_WORLD );
290
289
error_called = 0 ;
291
290
}
292
-
291
+
293
292
locking_atomic_op (win , & value , newval , compare , image_index , index );
294
293
295
294
if (value == caf_this_image && image_index == caf_this_image )
@@ -316,7 +315,6 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
316
315
317
316
if (error_called == 1 )
318
317
{
319
- /* communicator_shrink(&lock_comm); */
320
318
communicator_shrink (& CAF_COMM_WORLD );
321
319
error_called = 0 ;
322
320
}
@@ -648,7 +646,6 @@ void *
648
646
649
647
if (error_called == 1 )
650
648
{
651
- /* communicator_shrink(&lock_comm); */
652
649
communicator_shrink (& CAF_COMM_WORLD );
653
650
error_called = 0 ;
654
651
}
@@ -814,16 +811,9 @@ PREFIX (sync_all) (int *stat, char *errmsg, int errmsg_len)
814
811
{
815
812
int ierr = 0 ;
816
813
817
- if (error_called == 1 )
818
- {
819
- /* communicator_shrink(&lock_comm); */
820
- communicator_shrink (& CAF_COMM_WORLD );
821
- error_called = 0 ;
822
- }
823
-
824
814
if (unlikely (caf_is_finalized ))
825
815
ierr = STAT_STOPPED_IMAGE ;
826
- else
816
+ else if ( ierr != STAT_FAILED_IMAGE )
827
817
{
828
818
#if defined(NONBLOCKING_PUT ) && !defined(CAF_MPI_LOCK_UNLOCK )
829
819
explicit_flush ();
@@ -832,10 +822,19 @@ PREFIX (sync_all) (int *stat, char *errmsg, int errmsg_len)
832
822
ierr = 0 ;
833
823
}
834
824
825
+ if (error_called == 1 )
826
+ {
827
+ communicator_shrink (& CAF_COMM_WORLD );
828
+ error_called = 0 ;
829
+ ierr = STAT_FAILED_IMAGE ;
830
+ }
831
+
835
832
if (stat )
836
833
* stat = ierr ;
837
-
838
- if (ierr )
834
+ else if (ierr == STAT_FAILED_IMAGE )
835
+ error_stop (ierr );
836
+
837
+ if (ierr != STAT_FAILED_IMAGE )
839
838
{
840
839
char * msg ;
841
840
if (caf_is_finalized )
0 commit comments