@@ -114,6 +114,11 @@ int *ranks_gc,*ranks_gf; //to be returned by failed images
114
114
MPI_Errhandler errh ,errh_w ;
115
115
int completed = 0 ,tmp_lock ;
116
116
117
+ static int cmpfunc (const void * a , const void * b )
118
+ {
119
+ return ( * (int * )a - * (int * )b );
120
+ }
121
+
117
122
static void verbose_win_errhandler (MPI_Win * win , int * err , ...) {
118
123
/* printf("in win err handler\n"); */
119
124
/* used_comm++; */
@@ -278,13 +283,6 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
278
283
279
284
MPI_Test (& lock_req ,& flag ,MPI_STATUS_IGNORE );
280
285
281
- /* if(error_called == 1) */
282
- /* { */
283
- /* /\* MPIX_Comm_agree( CAF_COMM_WORLD, &completed ); *\/ */
284
- /* communicator_shrink(&CAF_COMM_WORLD); */
285
- /* error_called = 0; */
286
- /* } */
287
-
288
286
if (error_called == 1 )
289
287
{
290
288
/* communicator_shrink(&lock_comm); */
@@ -318,7 +316,7 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
318
316
319
317
if (error_called == 1 )
320
318
{
321
- // communicator_shrink(&lock_comm);
319
+ /* communicator_shrink(&lock_comm); */
322
320
communicator_shrink (& CAF_COMM_WORLD );
323
321
error_called = 0 ;
324
322
}
@@ -2728,6 +2726,7 @@ PREFIX (failed_images) (gfc_descriptor_t *array, int team __attribute__ ((unused
2728
2726
int * mem = (int * )calloc (n_failed_imgs ,sizeof (int ));
2729
2727
array -> base_addr = mem ;
2730
2728
memcpy (mem ,ranks_gc ,n_failed_imgs * sizeof (int ));
2729
+ qsort (mem ,n_failed_imgs ,sizeof (int ),cmpfunc );
2731
2730
array -> dtype = 265 ;
2732
2731
array -> dim [0 ].lower_bound = 1 ;
2733
2732
array -> dim [0 ]._ubound = n_failed_imgs ;
0 commit comments