Commit 4831753d authored by Philip Carns's avatar Philip Carns

test basic counters

parent feb1fe1e
...@@ -10,6 +10,8 @@ fi ...@@ -10,6 +10,8 @@ fi
export DARSHAN_PATH=$1 export DARSHAN_PATH=$1
export DARSHAN_TMP=$2 export DARSHAN_TMP=$2
export DARSHAN_PLATFORM=$3 export DARSHAN_PLATFORM=$3
# number of procs that most test jobs will use
export DARSHAN_DEFAULT_NPROCS=4
# check darshan path # check darshan path
if [ ! -x $DARSHAN_PATH/bin/darshan-parser ]; then if [ ! -x $DARSHAN_PATH/bin/darshan-parser ]; then
...@@ -42,9 +44,15 @@ DARSHAN_CC=`$DARSHAN_PLATFORM/setup-cc.sh` ...@@ -42,9 +44,15 @@ DARSHAN_CC=`$DARSHAN_PLATFORM/setup-cc.sh`
if [ $? != 0 ]; then if [ $? != 0 ]; then
exit 1 exit 1
fi fi
export DARSHAN_CC export DARSHAN_CC
# set up job execution wrapper for this platform
DARSHAN_RUNJOB=`$DARSHAN_PLATFORM/setup-runjob.sh`
if [ $? != 0 ]; then
exit 1
fi
export DARSHAN_RUNJOB
for i in `ls test-cases/*.sh`; do for i in `ls test-cases/*.sh`; do
$i $i
if [ $? != 0 ]; then if [ $? != 0 ]; then
......
#!/bin/bash #!/bin/bash
$DARSHAN_CC test-cases/src/mpi-io-test.c -o $DARSHAN_TMP/mpi-io-test 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 test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG}
if [ $? != 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 [ $? != 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 [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Error: failed to compile mpi-io-test" 1>&2 echo "Error: failed to parse ${DARSHAN_LOGFILE}" 1>&2
exit 1
fi
# check results
# in this case we want to confirm that both the MPI and POSIX open counters were triggered
MPI_OPENS=`grep CP_INDEP_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
if [ ! $MPI_OPENS > 0 ]; then
echo "Error: MPI open count of $MPI_OPENS is incorrect" 1>&2
exit 1
fi
POSIX_OPENS=`grep CP_POSIX_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
if [ ! $POSIX_OPENS > 0 ]; then
echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2
exit 1 exit 1
fi fi
exit 0 exit 0
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