Skip to content

Commit 32e4cb4

Browse files
author
Alessandro Fanfarillo
committed
Adding stat constraint to event post and event wait
1 parent f7de5fd commit 32e4cb4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/mpi/mpi_caf.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,19 @@ PREFIX (event_post) (caf_token_t token, size_t index,
25552555
#warning Events for MPI-2 are not implemented
25562556
printf ("Events for MPI-2 are not supported, please update your MPI implementation\n");
25572557
#endif // MPI_VERSION
2558+
2559+
MPI_Test(&lock_req,&flag,MPI_STATUS_IGNORE);
2560+
2561+
if(error_called == 1)
2562+
{
2563+
communicator_shrink(&CAF_COMM_WORLD);
2564+
error_called = 0;
2565+
ierr = STAT_FAILED_IMAGE;
2566+
}
2567+
2568+
if(!stat && ierr == STAT_FAILED_IMAGE)
2569+
error_stop (ierr);
2570+
25582571
if(ierr != MPI_SUCCESS)
25592572
{
25602573
if(stat != NULL)
@@ -2615,6 +2628,19 @@ PREFIX (event_wait) (caf_token_t token, size_t index,
26152628
# else // CAF_MPI_LOCK_UNLOCK
26162629
MPI_Win_flush (image, *p);
26172630
# endif // CAF_MPI_LOCK_UNLOCK
2631+
2632+
MPI_Test(&lock_req,&flag,MPI_STATUS_IGNORE);
2633+
2634+
if(error_called == 1)
2635+
{
2636+
communicator_shrink(&CAF_COMM_WORLD);
2637+
error_called = 0;
2638+
ierr = STAT_FAILED_IMAGE;
2639+
}
2640+
2641+
if(!stat && ierr == STAT_FAILED_IMAGE)
2642+
error_stop (ierr);
2643+
26182644
if(ierr != MPI_SUCCESS)
26192645
{
26202646
if(stat != NULL)

0 commit comments

Comments
 (0)