Commit 16e42b8b authored by Philip Carns's avatar Philip Carns

fixed buggy access size counting


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@139 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 61856756
...@@ -20,14 +20,13 @@ my $tmp_dir = tempdir( CLEANUP => 1 ); ...@@ -20,14 +20,13 @@ my $tmp_dir = tempdir( CLEANUP => 1 );
my $orig_dir = getcwd; my $orig_dir = getcwd;
my $output_file = "summary.pdf"; my $output_file = "summary.pdf";
my $input_file = ""; my $input_file = "";
my %access_hash = ();
my @access_size = ();
process_args(); process_args();
open(TRACE, $input_file) || die("can't open $input_file for processing: $!\n"); open(TRACE, $input_file) || die("can't open $input_file for processing: $!\n");
$max_access = -1;
$max_access_hash = 0;
while ($line = <TRACE>) { while ($line = <TRACE>) {
chop($line); chop($line);
...@@ -79,44 +78,21 @@ while ($line = <TRACE>) { ...@@ -79,44 +78,21 @@ while ($line = <TRACE>) {
} }
} }
# record access and stride counters if ($fields[2] =~ /^CP_ACCESS(.)_ACCESS/) {
if ($fields[2] =~ /(^CP_STRIDE.*)/) { $access_size[$1] = $fields[3];
$tmpfield = $1;
if(defined $common{$fields[1]}{$tmpfield}) {
$common{$fields[1]}{$tmpfield} += $fields[3];
}
else {
$common{$fields[1]}{$tmpfield} = $fields[3];
}
$common{$fields[1]}{'name'} = $fields[4];
}
if ($fields[2] =~ /(^CP_ACCESS.*)/) {
$tmpfield = $1;
if(defined $common{$fields[1]}{$tmpfield}) {
$common{$fields[1]}{$tmpfield} += $fields[3];
} }
else { if ($fields[2] =~ /^CP_ACCESS(.)_COUNT/) {
$common{$fields[1]}{$tmpfield} = $fields[3]; my $tmp_access_size = $access_size[$1];
} if(defined $access_hash{$tmp_access_size}){
if(defined $common{$fields[1]}{'totalaccess'}) { $access_hash{$tmp_access_size} += $fields[3];
$common{$fields[1]}{'totalaccess'} += $fields[3];
}
else {
$common{$fields[1]}{'totalaccess'} = $fields[3];
} }
else{
if($common{$fields[1]}{'totalaccess'} > $max_access) { $access_hash{$tmp_access_size} = $fields[3];
$max_access = $common{$fields[1]}{'totalaccess'};
$max_access_hash = $fields[1];
} }
} }
} }
} }
# print "max_access: $max_access.\n";
# print "max_access_hash: $max_access_hash.\n";
# counts of operations # counts of operations
open(COUNTS, ">$tmp_dir/counts.dat") || die("error opening output file: $!\n"); open(COUNTS, ">$tmp_dir/counts.dat") || die("error opening output file: $!\n");
print COUNTS "# P=POSIX, MI=MPI-IO indep., MC=MPI-IO coll., R=read, W=write\n"; print COUNTS "# P=POSIX, MI=MPI-IO indep., MC=MPI-IO coll., R=read, W=write\n";
...@@ -275,36 +251,31 @@ close TABLES; ...@@ -275,36 +251,31 @@ close TABLES;
open(TABLES, ">$tmp_dir/access-table.tex") || die("error opening output file:$!\n"); open(TABLES, ">$tmp_dir/access-table.tex") || die("error opening output file:$!\n");
print TABLES " print TABLES "
\\begin{tabular}{|r|r|} \\begin{tabular}{|r|r|}
\\multicolumn{2}{c}{Top 4 Access Sizes} \\\\ \\multicolumn{2}{c}{Common Access Sizes} \\\\
\\hline \\hline
access size \& count \\\\ access size \& count \\\\
\\hline \\hline
$common{$max_access_hash}{CP_ACCESS1_ACCESS} \& $common{$max_access_hash}{CP_ACCESS1_COUNT} \\\\
$common{$max_access_hash}{CP_ACCESS2_ACCESS} \& $common{$max_access_hash}{CP_ACCESS2_COUNT} \\\\
$common{$max_access_hash}{CP_ACCESS3_ACCESS} \& $common{$max_access_hash}{CP_ACCESS3_COUNT} \\\\
$common{$max_access_hash}{CP_ACCESS4_ACCESS} \& $common{$max_access_hash}{CP_ACCESS4_COUNT} \\\\
\\hline
\\end{tabular}
"; ";
close TABLES;
open(TABLES, ">$tmp_dir/stride-table.tex") || die("error opening output file:$!\n"); # sort access sizes (descending)
my $i = 0;
foreach $value (sort {$access_hash{$b} cmp $access_hash{$a} } keys %access_hash) {
if($i == 3) {
last;
}
if($access_hash{$value} == 0) {
last;
}
print TABLES "$value \& $access_hash{$value} \\\\\n";
$i++;
}
print TABLES " print TABLES "
\\begin{tabular}{|r|r|}
\\multicolumn{2}{c}{file: $common{$max_access_hash}{'name'}} \\\\
\\hline
stride size \& count \\\\
\\hline
$common{$max_access_hash}{CP_STRIDE1_STRIDE} \& $common{$max_access_hash}{CP_STRIDE1_COUNT} \\\\
$common{$max_access_hash}{CP_STRIDE2_STRIDE} \& $common{$max_access_hash}{CP_STRIDE2_COUNT} \\\\
$common{$max_access_hash}{CP_STRIDE3_STRIDE} \& $common{$max_access_hash}{CP_STRIDE3_COUNT} \\\\
$common{$max_access_hash}{CP_STRIDE4_STRIDE} \& $common{$max_access_hash}{CP_STRIDE4_COUNT} \\\\
\\hline \\hline
\\end{tabular} \\end{tabular}
"; ";
close TABLES; close TABLES;
open(TIME, ">$tmp_dir/time-summary.dat") || die("error opening output file:$!\n"); open(TIME, ">$tmp_dir/time-summary.dat") || die("error opening output file:$!\n");
print TIME "# <type>, <app time>, <read>, <write>, <meta>\n"; print TIME "# <type>, <app time>, <read>, <write>, <meta>\n";
print TIME "POSIX, ", ((($runtime * $nprocs - $summary{CP_F_POSIX_READ_TIME} - print TIME "POSIX, ", ((($runtime * $nprocs - $summary{CP_F_POSIX_READ_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