#!/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=$? # 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 # NOTE: there is something fragile here. We are relying on the BG mpicxx script to set a # variable called $cxxlibs to the name of the libmpichcxx variant that we need in order # to intercept pmpi calls # Libraries (and paths) to include before the MPI library export PROFILE_PRELIB="$cxxlibs `$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