#!/bin/bash PROG=cxxpi # set log file path; remove previous log if present export DARSHAN_LOGFILE=$DARSHAN_TMP/${PROG}.darshan.gz rm -f ${DARSHAN_LOGFILE} # compile echo $DARSHAN_CXX test-cases/src/${PROG}.cxx -o $DARSHAN_TMP/${PROG} $DARSHAN_CXX test-cases/src/${PROG}.cxx -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-parser $DARSHAN_LOGFILE > $DARSHAN_TMP/${PROG}.darshan.txt if [ $? -ne 0 ]; then echo "Error: failed to parse ${DARSHAN_LOGFILE}" 1>&2 exit 1 fi # check results # in this case we want to confirm that the open counts are zero; cxxpi does not do any IO POSIX_OPENS=`grep CP_POSIX_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4` if [ "$POSIX_OPENS"x != ""x ]; then echo "Error: Found unexpected POSIX open count of $POSIX_OPENS" 1>&2 exit 1 fi exit 0