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
f26baefc
Commit
f26baefc
authored
Feb 26, 2016
by
Shane Snyder
Browse files
allow job end time to be set by darshan-merge
parent
37b1bb02
Changes
2
Hide whitespace changes
Inline
Side-by-side
darshan-runtime/share/darshan-mmap-epilog.sh.in
View file @
f26baefc
...
...
@@ -11,6 +11,8 @@ DARSHAN_INSTALL_DIR=@prefix@
# use the log dir specified at configure time
DARSHAN_LOG_DIR
=
@__DARSHAN_LOG_PATH@
JOB_END
=
$(
date
+
"%s"
)
# use the default mmap log directory (/tmp), unless the
# env variable is set to something
if
[
-z
"
$DARSHAN_MMAP_LOGPATH
"
]
;
then
...
...
@@ -53,7 +55,7 @@ if [ $SLURM_NNODES -gt 1 ]; then
mkdir
-p
$NODE_LOG_DIR
# construct the per-node log file and store in the output directory
$DARSHAN_INSTALL_DIR
/bin/darshan-merge
\
$DARSHAN_INSTALL_DIR
/bin/darshan-merge
--job-end-time
$JOB_END
\
--output
${
NODE_LOG_DIR
}
/
${
LOG_NAME_PRE
}
_
${
NODE_NAME
}
.darshan
\
$DARSHAN_MMAP_LOG_GLOB
else
...
...
@@ -61,7 +63,7 @@ else
# single node, just create the final output darshan log
LOG_WRITE_START
=
$(
date
+%s
)
$DARSHAN_INSTALL_DIR
/bin/darshan-merge
$DARSHAN_INSTALL_DIR
/bin/darshan-merge
--job-end-time
$JOB_END
\
--shared-redux
--output
${
OUTPUT_LOG_DIR
}
/
${
TMP_LOG
}
\
$DARSHAN_MMAP_LOG_GLOB
LOG_WRITE_END
=
$(
date
+%s
)
...
...
@@ -72,4 +74,6 @@ else
mv
${
OUTPUT_LOG_DIR
}
/
${
TMP_LOG
}
${
OUTPUT_LOG_DIR
}
/
${
FINAL_LOG
}
fi
rm
-f
$DARSHAN_MMAP_LOG_GLOB
exit
0
darshan-util/darshan-merge.c
View file @
f26baefc
...
...
@@ -28,23 +28,27 @@ void usage(char *exename)
fprintf
(
stderr
,
"Options:
\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
"
);
fprintf
(
stderr
,
"
\t
--job-end-time
\t
Set the output log's job end time (requires argument of seconds since Epoch).
\n
"
);
exit
(
1
);
}
void
parse_args
(
int
argc
,
char
**
argv
,
char
***
infile_list
,
int
*
n_files
,
char
**
outlog_path
,
int
*
shared_redux
)
char
**
outlog_path
,
int
*
shared_redux
,
int64_t
*
job_end_time
)
{
int
index
;
char
*
check
;
static
struct
option
long_opts
[]
=
{
{
"shared-redux"
,
no_argument
,
NULL
,
's'
},
{
"output"
,
required_argument
,
NULL
,
'o'
},
{
"shared-redux"
,
no_argument
,
NULL
,
's'
},
{
"job-end-time"
,
required_argument
,
NULL
,
'e'
},
{
0
,
0
,
0
,
0
}
};
*
shared_redux
=
0
;
*
outlog_path
=
NULL
;
*
job_end_time
=
0
;
while
(
1
)
{
...
...
@@ -60,6 +64,14 @@ void parse_args(int argc, char **argv, char ***infile_list, int *n_files,
case
'o'
:
*
outlog_path
=
optarg
;
break
;
case
'e'
:
*
job_end_time
=
strtol
(
optarg
,
&
check
,
10
);
if
(
optarg
==
check
)
{
fprintf
(
stderr
,
"Error: unable to parse job end time value.
\n
"
);
exit
(
1
);
}
break
;
case
'?'
:
default:
usage
(
argv
[
0
]);
...
...
@@ -173,6 +185,7 @@ int main(int argc, char *argv[])
char
**
infile_list
;
int
n_infiles
;
int
shared_redux
;
int64_t
job_end_time
=
0
;
char
*
outlog_path
;
darshan_fd
in_fd
,
merge_fd
;
struct
darshan_job
in_job
,
merge_job
;
...
...
@@ -191,7 +204,7 @@ int main(int argc, char *argv[])
int
ret
;
/* grab command line arguments */
parse_args
(
argc
,
argv
,
&
infile_list
,
&
n_infiles
,
&
outlog_path
,
&
shared_redux
);
parse_args
(
argc
,
argv
,
&
infile_list
,
&
n_infiles
,
&
outlog_path
,
&
shared_redux
,
&
job_end_time
);
memset
(
&
merge_job
,
0
,
sizeof
(
struct
darshan_job
));
...
...
@@ -305,6 +318,10 @@ int main(int argc, char *argv[])
darshan_log_close
(
in_fd
);
}
/* if a job end time was passed in, apply it to the output job */
if
(
job_end_time
>
0
)
merge_job
.
end_time
=
job_end_time
;
/* 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