Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
darshan
darshan
Commits
8070c831
Commit
8070c831
authored
Jan 26, 2016
by
Shane Snyder
Browse files
update command line args for log merging utility
parent
e81a9cae
Changes
1
Hide whitespace changes
Inline
Side-by-side
darshan-util/darshan-merge.c
View file @
8070c831
...
...
@@ -23,29 +23,28 @@ struct darshan_shared_record_ref
void
usage
(
char
*
exename
)
{
fprintf
(
stderr
,
"Usage: %s --output
-dir
<output_
dir
> [options] <input-logs>
\n
"
,
exename
);
fprintf
(
stderr
,
"Usage: %s --output <output_
path
> [options] <input-logs>
\n
"
,
exename
);
fprintf
(
stderr
,
"This utility merges multiple Darshan log files into a single output log file.
\n
"
);
fprintf
(
stderr
,
"Options:
\n
"
);
fprintf
(
stderr
,
"
\t
--output-dir
\t
(REQUIRED) Output directory to store output log file in.
\n
"
);
fprintf
(
stderr
,
"
\t
--output-name
\t
Output log file name. If unspecified, name generated automatically.
\n
"
);
fprintf
(
stderr
,
"
\t
--output
\t
(REQUIRED) Full path of the output darshan log file.
\n
"
);
fprintf
(
stderr
,
"
\t
--shared-redux
\t
Reduce globally shared records into a single record.
\n
"
);
exit
(
1
);
}
void
parse_args
(
int
argc
,
char
**
argv
,
char
***
infile_list
,
int
*
n_files
,
char
**
outlog_
dir
,
char
**
outlog_name
,
int
*
shared_redux
)
char
**
outlog_
path
,
int
*
shared_redux
)
{
int
index
;
static
struct
option
long_opts
[]
=
{
{
"shared-redux"
,
no_argument
,
NULL
,
's'
},
{
"output-dir"
,
required_argument
,
NULL
,
'd'
},
{
"output-name"
,
required_argument
,
NULL
,
'n'
},
{
"output"
,
required_argument
,
NULL
,
'o'
},
{
0
,
0
,
0
,
0
}
};
*
shared_redux
=
0
;
*
outlog_path
=
NULL
;
while
(
1
)
{
...
...
@@ -58,11 +57,8 @@ void parse_args(int argc, char **argv, char ***infile_list, int *n_files,
case
's'
:
*
shared_redux
=
1
;
break
;
case
'd'
:
*
outlog_dir
=
optarg
;
break
;
case
'n'
:
*
outlog_name
=
optarg
;
case
'o'
:
*
outlog_path
=
optarg
;
break
;
case
'?'
:
default:
...
...
@@ -71,7 +67,7 @@ void parse_args(int argc, char **argv, char ***infile_list, int *n_files,
}
}
if
(
*
outlog_
dir
==
NULL
)
if
(
*
outlog_
path
==
NULL
)
{
usage
(
argv
[
0
]);
}
...
...
@@ -177,12 +173,10 @@ int main(int argc, char *argv[])
char
**
infile_list
;
int
n_infiles
;
int
shared_redux
;
char
*
outlog_dir
=
NULL
;
char
*
outlog_name
=
NULL
;
char
outlog_path
[
512
];
char
*
outlog_path
;
darshan_fd
in_fd
,
merge_fd
;
struct
darshan_job
in_job
,
merge_job
;
char
merge_exe
[
DARSHAN_EXE_LEN
+
1
];
char
merge_exe
[
DARSHAN_EXE_LEN
+
1
]
=
{
0
}
;
char
**
merge_mnt_pts
;
char
**
merge_fs_types
;
int
merge_mnt_count
=
0
;
...
...
@@ -197,8 +191,7 @@ int main(int argc, char *argv[])
int
ret
;
/* grab command line arguments */
parse_args
(
argc
,
argv
,
&
infile_list
,
&
n_infiles
,
&
outlog_dir
,
&
outlog_name
,
&
shared_redux
);
parse_args
(
argc
,
argv
,
&
infile_list
,
&
n_infiles
,
&
outlog_path
,
&
shared_redux
);
memset
(
&
merge_job
,
0
,
sizeof
(
struct
darshan_job
));
...
...
@@ -312,13 +305,6 @@ int main(int argc, char *argv[])
darshan_log_close
(
in_fd
);
}
if
(
!
outlog_name
)
{
outlog_name
=
"test123.darshan"
;
}
sprintf
(
outlog_path
,
"%s/%s"
,
outlog_dir
,
outlog_name
);
/* create the output "merged" log */
merge_fd
=
darshan_log_create
(
outlog_path
,
DARSHAN_ZLIB_COMP
,
1
);
if
(
merge_fd
==
NULL
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment