darshan-bg-f.conf.in 1.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!/bin/bash

# Example Darshan profiling configuration file for MPICH.


DARSHAN_PREFIX=@prefix@

# Check to see if user explicitly specified dynamic linking options
echo $CFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck1=$?
echo $LDFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck2=$?
echo "${allargs[@]}" | grep "\\-dynamic" >& /dev/null
dyncheck3=$?

# try to detect name of libmpichf77 or libmpichf90 library needed for pmpi
#   - these may be named with different suffixes to match the compiler version
D_MPI_PRELIB=`echo $LIBS |grep "\-lmpichf\\S\+\-\\S\+" -o`

# Skip profiling if we know that dynamic linking is in use.  See LD_PRELOAD 
# method instead.
if [ "$dyncheck1" -ne 0 -a "$dyncheck2" -ne 0 -a "$dyncheck3" -ne 0 ]; then

	# Libraries (and paths) to include before the MPI library 
	export PROFILE_PRELIB="$D_MPI_PRELIB `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"

	# Libraries to include after the MPI library 
	export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
fi

# C preprocessor arguments for any include files For example, to add
# /usr/local/myprof/include to the include path and the library libmyprof.a in
# /usr/local/myprof/lib to the link step, you could create the file myprof.conf with the
# lines 
# PROFILE_INCPATHS