[Darshan-commits] [Git][darshan/darshan][carns/issue-284-incomplete-warning] default to error out on incomplete logs
Philip Carns
xgitlab at cels.anl.gov
Mon Mar 15 15:13:04 CDT 2021
Philip Carns pushed to branch carns/issue-284-incomplete-warning at darshan / darshan
Commits:
23b19903 by Phil Carns at 2021-03-15T16:12:06-04:00
default to error out on incomplete logs
- show more verbose error message
- get previous behavior (warning while still displaying output) using
the --show-incomplete option
- - - - -
1 changed file:
- darshan-util/darshan-parser.c
Changes:
=====================================
darshan-util/darshan-parser.c
=====================================
@@ -29,13 +29,15 @@
#define OPTION_FILE (1 << 3) /* file count totals */
#define OPTION_FILE_LIST (1 << 4) /* per-file summaries */
#define OPTION_FILE_LIST_DETAILED (1 << 6) /* per-file summaries with extra detail */
+#define OPTION_SHOW_INCOMPLETE (1 << 7) /* show what we have, even if log is incomplete */
#define OPTION_ALL (\
OPTION_BASE|\
OPTION_TOTAL|\
OPTION_PERF|\
OPTION_FILE|\
OPTION_FILE_LIST|\
- OPTION_FILE_LIST_DETAILED)
+ OPTION_FILE_LIST_DETAILED|\
+ OPTION_SHOW_INCOMPLETE)
#define FILETYPE_SHARED (1 << 0)
#define FILETYPE_UNIQUE (1 << 1)
@@ -148,6 +150,7 @@ int parse_args (int argc, char **argv, char **filename)
{"file-list-detailed", 0, NULL, OPTION_FILE_LIST_DETAILED},
{"perf", 0, NULL, OPTION_PERF},
{"total", 0, NULL, OPTION_TOTAL},
+ {"show-incomplete", 0, NULL, OPTION_SHOW_INCOMPLETE},
{"help", 0, NULL, 0},
{0, 0, 0, 0}
};
@@ -169,6 +172,7 @@ int parse_args (int argc, char **argv, char **filename)
case OPTION_FILE_LIST_DETAILED:
case OPTION_PERF:
case OPTION_TOTAL:
+ case OPTION_SHOW_INCOMPLETE:
mask |= c;
break;
case 0:
@@ -189,9 +193,9 @@ int parse_args (int argc, char **argv, char **filename)
}
/* default mask value if none specified */
- if (mask == 0)
+ if (mask == 0 || mask == OPTION_SHOW_INCOMPLETE)
{
- mask = OPTION_BASE;
+ mask |= OPTION_BASE;
}
return mask;
@@ -412,11 +416,41 @@ int main(int argc, char **argv)
printf("# *******************************************************\n");
/* print warning if this module only stored partial data */
- if(DARSHAN_MOD_FLAG_ISSET(fd->partial_flag, i))
- printf("\n# *WARNING*: The %s module contains incomplete data!\n"
- "# This happens when a module runs out of\n"
- "# memory to store new record data.\n",
- darshan_module_names[i]);
+ if(DARSHAN_MOD_FLAG_ISSET(fd->partial_flag, i)) {
+ if(mask & OPTION_SHOW_INCOMPLETE)
+ {
+ /* user requested that we show the data we have anyway */
+ printf("\n# *WARNING*:\n"
+ "# The %s module contains incomplete data!\n"
+ "# This happens when a module runs out of\n"
+ "# memory to store new record data.\n",
+ darshan_module_names[i]);
+ printf(
+ "\n# To avoid this error, consult the darshan-runtime\n"
+ "# documentation and consider setting the\n"
+ "# DARSHAN_EXCLUDE_DIRS environment variable to prevent\n"
+ "# Darshan from instrumenting unecessary files.\n");
+ }
+ else
+ {
+ /* hard error */
+ fprintf(stderr, "\n# *ERROR*:\n"
+ "# The %s module contains incomplete data!\n"
+ "# This happens when a module runs out of\n"
+ "# memory to store new record data.\n",
+ darshan_module_names[i]);
+ fprintf(stderr,
+ "\n# To avoid this error, consult the darshan-runtime\n"
+ "# documentation and consider setting the\n"
+ "# DARSHAN_EXCLUDE_DIRS environment variable to prevent\n"
+ "# Darshan from instrumenting unecessary files.\n");
+ fprintf(stderr,
+ "\n# You can display the (incomplete) data that is\n"
+ "# present in this log using the --show-incomplete\n"
+ "# option to darshan-parser.\n");
+ return(-1);
+ }
+ }
if(mask & OPTION_BASE)
{
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/23b1990319c6fdaa1014e6eafa7f897678470af6
--
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/23b1990319c6fdaa1014e6eafa7f897678470af6
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20210315/6e3d3cf9/attachment-0001.html>
More information about the Darshan-commits
mailing list