darshan-anon-core-hours.pl 825 Bytes
Newer Older
1 2 3 4 5 6 7
#!/usr/bin/perl -w
#
#  (C) 2011 by Argonne National Laboratory.
#      See COPYRIGHT in top-level directory.

# takes a single darshan log as input; expectation is that the log is from
# the public data repo and has been annotated with compute node information.
Philip Carns's avatar
Philip Carns committed
8
# Prints 4 columns: file name, num procs, compute nodes, and run time
9 10 11 12 13 14 15 16


sub main()
{
    my $logfile;
    my $header;
    my $cn;
    my $runtime;
Philip Carns's avatar
Philip Carns committed
17
    my $nprocs;
18 19 20 21 22 23 24 25 26

    $logfile=$ARGV[0];

    $header = `darshan-parser $logfile |head -n 50`;

    if($header =~ /cn = (\d+)/){
        $cn = $1;
        if($header =~ /run time: (\d+)/){
            $runtime = $1;
Philip Carns's avatar
Philip Carns committed
27 28 29 30
            if($header =~ /nprocs: (\d+)/){
                $nprocs = $1;
                print("$logfile\t$nprocs\t$cn\t$runtime\n");
            }
31 32 33 34 35 36 37 38 39 40
        }
    }

    return 0;
}

#
# Main
#
&main