@@ -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
}
@@ -7405,12 +7406,21 @@ terminate_internal (int stat_code, int exit_code)
7405
7406
}
7406
7407
7407
7408
7409
+ #ifdef GCC_GE_8
7410
+ #undef QUIETARG
7411
+ #define QUIETARG , bool quiet
7412
+ #endif
7413
+
7408
7414
/* STOP function for integer arguments. */
7409
7415
7410
7416
void
7411
- PREFIX (stop_numeric ) (int stop_code )
7417
+ PREFIX (stop_numeric ) (int stop_code QUIETARG )
7412
7418
{
7413
- fprintf (stderr , "STOP %d\n" , stop_code );
7419
+ #ifndef GCC_GE_8
7420
+ bool quiet = false;
7421
+ #endif
7422
+ if (!quiet )
7423
+ fprintf (stderr , "STOP %d\n" , stop_code );
7414
7424
7415
7425
/* Stopping includes taking down the runtime regularly and returning the
7416
7426
* stop_code. */
@@ -7421,38 +7431,59 @@ PREFIX (stop_numeric) (int stop_code)
7421
7431
/* STOP function for string arguments. */
7422
7432
7423
7433
void
7424
- PREFIX (stop_str ) (const char * string , charlen_t len )
7434
+ PREFIX (stop_str ) (const char * string , charlen_t len QUIETARG )
7425
7435
{
7426
- fputs ("STOP " , stderr );
7427
- while (len -- )
7428
- fputc (* (string ++ ), stderr );
7429
- fputs ("\n" , stderr );
7430
-
7436
+ #ifndef GCC_GE_8
7437
+ bool quiet = false;
7438
+ #endif
7439
+ if (!quiet )
7440
+ {
7441
+ fputs ("STOP " , stderr );
7442
+ while (len -- )
7443
+ fputc (* (string ++ ), stderr );
7444
+ fputs ("\n" , stderr );
7445
+ }
7431
7446
/* Stopping includes taking down the runtime regularly. */
7432
7447
terminate_internal (STAT_STOPPED_IMAGE , 0 );
7433
7448
}
7434
7449
7435
7450
7436
7451
/* ERROR STOP function for string arguments. */
7437
7452
7438
- void
7439
- PREFIX ( error_stop_str ) (const char * string , charlen_t len )
7453
+ static void
7454
+ error_stop_str (const char * string , size_t len , bool quiet )
7440
7455
{
7441
- fputs ("ERROR STOP " , stderr );
7442
- while (len -- )
7443
- fputc (* (string ++ ), stderr );
7444
- fputs ("\n" , stderr );
7445
-
7456
+ if (!quiet )
7457
+ {
7458
+ fputs ("ERROR STOP " , stderr );
7459
+ while (len -- )
7460
+ fputc (* (string ++ ), stderr );
7461
+ fputs ("\n" , stderr );
7462
+ }
7446
7463
terminate_internal (STAT_STOPPED_IMAGE , 1 );
7447
7464
}
7448
7465
7449
7466
7467
+ void
7468
+ PREFIX (error_stop_str ) (const char * string , charlen_t len QUIETARG )
7469
+ {
7470
+ #ifndef GCC_GE_8
7471
+ bool quiet = false;
7472
+ #endif
7473
+ error_stop_str (string , len , quiet );
7474
+ }
7475
+
7476
+
7450
7477
/* ERROR STOP function for numerical arguments. */
7451
7478
7452
7479
void
7453
- PREFIX (error_stop ) (int error )
7480
+ PREFIX (error_stop ) (int error QUIETARG )
7454
7481
{
7455
- fprintf (stderr , "ERROR STOP %d\n" , error );
7482
+ #ifndef GCC_GE_8
7483
+ bool quiet = false;
7484
+ #endif
7485
+ if (!quiet )
7486
+ fprintf (stderr , "ERROR STOP %d\n" , error );
7456
7487
7457
7488
terminate_internal (STAT_STOPPED_IMAGE , error );
7458
7489
}
0 commit comments