Skip to content

Commit 5ae617c

Browse files
author
Alessandro Fanfarillo
committed
Adapting prototypes to the new stat= attribute
1 parent ae6ed63 commit 5ae617c

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

src/libcaf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ void *PREFIX (register) (size_t, caf_register_t, caf_token_t *, int *, char *,
122122
void PREFIX (deregister) (caf_token_t *, int *, char *, int);
123123

124124
void PREFIX (caf_get) (caf_token_t, size_t, int, gfc_descriptor_t *,
125-
caf_vector_t *, gfc_descriptor_t *, int, int);
125+
caf_vector_t *, gfc_descriptor_t *, int, int *, int);
126126
void PREFIX (caf_send) (caf_token_t, size_t, int, gfc_descriptor_t *,
127-
caf_vector_t *, gfc_descriptor_t *, int, int);
127+
caf_vector_t *, gfc_descriptor_t *, int, int *, int);
128128

129129
void PREFIX (caf_sendget) (caf_token_t, size_t, int, gfc_descriptor_t *,
130130
caf_vector_t *, caf_token_t, size_t, int,

src/mpi/mpi_caf.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ PREFIX (send) (caf_token_t token, size_t offset, int image_index,
11231123
/* FIXME: Implement vector subscripts, type conversion and check whether
11241124
string-kind conversions are permitted.
11251125
FIXME: Implement sendget as well. */
1126-
int ierr = 0;
1126+
int ierr = 0, flag = 0;
11271127
size_t i, size;
11281128
int j;
11291129
/* int position, msg = 0; */
@@ -1214,8 +1214,21 @@ PREFIX (send) (caf_token_t token, size_t offset, int image_index,
12141214
#endif // CAF_MPI_LOCK_UNLOCK
12151215
}
12161216

1217-
if (ierr != 0)
1218-
error_stop (ierr);
1217+
MPI_Test(&lock_req,&flag,MPI_STATUS_IGNORE);
1218+
1219+
if(error_called == 1)
1220+
{
1221+
communicator_shrink(&CAF_COMM_WORLD);
1222+
error_called = 0;
1223+
ierr = STAT_FAILED_IMAGE;
1224+
}
1225+
1226+
if(!stat && ierr == STAT_FAILED_IMAGE)
1227+
error_stop (ierr);
1228+
1229+
if(stat)
1230+
*stat = ierr;
1231+
12191232
return;
12201233
}
12211234
else
@@ -1582,6 +1595,9 @@ PREFIX (get) (caf_token_t token, size_t offset,
15821595

15831596
if(!stat && ierr == STAT_FAILED_IMAGE)
15841597
error_stop (ierr);
1598+
1599+
if(stat)
1600+
*stat = ierr;
15851601
}
15861602
return;
15871603
}
@@ -1678,14 +1694,10 @@ PREFIX (get) (caf_token_t token, size_t offset,
16781694
communicator_shrink(&CAF_COMM_WORLD);
16791695
error_called = 0;
16801696
ierr = STAT_FAILED_IMAGE;
1681-
printf("In error_called\n");
16821697
}
16831698

16841699
if(!stat && ierr == STAT_FAILED_IMAGE)
1685-
{
1686-
printf("error\n");
1687-
error_stop (ierr);
1688-
}
1700+
error_stop (ierr);
16891701

16901702
# ifdef CAF_MPI_LOCK_UNLOCK
16911703
MPI_Win_lock (MPI_LOCK_SHARED, image_index-1, 0, *p);

0 commit comments

Comments
 (0)