test-darshan-compiles.sh 2.5 KB
Newer Older
1 2
#!/bin/bash

3 4 5 6 7 8 9
# notes:
# - install darshan to /home/carns/working/darshan/install
# - edit maint/generate-bg-compilers.sh to use that path
# - run generate-bg-compilers.sh
# - rm -rf out
# - run this script

10 11 12 13 14 15 16 17 18 19 20
compile_examples() {
    if [ -z $1 ]
    then
        echo "No parameters passed to function."
        exit 1
    fi
    if [ -z $2 ]
    then
        echo "Not enough parameters passed to function."
        exit 1
    fi
21

22
    PATH=/home/carns/working/darshan/install/bin/$1:$PATH
23

24 25 26
    mpicc $CFLAGS $LDFLAGS $TEST_PROG_DIR/mpi-io-test.c $LIBS -o $2/mpi-io-test.mpicc.$1
    mpixlc $CFLAGS $LDFLAGS $TEST_PROG_DIR/mpi-io-test.c $LIBS -o $2/mpi-io-test.mpxlc.$1
    mpixlc_r $CFLAGS $LDFLAGS $TEST_PROG_DIR/mpi-io-test.c $LIBS -o $2/mpi-io-test.mpxlc_r.$1
27

28 29 30
    mpicxx $CFLAGS $LDFLAGS $TEST_PROG_DIR/cxxpi.cxx $LIBS -o $2/cxxpi.mpicxx.$1
    mpixlcxx $CFLAGS $LDFLAGS $TEST_PROG_DIR/cxxpi.cxx $LIBS -o $2/cxxpi.mpxlcxx.$1
    mpixlcxx_r $CFLAGS $LDFLAGS $TEST_PROG_DIR/cxxpi.cxx $LIBS -o $2/cxxpi.mpxlcxx_r.$1
31

32 33 34
    mpif77 $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpif77.$1
    mpixlf77 $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf77.$1
    mpixlf77_r $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf77_r.$1
35

36 37 38
    mpif90 $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpif90.$1
    mpixlf90 $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf90.$1
    mpixlf90_r $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf90_r.$1
39

40 41
    mpixlf95 $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf95.$1
    mpixlf95_r $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf95_r.$1
42

43 44 45
    mpixlf2003 $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf2003.$1
    mpixlf2003_r $CFLAGS $LDFLAGS $TEST_PROG_DIR/fperf.f $FLIBS -o $2/fperf.mpxlf2003_r.$1
}
46 47


48 49
mkdir -p out
mkdir -p out/normal
Philip Carns's avatar
Philip Carns committed
50
mkdir -p out/fpmpi
51
TEST_PROG_DIR=/home/carns/working/darshan-examples
52

53
# tests with darshan enabled
54 55 56
CFLAGS="-g"
LDFLAGS=""
LIBS=""
57 58 59 60
FLIBS=""
compile_examples default out/normal
compile_examples fast out/normal
compile_examples xl out/normal
61

62
# tests with another pmpi library taking precedence
63 64 65
CFLAGS="-g"
LDFLAGS="-L/home/carns/working/fpmpi/build/lib"
LIBS="-lfpmpi"
66 67 68 69
FLIBS="-lfmpich.cnk -lfpmpi"
compile_examples default out/fpmpi
compile_examples fast out/fpmpi
compile_examples xl out/fpmpi
70

Philip Carns's avatar
Philip Carns committed
71 72
for i in `ls out/normal`; do echo $i; nm out/normal/$i |grep -c darshan; done
for i in `ls out/fpmpi`; do echo $i; nm out/fpmpi/$i |grep -c darshan; done