Commit 988b5343 authored by Philip Carns's avatar Philip Carns

minor enhancements to darshan-summary-per-file.sh script


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@756 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 32219e29
#!/bin/sh
#!/bin/bash
#
# (C) 2013 by Argonne National Laboratory.
# See COPYRIGHT in top-level directory.
#
# change behavior of shell error code following failure of a piped command
set -o pipefail
if [ $# -ne 2 ]; then
echo "Usage: darshan-summary-per-file.sh <input_file.gz> <output_directory>"
exit 1
fi
# count number of files present in log
filecount=`darshan-parser --file-list $1| egrep -v '^(#|$)' | wc -l`
rc=$?
if [ $rc -ne 0 ]; then
exit $rc
fi
# create output file directory
mkdir $2
rc=$?
if [ $rc -ne 0 ]; then
exit $rc
fi
# loop through all files in log
counter=0
darshan-parser --file-list $1| egrep -v '^(#|$)' |
while read -r hash suffix stuff ; do
counter=$((counter+1))
file=$(basename $suffix)
if [ -x $file.gz ] ; then
$file = $file.$hash.gz
fi
echo Status: Generating summary for file $counter of $filecount: $file
echo =======================================================
darshan-convert --file $hash $1 $2/$file.gz
rc=$?
if [ $rc -ne 0 ]; then
exit $rc
fi
darshan-job-summary.pl $2/$file.gz --output $2/$file.pdf
rc=$?
if [ $rc -ne 0 ]; then
exit $rc
fi
done
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