Commit 6fb4a2cd authored by Philip Carns's avatar Philip Carns

incremental progress


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@486 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 982a1863
......@@ -23,6 +23,11 @@ sub wanted
my $bytes_r = 0;
my $bytes_w = 0;
my $perf = 0.0;
my $read_interval = {};
my $write_interval = {};
my @read_interval_array = ();
my @write_interval_array = ();
my @fields = ();
# only operate on darshan log files
$file =~ /\.darshan\.gz$/ or return;
......@@ -41,21 +46,64 @@ sub wanted
}
while ($line = <PARSE>) {
if($line =~ /nprocs: (\S+)/) {
$nprocs = $1;
if ($line =~ /^\s*$/) {
# ignore blank lines
}
if($line =~ /start_time: (\S+)/) {
$start = $1;
elsif ($line =~ /^#/) {
if($line =~ /nprocs: (\S+)/) {
$nprocs = $1;
}
if($line =~ /start_time: (\S+)/) {
$start = $1;
}
if($line =~ /end_time: (\S+)/) {
$end = $1;
}
if($line =~ /start_time_asci: (.+)/) {
$start_a = "$1";
}
if($line =~ /end_time_asci: (.+)/) {
$end_a = "$1";
}
}
if($line =~ /end_time: (\S+)/) {
$end = $1;
}
if($line =~ /start_time_asci: (.+)/) {
$start_a = "$1";
}
if($line =~ /end_time_asci: (.+)/) {
$end_a = "$1";
else {
# parse line
@fields = split(/[\t ]+/, $line);
if ($fields[2] eq "CP_BYTES_READ") {
$read_interval->{bytes} = $fields[3];
#print("read interval bytes: $fields[3]\n");
}
if ($fields[2] eq "CP_BYTES_WRITTEN") {
$write_interval->{bytes} = $fields[3];
#print("write interval bytes: $fields[3]\n");
}
if ($fields[2] eq "CP_F_READ_START_TIMESTAMP") {
$read_interval->{start} = $fields[3];
}
if ($fields[2] eq "CP_F_WRITE_START_TIMESTAMP") {
$write_interval->{start} = $fields[3];
}
if ($fields[2] eq "CP_F_READ_END_TIMESTAMP") {
$read_interval->{end} = $fields[3];
if($read_interval->{bytes} > 0) {
#print("pushing read interval bytes $read_interval->{bytes}\n");
push(@read_interval_array, $read_interval);
$read_interval = {};
}
}
if ($fields[2] eq "CP_F_WRITE_END_TIMESTAMP") {
$write_interval->{end} = $fields[3];
if($write_interval->{bytes} > 0) {
#print("pushing write interval bytes $write_interval->{bytes}\n");
push(@write_interval_array, $write_interval);
$write_interval = {};
}
}
}
}
if(!(close(PARSE)))
......@@ -63,6 +111,30 @@ sub wanted
print(STDERR "Failed to parse $File::Find::name\n");
return;
}
@read_interval_array = sort { $a->{start} <=> $b->{start} } @read_interval_array;
@write_interval_array = sort { $a->{start} <=> $b->{start} } @write_interval_array;
# my $href;
# my $mykey;
#
# print "reads:\n";
# for $href ( @read_interval_array ) {
# print "{ ";
# for $mykey ( keys %$href ) {
# print "$mykey=$href->{$mykey} ";
# }
# print "}\n";
# }
# print "writes:\n";
# for $href ( @write_interval_array ) {
# print "{ ";
# for $mykey ( keys %$href ) {
# print "$mykey=$href->{$mykey} ";
# }
# print "}\n";
# }
print(SUMMARY "$jobid\t\"$start_a\"\t\"$end_a\"\t$start\t$end\t$nprocs\n");
}
......
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