run-all.sh 1.46 KB
Newer Older
1
2
3
#!/bin/bash

if [ "$#" -ne 3 ]; then
4
5
    echo "Usage: run-all.sh <darshan_install_path> <tmp_path> <platform>" 1>&2
    echo "Example: ./run-all.sh ~/darshan-install /tmp/test ws" 1>&2
6
7
8
9
10
11
12
    exit 1
fi

# set variables for use by other sub-scripts
export DARSHAN_PATH=$1
export DARSHAN_TMP=$2
export DARSHAN_PLATFORM=$3
Philip Carns's avatar
Philip Carns committed
13
14
# number of procs that most test jobs will use
export DARSHAN_DEFAULT_NPROCS=4
15
16
17

# check darshan path
if [ ! -x $DARSHAN_PATH/bin/darshan-parser ]; then
18
    echo "Error: $DARSHAN_PATH doesn't contain a valid Darshan install." 1>&2
19
20
21
22
23
24
25
26
27
    exit 1
fi

# check and/or create tmp path
if [ ! -d $DARSHAN_TMP ]; then
    mkdir -p $DARSHAN_TMP
fi

if [ ! -d $DARSHAN_TMP ]; then
28
    echo "Error: unable to find or create $DARSHAN_TMP" 1>&2
29
30
31
    exit 1
fi
if [ ! -w $DARSHAN_TMP ]; then
32
    echo "Error: unable to write to $DARSHAN_TMP" 1>&2
33
34
35
36
37
    exit 1
fi

# make sure that we have sub-scripts for the specified platform
if [ ! -d $DARSHAN_PLATFORM ]; then
38
    echo "Error: unable to find scripts for platform $DARSHAN_PLATFORM" 1>&2
39
40
41
    exit 1
fi

42
43
44
45
46
47
48
# set up c compiler for this platform
DARSHAN_CC=`$DARSHAN_PLATFORM/setup-cc.sh`
if [ $? != 0 ]; then
    exit 1
fi
export DARSHAN_CC

Philip Carns's avatar
Philip Carns committed
49
50
51
52
53
54
55
# set up job execution wrapper for this platform
DARSHAN_RUNJOB=`$DARSHAN_PLATFORM/setup-runjob.sh`
if [ $? != 0 ]; then
    exit 1
fi
export DARSHAN_RUNJOB

56
57
58
59
60
61
62
63
for i in `ls test-cases/*.sh`; do
    $i
    if [ $? != 0 ]; then
        echo "Error: failed to execute test case $i"
        exit 1
    fi
done

64
exit 0