Skip to content

Commit c4841e8

Browse files
author
Alessandro Fanfarillo
committed
Managing stat for sync all
1 parent aa4a61a commit c4841e8

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/mpi/mpi_caf.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,10 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
285285

286286
if(error_called == 1)
287287
{
288-
/* communicator_shrink(&lock_comm); */
289288
communicator_shrink(&CAF_COMM_WORLD);
290289
error_called = 0;
291290
}
292-
291+
293292
locking_atomic_op(win, &value, newval, compare, image_index, index);
294293

295294
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,
316315

317316
if(error_called == 1)
318317
{
319-
/* communicator_shrink(&lock_comm); */
320318
communicator_shrink(&CAF_COMM_WORLD);
321319
error_called = 0;
322320
}
@@ -648,7 +646,6 @@ void *
648646

649647
if(error_called == 1)
650648
{
651-
/* communicator_shrink(&lock_comm); */
652649
communicator_shrink(&CAF_COMM_WORLD);
653650
error_called = 0;
654651
}
@@ -814,16 +811,9 @@ PREFIX (sync_all) (int *stat, char *errmsg, int errmsg_len)
814811
{
815812
int ierr=0;
816813

817-
if(error_called == 1)
818-
{
819-
/* communicator_shrink(&lock_comm); */
820-
communicator_shrink(&CAF_COMM_WORLD);
821-
error_called = 0;
822-
}
823-
824814
if (unlikely (caf_is_finalized))
825815
ierr = STAT_STOPPED_IMAGE;
826-
else
816+
else if(ierr != STAT_FAILED_IMAGE)
827817
{
828818
#if defined(NONBLOCKING_PUT) && !defined(CAF_MPI_LOCK_UNLOCK)
829819
explicit_flush();
@@ -832,10 +822,19 @@ PREFIX (sync_all) (int *stat, char *errmsg, int errmsg_len)
832822
ierr = 0;
833823
}
834824

825+
if(error_called == 1)
826+
{
827+
communicator_shrink(&CAF_COMM_WORLD);
828+
error_called = 0;
829+
ierr = STAT_FAILED_IMAGE;
830+
}
831+
835832
if (stat)
836833
*stat = ierr;
837-
838-
if (ierr)
834+
else if(ierr == STAT_FAILED_IMAGE)
835+
error_stop (ierr);
836+
837+
if (ierr != STAT_FAILED_IMAGE)
839838
{
840839
char *msg;
841840
if (caf_is_finalized)

0 commit comments

Comments
 (0)