@@ -148,6 +148,7 @@ static void terminate_internal (int stat_code, int exit_code)
148
148
__attribute__ ((noreturn ));
149
149
static void sync_images_internal (int count , int images [], int * stat ,
150
150
char * errmsg , size_t errmsg_len , bool internal );
151
+ static void error_stop_str (const char * string , size_t len , bool quiet ) __attribute__((noreturn ));
151
152
152
153
/* Global variables. */
153
154
static int caf_this_image ;
@@ -2699,7 +2700,7 @@ PREFIX (sendget) (caf_token_t token_s, size_t offset_s, int image_index_s,
2699
2700
char error_str [error_len ];
2700
2701
strcpy (error_str , "MPI-error: " );
2701
2702
MPI_Error_string (mpi_error , & error_str [11 ], & error_len );
2702
- PREFIX ( error_stop_str ) (error_str , error_len + 11 );
2703
+ error_stop_str (error_str , error_len + 11 , false );
2703
2704
}
2704
2705
}
2705
2706
}
@@ -3269,7 +3270,7 @@ PREFIX (send) (caf_token_t token, size_t offset, int image_index,
3269
3270
char error_str [error_len ];
3270
3271
strcpy (error_str , "MPI-error: " );
3271
3272
MPI_Error_string (mpi_error , & error_str [11 ], & error_len );
3272
- PREFIX ( error_stop_str ) (error_str , error_len + 11 );
3273
+ error_stop_str (error_str , error_len + 11 , false );
3273
3274
}
3274
3275
}
3275
3276
}
@@ -3779,7 +3780,7 @@ PREFIX (get) (caf_token_t token, size_t offset, int image_index,
3779
3780
char error_str [error_len + 11 ];
3780
3781
strcpy (error_str , "MPI-error: " );
3781
3782
MPI_Error_string (mpi_error , & error_str [11 ], & error_len );
3782
- PREFIX ( error_stop_str ) (error_str , error_len + 11 );
3783
+ error_stop_str (error_str , error_len + 11 , false );
3783
3784
}
3784
3785
}
3785
3786
}
@@ -7411,12 +7412,21 @@ terminate_internal (int stat_code, int exit_code)
7411
7412
}
7412
7413
7413
7414
7415
+ #ifdef GCC_GE_8
7416
+ #undef QUIETARG
7417
+ #define QUIETARG , bool quiet
7418
+ #endif
7419
+
7414
7420
/* STOP function for integer arguments. */
7415
7421
7416
7422
void
7417
- PREFIX (stop_numeric ) (int stop_code )
7423
+ PREFIX (stop_numeric ) (int stop_code QUIETARG )
7418
7424
{
7419
- fprintf (stderr , "STOP %d\n" , stop_code );
7425
+ #ifndef GCC_GE_8
7426
+ bool quiet = false;
7427
+ #endif
7428
+ if (!quiet )
7429
+ fprintf (stderr , "STOP %d\n" , stop_code );
7420
7430
7421
7431
/* Stopping includes taking down the runtime regularly and returning the
7422
7432
* stop_code. */
@@ -7427,38 +7437,59 @@ PREFIX (stop_numeric) (int stop_code)
7427
7437
/* STOP function for string arguments. */
7428
7438
7429
7439
void
7430
- PREFIX (stop_str ) (const char * string , charlen_t len )
7440
+ PREFIX (stop_str ) (const char * string , charlen_t len QUIETARG )
7431
7441
{
7432
- fputs ("STOP " , stderr );
7433
- while (len -- )
7434
- fputc (* (string ++ ), stderr );
7435
- fputs ("\n" , stderr );
7436
-
7442
+ #ifndef GCC_GE_8
7443
+ bool quiet = false;
7444
+ #endif
7445
+ if (!quiet )
7446
+ {
7447
+ fputs ("STOP " , stderr );
7448
+ while (len -- )
7449
+ fputc (* (string ++ ), stderr );
7450
+ fputs ("\n" , stderr );
7451
+ }
7437
7452
/* Stopping includes taking down the runtime regularly. */
7438
7453
terminate_internal (STAT_STOPPED_IMAGE , 0 );
7439
7454
}
7440
7455
7441
7456
7442
7457
/* ERROR STOP function for string arguments. */
7443
7458
7444
- void
7445
- PREFIX ( error_stop_str ) (const char * string , charlen_t len )
7459
+ static void
7460
+ error_stop_str (const char * string , size_t len , bool quiet )
7446
7461
{
7447
- fputs ("ERROR STOP " , stderr );
7448
- while (len -- )
7449
- fputc (* (string ++ ), stderr );
7450
- fputs ("\n" , stderr );
7451
-
7462
+ if (!quiet )
7463
+ {
7464
+ fputs ("ERROR STOP " , stderr );
7465
+ while (len -- )
7466
+ fputc (* (string ++ ), stderr );
7467
+ fputs ("\n" , stderr );
7468
+ }
7452
7469
terminate_internal (STAT_STOPPED_IMAGE , 1 );
7453
7470
}
7454
7471
7455
7472
7473
+ void
7474
+ PREFIX (error_stop_str ) (const char * string , charlen_t len QUIETARG )
7475
+ {
7476
+ #ifndef GCC_GE_8
7477
+ bool quiet = false;
7478
+ #endif
7479
+ error_stop_str (string , len , quiet );
7480
+ }
7481
+
7482
+
7456
7483
/* ERROR STOP function for numerical arguments. */
7457
7484
7458
7485
void
7459
- PREFIX (error_stop ) (int error )
7486
+ PREFIX (error_stop ) (int error QUIETARG )
7460
7487
{
7461
- fprintf (stderr , "ERROR STOP %d\n" , error );
7488
+ #ifndef GCC_GE_8
7489
+ bool quiet = false;
7490
+ #endif
7491
+ if (!quiet )
7492
+ fprintf (stderr , "ERROR STOP %d\n" , error );
7462
7493
7463
7494
terminate_internal (STAT_STOPPED_IMAGE , error );
7464
7495
}
0 commit comments