From b646589996f8636f4bacb984195d263e9dca43ef Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 28 Apr 2011 16:26:00 +0200 Subject: [PATCH] COMP: add sentinels to catch mpi or scotch version changes when compiling --- src/Pstream/Allwmake | 29 +++++++++++++++++++--- src/parallel/decompose/Allwmake | 43 +++++++++++++++++++++++++-------- 2 files changed, 58 insertions(+), 14 deletions(-) diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake index 613263d7bc..50ccb5fe1d 100755 --- a/src/Pstream/Allwmake +++ b/src/Pstream/Allwmake @@ -1,8 +1,31 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} -set -x + +# +# define how to create an mpi-versioned library of $makeType +# compile into qualified directory +# use sentinel file to handle version changes +# +wmakeMpiLib() +{ + set +x + for libName + do + ( + WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" + whichmpi="$libName/Make/$WM_OPTIONS/using:$FOAM_MPI" + [ -e "$whichmpi" ] || wclean $libName + echo "wmake $makeType $libName" + wmake $makeType $libName + touch "$whichmpi" + ) + done + set -x +} + +set -x wmake $makeType dummy case "$WM_MPLIB" in @@ -11,9 +34,7 @@ case "$WM_MPLIB" in echo echo "Note: ignore spurious warnings about missing mpicxx.h headers" echo - set -x - # force compilation into qualified directory - WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake $makeType mpi + wmakeMpiLib mpi ;; #GAMMA) diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index 38898b1ea3..cded295a7e 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -3,8 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} # get SCOTCH_VERSION, SCOTCH_ARCH_PATH -settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc` -if [ -f "$settings" ] +if settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc` then . $settings echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" @@ -13,21 +12,45 @@ else echo "Error: no apps/scotch/bashrc settings" echo fi + + +# +# define how to create an mpi-versioned library of $makeType +# compile into qualified directory +# use sentinel file to handle version changes +# +wmakeMpiLib() +{ + set +x + for libName + do + ( + WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" + whichmpi="$libName/Make/$WM_OPTIONS/using:$FOAM_MPI" + whichscotch="$libName/Make/$WM_OPTIONS/using:$SCOTCH_VERSION" + [ -e "$whichmpi" -a -e "$whichscotch" ] || wclean $libName + echo "wmake $makeType $libName" + wmake $makeType $libName + touch "$whichmpi" "$whichscotch" + ) + done + set -x +} + set -x wmakeLnInclude decompositionMethods -wmake $makeType scotchDecomp - -if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] +if [ -n "$SCOTCH_ARCH_PATH" ] then -( - WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB - wmake $makeType ptscotchDecomp -) + wmake $makeType scotchDecomp + [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] && wmakeMpiLib ptscotchDecomp +else + echo + echo "Skipping scotchDecomp (ptscotchDecomp)" + echo fi wmake $makeType decompositionMethods - # ----------------------------------------------------------------- end-of-file