-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
When running with SCR_DEBUG=1, SCR prints log messages to stdout. It would be useful at times to direct those messages to other files like stderr or perhaps a user-provided file descriptor. This would enable users to more easily filter SCR messages from their job logs.
The related code in SCR is in scr_err_mpi.c and scr_err_serial.c, e.g.:
Lines 52 to 63 in 48328f6
| /* print message to stdout if scr_debug is set and it is >= level */ | |
| void scr_dbg(int level, const char *fmt, ...) | |
| { | |
| va_list argp; | |
| if (level == 0 || (scr_debug > 0 && scr_debug >= level)) { | |
| fprintf(stdout, "SCR %s: rank %d on %s: ", SCR_VERSION, scr_my_rank_world, scr_my_hostname); | |
| va_start(argp, fmt); | |
| vfprintf(stdout, fmt, argp); | |
| va_end(argp); | |
| fprintf(stdout, "\n"); | |
| } | |
| } |
There are a few other places where SCR calls print functions of other components, like:
Lines 1278 to 1289 in 48328f6
| if (scr_debug > 0 && scr_my_rank_world == 0) { | |
| scr_dbg(1, "Group descriptors:"); | |
| kvtree_print_mode(scr_groupdesc_hash, 4, KVTREE_PRINT_KEYVAL); | |
| } | |
| if (scr_debug > 0 && scr_my_rank_world == 0) { | |
| scr_dbg(1, "Store descriptors:"); | |
| kvtree_print_mode(scr_storedesc_hash, 4, KVTREE_PRINT_KEYVAL); | |
| } | |
| if (scr_debug > 0 && scr_my_rank_world == 0) { | |
| scr_dbg(1, "Redundancy descriptors:"); | |
| kvtree_print_mode(scr_reddesc_hash, 4, KVTREE_PRINT_KEYVAL); | |
| } |
Metadata
Metadata
Assignees
Labels
No labels