Commit 7327c7a7 authored by Philip Carns's avatar Philip Carns

Added ability to disable darshan at link time if common pmpi tools are

detected.  Only works for mpicc right now, need to port to other scripts
as well.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@48 3b7491f3-a168-0410-bf4b-c445ed680a29
parent d596bf51
......@@ -82,6 +82,7 @@ install:: all
install -m 755 compilers/mpixlf2003-trace-bgp $(bindir)/mpixlf2003
install -m 755 compilers/mpixlf77-trace-bgp $(bindir)/mpixlf77
install -m 755 compilers/mpixlf90-trace-bgp $(bindir)/mpixlf90
install -m 755 $(srcdir)/darshan-pmpi-filter.sh $(bindir)
clean::
rm -f *.o *.a lib/*.o lib/*.a darshan-parser darshan-diff
......@@ -39,6 +39,7 @@ libdir=${exec_prefix}/lib
CP_WRAPPERS=@CP_WRAPPERS@
DARSHAN_LIB_PATH=@darshan_lib_path@
DARSHAN_BIN_PATH=@darshan_bin_path@
CP_ZLIB_LINK_FLAGS=@__CP_ZLIB_LINK_FLAGS@
#
......@@ -48,10 +49,10 @@ CP_ZLIB_LINK_FLAGS=@__CP_ZLIB_LINK_FLAGS@
CC=" /bgsys/drivers/V1R3M0_460_2008-081112P/ppc/gnu-linux/bin/powerpc-bgp-linux-gcc"
C_LINKPATH_SHL="-Wl,-rpath,"
WRAPPER_CFLAGS="-I/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/comm/sys/include"
WRAPPER_LDFLAGS="${CP_WRAPPERS}"
WRAPPER_LDFLAGS=""
MPILIBNAME="mpich.cnk"
PMPILIBNAME="pmpich.cnk"
MPI_OTHERLIBS=" -L/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/comm/sys/lib -Wl,-rpath,/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/comm/sys/lib -ldcmfcoll.cnk -ldcmf.cnk -lpthread -L/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/runtime/SPI -Wl,-rpath,/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/runtime/SPI -lSPI.cna -lrt -L${DARSHAN_LIB_PATH} -ldarshan-posix "
MPI_OTHERLIBS=" -L/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/comm/sys/lib -Wl,-rpath,/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/comm/sys/lib -ldcmfcoll.cnk -ldcmf.cnk -lpthread -L/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/runtime/SPI -Wl,-rpath,/bgsys/drivers/V1R3M0_460_2008-081112P/ppc/runtime/SPI -lSPI.cna -lrt "
NEEDSPLIB="no"
# MPIVERSION is the version of the MPICH2 library that mpicc is intended for
MPIVERSION="1.0.7"
......@@ -233,7 +234,16 @@ if [ "$linking" = yes ] ; then
# prepend the path for the shared libraries to the library list
mpilibs="$C_LINKPATH_SHL$libdir $mpilibs"
fi
$Show $CC "${allargs[@]}" -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CFLAGS $LDFLAGS -L$libdir $mpilibs $MPI_OTHERLIBS
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
$Show $CC "${allargs[@]}" -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CFLAGS ${CP_WRAPPERS} $LDFLAGS -L$libdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix
else
# it looks like the user wants to use another tool with PMPI; don't
# link in Darshan PMPI wrappers (disables Darshan)
$Show $CC "${allargs[@]}" -I$includedir $CFLAGS $LDFLAGS -L$libdir $mpilibs $MPI_OTHERLIBS
fi
rc=$?
else
$Show $CC "${allargs[@]}" -I$includedir $CFLAGS
......
......@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP HAVE_MPICC MPICC darshan_lib_path __CP_LOG_PATH __CP_ZLIB_LINK_FLAGS __CP_ZLIB_INCLUDE_FLAGS CP_WRAPPERS LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP HAVE_MPICC MPICC darshan_lib_path darshan_bin_path __CP_LOG_PATH __CP_ZLIB_LINK_FLAGS __CP_ZLIB_INCLUDE_FLAGS CP_WRAPPERS LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
......@@ -3381,14 +3381,17 @@ CP_WRAPPERS="-Wl,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-
if test "x$prefix" = xNONE; then
darshan_lib_path=$ac_default_prefix/lib
darshan_bin_path=$ac_default_prefix/bin
else
darshan_lib_path=$prefix/lib
darshan_bin_path=$prefix/bin
fi
echo "$as_me:$LINENO: checking for long int" >&5
echo $ECHO_N "checking for long int... $ECHO_C" >&6
if test "${ac_cv_type_long_int+set}" = set; then
......@@ -4443,6 +4446,7 @@ s,@EGREP@,$EGREP,;t t
s,@HAVE_MPICC@,$HAVE_MPICC,;t t
s,@MPICC@,$MPICC,;t t
s,@darshan_lib_path@,$darshan_lib_path,;t t
s,@darshan_bin_path@,$darshan_bin_path,;t t
s,@__CP_LOG_PATH@,$__CP_LOG_PATH,;t t
s,@__CP_ZLIB_LINK_FLAGS@,$__CP_ZLIB_LINK_FLAGS,;t t
s,@__CP_ZLIB_INCLUDE_FLAGS@,$__CP_ZLIB_INCLUDE_FLAGS,;t t
......
......@@ -87,10 +87,13 @@ CP_WRAPPERS="-Wl,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-
if test "x$prefix" = xNONE; then
darshan_lib_path=$ac_default_prefix/lib
darshan_bin_path=$ac_default_prefix/bin
else
darshan_lib_path=$prefix/lib
darshan_bin_path=$prefix/bin
fi
AC_SUBST(darshan_lib_path)
AC_SUBST(darshan_bin_path)
AC_SUBST(__CP_LOG_PATH)
AC_SUBST(__CP_ZLIB_LINK_FLAGS)
AC_SUBST(__CP_ZLIB_INCLUDE_FLAGS)
......
#!/bin/sh
#
# (C) 2009 by Argonne National Laboratory.
# See COPYRIGHT in top-level directory.
#
# This script greps through text to see if it contains a reference to any of
# the popular profiling libraries that use PMPI. Darshan will use this to
# detect the use of such libraries at compile time and disable the Darshan
# PMPI libraries.
# known libraries: fpmpi, mpe, tau, mpiP, hpct
grep -E \(fpmpi\)\|\(mpe\)\|\(tau\)\|\(TAU\)\|\(mpiP\)\|\(hpm\)\|\(mpitrace\)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment