From: Christian Heinrich Date: Fri, 1 Apr 2016 14:35:16 +0000 (+0200) Subject: [SMPI] Modified smpiff.in to enable caller location X-Git-Tag: v3_14~1202^2~10 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/18ea25fb70634e1cc6d53f080cccaf838bb9db61 [SMPI] Modified smpiff.in to enable caller location This injects pre-processor directives that are then used to replace MPI calls within the user code. --- diff --git a/src/smpi/smpiff.in b/src/smpi/smpiff.in index 90e01409a6..8b63bee120 100644 --- a/src/smpi/smpiff.in +++ b/src/smpi/smpiff.in @@ -16,7 +16,7 @@ CMAKE_LINKARGS="-L@libdir@" @SMPITOOLS_SH@ -list_set FFLAGS "-ff2c" "-fno-second-underscore" +list_set FFLAGS "-ff2c" "-fno-second-underscore" "-ffixed-line-length-none" "-cpp" list_set LINKARGS "-lsimgrid" "-lm" "-lgfortran" list_set TMPFILES main_name=main @@ -30,7 +30,9 @@ trap 'cleanup' EXIT filter_and_compile() { list_add TMPFILES "${TMPFILE}" #replace "program main_name by subroutine user\_main (and the end clause as well)" - sed 's/[[:space:]]\{6\}[[:space:]]*\(end \)\{0,1\}program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/ \1subroutine user_main /gI;s/[[:space:]]*use[[:space:]]*mpi/\include \"mpif\.h\" /gI' "${ARG}" > "${TMPFILE}" + echo "#include \"@includedir@/smpi/smpi_extended_traces_fortran.h\"" > ${TMPFILE} + echo "#line 1 \"${ARG}\"" >> ${TMPFILE} + sed 's/[[:space:]]\{6\}[[:space:]]*\(end \)\{0,1\}program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/ \1subroutine user_main /gI;s/[[:space:]]*use[[:space:]]*mpi/\include \"mpif\.h\" /gI' "${ARG}" >> "${TMPFILE}" SRCFILE="${TMPFILE}" list_add CMDLINE "${SRCFILE}" }