[Darshan-commits] [Git][darshan/darshan][master] port darshan-gather-stats.pl from 2.x

Philip Carns xgitlab at cels.anl.gov
Fri Sep 29 14:19:36 CDT 2017


Philip Carns pushed to branch master at darshan / darshan


Commits:
a9a5654f by Phil Carns at 2017-09-29T19:19:23+00:00
port darshan-gather-stats.pl from 2.x

- - - - -


1 changed file:

- + darshan-test/utility-scripts/darshan-gather-stats.pl


Changes:

=====================================
darshan-test/utility-scripts/darshan-gather-stats.pl
=====================================
--- /dev/null
+++ b/darshan-test/utility-scripts/darshan-gather-stats.pl
@@ -0,0 +1,102 @@
+#!/usr/bin/perl -w
+
+# This script will go through all of the darshan logs in a given
+# subdirectory and summarize a few basic statistics about data usage and
+# performance, producing a text file with text in columns
+
+#<jobid> <version> <start ascii> <end ascii> <start unix> <end unix> <nprocs> <bytes read> <bytes written> <perf estimate> 
+
+use strict;
+use File::Find;
+
+sub wanted
+{
+    my $file = $_;
+    my $line;
+    my $version = 0.0;
+    my $nprocs = 0;
+    my $start = 0;
+    my $end = 0;
+    my $start_a = "";
+    my $end_a = "";
+    my $jobid = 0;
+    my $bytes_r = 0;
+    my $bytes_w = 0;
+    my $perf = 0.0;
+    my $nfiles = 0;
+
+    # only operate on darshan log files
+    $file =~ /\.darshan$/ or return;    
+
+    # grab jobid from name, old logs don't store it in the file
+    if($file =~ /_id(\d+)_/) {
+        $jobid = $1;
+    }
+
+    if(!(open(SUMMARY, "darshan-parser --total --perf --file $file |")))
+    {
+        print(STDERR "Failed to parse $File::Find::name\n");
+        return;
+    }
+
+    while ($line = <SUMMARY>) {
+        if($line =~ /log version: (\S+)/) {
+            $version = $1;
+        }
+        if($line =~ /nprocs: (\S+)/) {
+            $nprocs = $1;
+        }
+        if($line =~ /start_time: (\S+)/) {
+            $start = $1;
+        }
+        if($line =~ /end_time: (\S+)/) {
+            $end = $1;
+        }
+        if($line =~ /total_POSIX_BYTES_READ: (\S+)/) {
+            $bytes_r = $1;
+        }
+        if($line =~ /total_POSIX_BYTES_WRITTEN: (\S+)/) {
+            $bytes_w = $1;
+        }
+        if($line =~ /agg_perf_by_slowest: (\S+)/) {
+            $perf = $1;
+        }
+        if($line =~ /total: (\S+)/) {
+            $nfiles = $1;
+        }
+        if($line =~ /start_time_asci: (.+)/) {
+            $start_a = "$1";
+        }
+        if($line =~ /end_time_asci: (.+)/) {
+            $end_a = "$1";
+        }
+    }
+
+    close(SUMMARY);
+    print("$jobid\t$version\t\"$start_a\"\t\"$end_a\"\t$start\t$end\t$nprocs\t$bytes_r\t$bytes_w\t$perf\t$nfiles\n"); 
+}
+
+sub main
+{
+    my @paths;
+
+    if($#ARGV < 0) {
+        die("usage: darshan-gather-stats.pl <one or more log directories>\n");
+    }
+
+    @paths = @ARGV;
+
+    print("<jobid>\t<version>\t<start ascii>\t<end ascii>\t<start unix>\t<end unix>\t<nprocs>\t<bytes read>\t<bytes written>\t<perf estimate>\t<nfiles>\n"); 
+
+    find(\&wanted, @paths);
+
+}
+
+main();
+
+# Local variables:
+#  c-indent-level: 4
+#  c-basic-offset: 4
+# End:
+#  
+# vim: ts=8 sts=4 sw=4 expandtab



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/a9a5654f3c4810543559d88897c40d2338c6f0fd

---
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/a9a5654f3c4810543559d88897c40d2338c6f0fd
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20170929/48572375/attachment-0001.html>


More information about the Darshan-commits mailing list