Skip to content
7 changes: 6 additions & 1 deletion darshan-util/darshan-analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,16 @@ int main(int argc, char **argv)

if(argc != 2)
{
fprintf(stderr, "Error: directory of Darshan logs required as argument.\n");
fprintf(stderr, "Usage: darshan-analyzer --version | <directory>\n");
fprintf(stderr, " '--version' or directory of Darshan logs required as argument.\n");
return(-1);
}

base = argv[1];
if (!strcmp(base, "--version")) {
printf("%s\n",PACKAGE_VERSION);
exit(0);
}

ret = ftw(base, tree_walk, 512);
if(ret != 0)
Expand Down
8 changes: 7 additions & 1 deletion darshan-util/darshan-convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ int usage (char *exename)
fprintf(stderr, "Usage: %s [options] <infile> <outfile>\n", exename);
fprintf(stderr, " Converts darshan log from infile to outfile.\n");
fprintf(stderr, " rewrites the log file into the newest format.\n");
fprintf(stderr, " --help prints this help message and exits\n");
fprintf(stderr, " --version prints Darshan version number and exits\n");
fprintf(stderr, " --bzip2 Use bzip2 compression instead of zlib.\n");
fprintf(stderr, " --obfuscate Obfuscate all items in the log.\n");
fprintf(stderr, " --obfuscate_jobid Obfuscate job ID in the log.\n");
Expand Down Expand Up @@ -62,6 +64,7 @@ void parse_args (int argc, char **argv, char **infile, char **outfile, int *bzip
{"reset-md", 0, NULL, 'r'},
{"key", 1, NULL, 'k'},
{"file", 1, NULL, 'f'},
{"version", 0, NULL, 'v'},
{"help", 0, NULL, 0},
{ 0, 0, 0, 0 }
};
Expand Down Expand Up @@ -118,11 +121,14 @@ void parse_args (int argc, char **argv, char **infile, char **outfile, int *bzip
if(ret != 1)
usage(argv[0]);
break;
case 'v':
printf("%s\n", PACKAGE_VERSION);
exit(0);
case 0:
case '?':
default:
usage(argv[0]);
break;
exit(0);
}
}

Expand Down
7 changes: 6 additions & 1 deletion darshan-util/darshan-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ int main(int argc, char *argv[])
int i;
int ret;

if (argc == 2 && !strcmp(argv[1], "--version")) {
printf("%s\n", PACKAGE_VERSION);
return(0);
}

if(argc != 3)
{
fprintf(stderr, "Usage: darshan-diff <logfile1> <logfile2>\n");
fprintf(stderr, "Usage: darshan-diff [--version | <logfile1> <logfile2>]\n");
return(-1);
}

Expand Down
7 changes: 7 additions & 0 deletions darshan-util/darshan-dxt-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "darshan-logutils.h"

#define OPTION_SHOW_INCOMPLETE (1 << 7) /* show what we have, even if log is incomplete */
#define OPTION_VERSION (1 << 4) /* print Darshan version number */

static int usage (char *exename);
static int parse_args (int argc, char **argv, char **filename);
Expand Down Expand Up @@ -364,6 +365,7 @@ static int parse_args (int argc, char **argv, char **filename)
static struct option long_opts[] =
{
{"show-incomplete", 0, NULL, OPTION_SHOW_INCOMPLETE},
{"version", 0, NULL, OPTION_VERSION},
{"help", 0, NULL, 0},
{0, 0, 0, 0}
};
Expand All @@ -381,6 +383,9 @@ static int parse_args (int argc, char **argv, char **filename)
case OPTION_SHOW_INCOMPLETE:
mask |= c;
break;
case OPTION_VERSION:
printf("%s\n",PACKAGE_VERSION);
exit(0);
case 0:
case '?':
default:
Expand All @@ -404,6 +409,8 @@ static int parse_args (int argc, char **argv, char **filename)
static int usage (char *exename)
{
fprintf(stderr, "Usage: %s [options] <filename>\n", exename);
fprintf(stderr, " --help prints this help message and exits\n");
fprintf(stderr, " --version prints Darshan version number and exits\n");
fprintf(stderr, " --show-incomplete : display results even if log is incomplete\n");

exit(1);
Expand Down
7 changes: 7 additions & 0 deletions darshan-util/darshan-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void usage(char *exename)
fprintf(stderr, "This utility merges multiple Darshan log files into a single output log file.\n");
fprintf(stderr, "<input_log_glob> is a pattern that matches all input log files (e.g., /log-path/*.darshan).\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, "\t--help \t\tprints this help message and exits\n");
fprintf(stderr, "\t--version \tprints Darshan version number and exits\n");
fprintf(stderr, "\t--output\t(REQUIRED) Full path of the output darshan log file.\n");
fprintf(stderr, "\t--shared-redux\tReduce globally shared records into a single record.\n");
fprintf(stderr, "\t--job-end-time\tSet the output log's job end time (requires argument of seconds since Epoch).\n");
Expand All @@ -44,6 +46,8 @@ void parse_args(int argc, char **argv, char ***infile_list, int *n_files,
{"output", required_argument, NULL, 'o'},
{"shared-redux", no_argument, NULL, 's'},
{"job-end-time", required_argument, NULL, 'e'},
{"version", 0, NULL, 'v'},
{"help", 0, NULL, 0},
{0, 0, 0, 0}
};

Expand Down Expand Up @@ -73,6 +77,9 @@ void parse_args(int argc, char **argv, char ***infile_list, int *n_files,
exit(1);
}
break;
case 'v':
printf("%s\n", PACKAGE_VERSION);
exit(0);
case '?':
default:
usage(argv[0]);
Expand Down
29 changes: 18 additions & 11 deletions darshan-util/darshan-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
/*
* Options
*/
#define OPTION_BASE (1 << 0) /* darshan log fields */
#define OPTION_TOTAL (1 << 1) /* aggregated fields */
#define OPTION_PERF (1 << 2) /* derived performance */
#define OPTION_FILE (1 << 3) /* file count totals */
#define OPTION_BASE (1 << 0) /* Darshan log fields */
#define OPTION_TOTAL (1 << 1) /* aggregated fields */
#define OPTION_PERF (1 << 2) /* derived performance */
#define OPTION_FILE (1 << 3) /* file count totals */
#define OPTION_VERSION (1 << 4) /* print Darshan version number */
#define OPTION_SHOW_INCOMPLETE (1 << 7) /* show what we have, even if log is incomplete */
#define OPTION_ALL (\
OPTION_BASE|\
Expand All @@ -57,11 +58,13 @@ void daos_print_total_file(struct darshan_daos_object *pfile, int daos_ver);
int usage (char *exename)
{
fprintf(stderr, "Usage: %s [options] <filename>\n", exename);
fprintf(stderr, " --all : all sub-options are enabled\n");
fprintf(stderr, " --base : darshan log field data [default]\n");
fprintf(stderr, " --file : total file counts\n");
fprintf(stderr, " --perf : derived perf data\n");
fprintf(stderr, " --total : aggregated darshan field data\n");
fprintf(stderr, " --help : prints this help message and exits\n");
fprintf(stderr, " --version : prints Darshan version number and exits\n");
fprintf(stderr, " --all : all sub-options are enabled\n");
fprintf(stderr, " --base : Darshan log field data [default]\n");
fprintf(stderr, " --file : total file counts\n");
fprintf(stderr, " --perf : derived perf data\n");
fprintf(stderr, " --total : aggregated Darshan field data\n");
fprintf(stderr, " --show-incomplete : display results even if log is incomplete\n");

exit(1);
Expand All @@ -80,6 +83,7 @@ int parse_args (int argc, char **argv, char **filename)
{"total", 0, NULL, OPTION_TOTAL},
{"show-incomplete", 0, NULL, OPTION_SHOW_INCOMPLETE},
{"help", 0, NULL, 0},
{"version", 0, NULL, OPTION_VERSION},
{0, 0, 0, 0}
};

Expand All @@ -101,6 +105,9 @@ int parse_args (int argc, char **argv, char **filename)
case OPTION_SHOW_INCOMPLETE:
mask |= c;
break;
case OPTION_VERSION:
printf("%s\n", PACKAGE_VERSION);
exit(0);
case 0:
case '?':
default:
Expand Down Expand Up @@ -349,7 +356,7 @@ int main(int argc, char **argv)
"\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");
"# Darshan from instrumenting unnecessary files.\n");
if(fd->mod_map[i].len == 0)
continue; // no data to parse
}
Expand All @@ -365,7 +372,7 @@ int main(int argc, char **argv)
"\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");
"# Darshan from instrumenting unnecessary files.\n");
fprintf(stderr,
"\n# You can display the (incomplete) data that is\n"
"# present in this log using the --show-incomplete\n"
Expand Down
Loading