#!/bin/bash PROG=mpi-io-test # set log file path; remove previous log if present export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan.gz rm -f ${DARSHAN_LOGFILE} # compile $DARSHAN_CC $DARSHAN_TESTDIR/test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG} if [ $? -ne 0 ]; then echo "Error: failed to compile ${PROG}" 1>&2 exit 1 fi # execute $DARSHAN_RUNJOB $DARSHAN_TMP/${PROG} -f $DARSHAN_TMP/${PROG}.tmp.dat if [ $? -ne 0 ]; then echo "Error: failed to execute ${PROG}" 1>&2 exit 1 fi # parse log $DARSHAN_PATH/bin/darshan-posix-parser $DARSHAN_LOGFILE > $DARSHAN_TMP/${PROG}.darshan.txt if [ $? -ne 0 ]; then echo "Error: failed to parse ${DARSHAN_LOGFILE}" 1>&2 exit 1 fi $DARSHAN_PATH/bin/darshan-mpiio-parser $DARSHAN_LOGFILE > $DARSHAN_TMP/${PROG}-mpiio.darshan.txt if [ $? -ne 0 ]; then echo "Error: failed to parse ${DARSHAN_LOGFILE}" 1>&2 exit 1 fi POSIX_OPENS=`grep POSIX_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -d : -f 2 |xargs` if [ ! $POSIX_OPENS -gt 0 ]; then echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2 exit 1 fi MPI_OPENS=`grep INDEP_OPENS $DARSHAN_TMP/${PROG}-mpiio.darshan.txt |cut -d : -f 2 |xargs` if [ ! $MPI_OPENS -gt 0 ]; then echo "Error: MPI open count of $MPI_OPENS is incorrect" 1>&2 exit 1 fi exit 0