Skip to content

Commit c2887c7

Browse files
author
Alessandro Fanfarillo
committed
New stopped_images function
1 parent 8421c8c commit c2887c7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/mpi/mpi_caf.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int error_called = 0, fake_error_called = 0;
114114
int *ranks_gc,*ranks_gf, *failed_images_array; //to be returned by failed images
115115
MPI_Errhandler errh,errh_w,errh_fake;
116116
int completed = 0,tmp_lock;
117-
int *stopped_images;
117+
int *stopped_images, n_stopped_imgs;
118118

119119
static int cmpfunc (const void *a, const void *b)
120120
{
@@ -2860,3 +2860,18 @@ PREFIX (failed_images) (gfc_descriptor_t *array, int team __attribute__ ((unused
28602860
array->dim[0]._stride = 1;
28612861
array->offset = -1;
28622862
}
2863+
2864+
void
2865+
PREFIX (stopped_images) (gfc_descriptor_t *array, int team __attribute__ ((unused)),
2866+
int kind __attribute__ ((unused)))
2867+
{
2868+
int *mem = (int *)calloc(n_stopped_imgs,sizeof(int));
2869+
array->base_addr = mem;
2870+
memcpy(mem,stopped_images,n_stopped_imgs*sizeof(int));
2871+
qsort(mem,n_stopped_imgs,sizeof(int),cmpfunc);
2872+
array->dtype = 265;
2873+
array->dim[0].lower_bound = 1;
2874+
array->dim[0]._ubound = n_stopped_imgs-1;
2875+
array->dim[0]._stride = 1;
2876+
array->offset = -1;
2877+
}

0 commit comments

Comments
 (0)