Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
have smpiff work on temporary file copies
authorAugustin Degomme <degomme@idpann.imag.fr>
Tue, 16 Jul 2013 16:34:15 +0000 (18:34 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Tue, 16 Jul 2013 16:34:15 +0000 (18:34 +0200)
bad for debug, but allows -j flag to work with multiple targets using same file

src/smpi/smpiff.in

index b86184b..7fd89c8 100644 (file)
@@ -30,9 +30,11 @@ if [ -n "${SRCFILES}" ]
 then
    for SRCFILE in "${SRCFILES}"
    do
-      CFILE="${SRCFILE%.f}.c"
+      TMPFILE=$(mktemp -p .).f
+      cp ${SRCFILE} ${TMPFILE}
+      CFILE="${TMPFILE%.f}.c"
       #echo "$prefix/bin/smpif2c ${SRCFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE}"
-      $prefix/bin/smpif2c ${SRCFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE}
+      $prefix/bin/smpif2c ${TMPFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE} && rm ${TMPFILE}
    done
 else
    #echo "$prefix/bin/smpicc ${ARGS}"