mpi-io-test.sh 1.17 KB
Newer Older
1 2
#!/bin/bash

Philip Carns's avatar
Philip Carns committed
3 4 5 6 7 8 9
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
Philip Carns's avatar
Philip Carns committed
10
$DARSHAN_CC $DARSHAN_TESTDIR/test-cases/src/${PROG}.c -o $DARSHAN_TMP/${PROG}
Philip Carns's avatar
Philip Carns committed
11
if [ $? -ne 0 ]; then
Philip Carns's avatar
Philip Carns committed
12 13 14 15 16 17
    echo "Error: failed to compile ${PROG}" 1>&2
    exit 1
fi

# execute
$DARSHAN_RUNJOB $DARSHAN_TMP/${PROG} -f $DARSHAN_TMP/${PROG}.tmp.dat
Philip Carns's avatar
Philip Carns committed
18
if [ $? -ne 0 ]; then
Philip Carns's avatar
Philip Carns committed
19 20 21 22 23 24
    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
Philip Carns's avatar
Philip Carns committed
25
if [ $? -ne 0 ]; then
Philip Carns's avatar
Philip Carns committed
26 27 28 29 30 31
    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
32 33 34 35 36
#MPI_OPENS=`grep CP_INDEP_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
#if [ ! $MPI_OPENS -gt 0 ]; then
#    echo "Error: MPI open count of $MPI_OPENS is incorrect" 1>&2
#    exit 1
#fi
Philip Carns's avatar
Philip Carns committed
37
POSIX_OPENS=`grep CP_POSIX_OPENS $DARSHAN_TMP/${PROG}.darshan.txt |cut -f 4`
Philip Carns's avatar
Philip Carns committed
38
if [ ! $POSIX_OPENS -gt 0 ]; then
Philip Carns's avatar
Philip Carns committed
39
    echo "Error: POSIX open count of $POSIX_OPENS is incorrect" 1>&2
40 41 42
    exit 1
fi

Philip Carns's avatar
Philip Carns committed
43

44
exit 0