Commit ac48a609 authored by Shane Snyder's avatar Shane Snyder

update darshan-util to recognize partial log files

parent ca202304
...@@ -251,7 +251,7 @@ int main(int argc, char **argv) ...@@ -251,7 +251,7 @@ int main(int argc, char **argv)
return(-1); return(-1);
comp_type = bzip2 ? comp_type = DARSHAN_BZIP2_COMP : DARSHAN_ZLIB_COMP; comp_type = bzip2 ? comp_type = DARSHAN_BZIP2_COMP : DARSHAN_ZLIB_COMP;
outfile = darshan_log_create(outfile_name, comp_type); outfile = darshan_log_create(outfile_name, comp_type, infile->partial_flag);
if(!outfile) if(!outfile)
{ {
darshan_log_close(infile); darshan_log_close(infile);
......
...@@ -36,6 +36,7 @@ my %posix_access_hash = (); ...@@ -36,6 +36,7 @@ my %posix_access_hash = ();
my %mpiio_access_hash = (); my %mpiio_access_hash = ();
my @access_size = (); my @access_size = ();
my %hash_files = (); my %hash_files = ();
my $partial_flag = 0;
# data structures for calculating performance # data structures for calculating performance
my %hash_unique_file_time = (); my %hash_unique_file_time = ();
...@@ -93,10 +94,21 @@ while($line = <PARSE_OUT>) ...@@ -93,10 +94,21 @@ while($line = <PARSE_OUT>)
{ {
if ($line =~ /^# exe: /) if ($line =~ /^# exe: /)
{ {
$f_save = "";
($junk, $cmdline) = split(':', $line, 2); ($junk, $cmdline) = split(':', $line, 2);
print("PRE: $cmdline\n");
# add escape characters if needed for special characters in # add escape characters if needed for special characters in
# command line # command line
$cmdline = encode('latex', $cmdline); if ($cmdline =~ /<unknown args>/)
{
# fortran "<unknown args> seems to throw things off,
# so we don't encode that if it's present
$f_save = substr($cmdline, -14);
$cmdline = substr($cmdline, 0, -14);
}
$cmdline = encode('latex', $cmdline) . $f_save;
print("POST: $cmdline\n");
} }
elsif ($line =~ /^# nprocs: /) elsif ($line =~ /^# nprocs: /)
{ {
...@@ -123,6 +135,10 @@ while($line = <PARSE_OUT>) ...@@ -123,6 +135,10 @@ while($line = <PARSE_OUT>)
($junk, $version) = split(':', $line, 2); ($junk, $version) = split(':', $line, 2);
$version =~ s/^\s+//; $version =~ s/^\s+//;
} }
elsif ($line =~ /^# \*WARNING\*: This Darshan log contains incomplete data!/)
{
$partial_flag = 1;
}
} }
else else
{ {
...@@ -952,12 +968,19 @@ my $latex_cmd_line = "\"\\def\\titlecmd{$cmd} \\ ...@@ -952,12 +968,19 @@ my $latex_cmd_line = "\"\\def\\titlecmd{$cmd} \\
\\input{summary.tex}\" \\ \\input{summary.tex}\" \\
@__DARSHAN_PDFLATEX_HALT_ON_ERROR@"; @__DARSHAN_PDFLATEX_HALT_ON_ERROR@";
if ($partial_flag == 1)
{
my $partial_log_flags = "\\def\\incompletelog{1} \\";
$latex_cmd_line = substr($latex_cmd_line, 0, 1) . $partial_log_flags . substr($latex_cmd_line, 1);
}
if (defined $summary{MPIIO_INDEP_OPENS}) if (defined $summary{MPIIO_INDEP_OPENS})
{ {
my $mpiio_latex_flags = "\\def\\inclmpiio{1} \\\n"; my $mpiio_latex_flags = "\\def\\inclmpiio{1} \\";
$latex_cmd_line = substr($latex_cmd_line, 0, 1) . $mpiio_latex_flags . substr($latex_cmd_line, 1); $latex_cmd_line = substr($latex_cmd_line, 0, 1) . $mpiio_latex_flags . substr($latex_cmd_line, 1);
} }
$system_rc = system "$pdflatex $latex_cmd_line > latex.output"; $system_rc = system "$pdflatex $latex_cmd_line > latex.output";
if($system_rc) if($system_rc)
{ {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
\usepackage{subfigure} \usepackage{subfigure}
\usepackage{multirow} \usepackage{multirow}
\usepackage{threeparttable} \usepackage{threeparttable}
\usepackage{color}
% %
% GET THE MARGINS RIGHT, THE UGLY WAY % GET THE MARGINS RIGHT, THE UGLY WAY
...@@ -32,6 +33,17 @@ ...@@ -32,6 +33,17 @@
\pagestyle{fancy} \pagestyle{fancy}
\ifdefined\incompletelog
\twocolumn[
\vspace{3.5in}
\center
{\bf \textcolor{red}{WARNING}}: This Darshan log contains incomplete data
which may skew results in this document.
\endcenter
]
\newpage
\fi
\begin{figure*}[!h] \begin{figure*}[!h]
\centering \centering
\subfigure \subfigure
......
...@@ -159,7 +159,8 @@ darshan_fd darshan_log_open(const char *name) ...@@ -159,7 +159,8 @@ darshan_fd darshan_log_open(const char *name)
* *
* returns file descriptor on success, NULL on failure * returns file descriptor on success, NULL on failure
*/ */
darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type) darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type,
int partial_flag)
{ {
darshan_fd tmp_fd; darshan_fd tmp_fd;
int ret; int ret;
...@@ -188,6 +189,7 @@ darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type ...@@ -188,6 +189,7 @@ darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type
} }
tmp_fd->state->creat_flag = 1; tmp_fd->state->creat_flag = 1;
tmp_fd->state->comp_type = comp_type; tmp_fd->state->comp_type = comp_type;
tmp_fd->partial_flag = partial_flag;
strncpy(tmp_fd->state->logfile_path, name, PATH_MAX); strncpy(tmp_fd->state->logfile_path, name, PATH_MAX);
/* position file pointer to prealloc space for the log file header /* position file pointer to prealloc space for the log file header
...@@ -882,6 +884,7 @@ static int darshan_log_getheader(darshan_fd fd) ...@@ -882,6 +884,7 @@ static int darshan_log_getheader(darshan_fd fd)
} }
state->comp_type = header.comp_type; state->comp_type = header.comp_type;
fd->partial_flag = header.partial_flag;
/* save the mapping of data within log file to this file descriptor */ /* save the mapping of data within log file to this file descriptor */
fd->job_map.off = sizeof(struct darshan_header); fd->job_map.off = sizeof(struct darshan_header);
...@@ -913,6 +916,7 @@ static int darshan_log_putheader(darshan_fd fd) ...@@ -913,6 +916,7 @@ static int darshan_log_putheader(darshan_fd fd)
strcpy(header.version_string, DARSHAN_LOG_VERSION); strcpy(header.version_string, DARSHAN_LOG_VERSION);
header.magic_nr = DARSHAN_MAGIC_NR; header.magic_nr = DARSHAN_MAGIC_NR;
header.comp_type = state->comp_type; header.comp_type = state->comp_type;
header.partial_flag = fd->partial_flag;
/* copy the mapping information to the header */ /* copy the mapping information to the header */
memcpy(&header.rec_map, &fd->rec_map, sizeof(struct darshan_log_map)); memcpy(&header.rec_map, &fd->rec_map, sizeof(struct darshan_log_map));
......
...@@ -27,6 +27,8 @@ struct darshan_fd_s ...@@ -27,6 +27,8 @@ struct darshan_fd_s
/* flag indicating whether byte swapping needs to be /* flag indicating whether byte swapping needs to be
* performed on log file data */ * performed on log file data */
int swap_flag; int swap_flag;
/* flag indicating whether a log file contains partial data */
int partial_flag;
/* log file offset/length maps for each log file region */ /* log file offset/length maps for each log file region */
struct darshan_log_map job_map; struct darshan_log_map job_map;
struct darshan_log_map rec_map; struct darshan_log_map rec_map;
...@@ -82,7 +84,8 @@ extern struct darshan_mod_logutil_funcs *mod_logutils[]; ...@@ -82,7 +84,8 @@ extern struct darshan_mod_logutil_funcs *mod_logutils[];
#include "darshan-bgq-logutils.h" #include "darshan-bgq-logutils.h"
darshan_fd darshan_log_open(const char *name); darshan_fd darshan_log_open(const char *name);
darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type); darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type,
int partial_flag);
int darshan_log_getjob(darshan_fd fd, struct darshan_job *job); int darshan_log_getjob(darshan_fd fd, struct darshan_job *job);
int darshan_log_putjob(darshan_fd fd, struct darshan_job *job); int darshan_log_putjob(darshan_fd fd, struct darshan_job *job);
int darshan_log_getexe(darshan_fd fd, char *buf); int darshan_log_getexe(darshan_fd fd, char *buf);
......
...@@ -321,6 +321,12 @@ int main(int argc, char **argv) ...@@ -321,6 +321,12 @@ int main(int argc, char **argv)
printf("# mount entry:\t%s\t%s\n", mnt_pts[i], fs_types[i]); printf("# mount entry:\t%s\t%s\n", mnt_pts[i], fs_types[i]);
} }
/* warn user if this log file is incomplete */
if(fd->partial_flag)
printf("\n# *WARNING*: This Darshan log contains incomplete data!\n"
"# This happens when an application creates\n"
"# more records than Darshan can track.\n");
pdata.rank_cumul_io_time = malloc(sizeof(double)*job.nprocs); pdata.rank_cumul_io_time = malloc(sizeof(double)*job.nprocs);
pdata.rank_cumul_md_time = malloc(sizeof(double)*job.nprocs); pdata.rank_cumul_md_time = malloc(sizeof(double)*job.nprocs);
if (!pdata.rank_cumul_io_time || !pdata.rank_cumul_md_time) if (!pdata.rank_cumul_io_time || !pdata.rank_cumul_md_time)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment