Skip to content

Commit 608e47d

Browse files
committed
Use CMake to determine MPI Stack
1 parent ed8fbb2 commit 608e47d

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

scripts/fv3_setup

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -162,26 +162,8 @@ endif
162162
# Test for Compiler and MPI Setup
163163
#######################################################################
164164

165-
setenv BASEDIR `awk '{print $2}' $ETCDIR/BASEDIR.rc`
166-
167-
if ( `echo $BASEDIR | grep -i mvapich2` != '') then
168-
set MPI = mvapich2
169-
else if ( `echo $BASEDIR | grep -i mpich` != '') then
170-
set MPI = mpich
171-
else if ( `echo $BASEDIR | grep -i openmpi` != '') then
172-
set MPI = openmpi
173-
else if ( `echo $BASEDIR | grep -i hpcx` != '') then
174-
set MPI = openmpi
175-
else if ( `echo $BASEDIR | grep -i impi` != '') then
176-
set MPI = intelmpi
177-
else if ( `echo $BASEDIR | grep -i intelmpi` != '') then
178-
set MPI = intelmpi
179-
else if ( `echo $BASEDIR | grep -i mpt` != '') then
180-
set MPI = mpt
181-
else
182-
# Assume default is Intel MPI in case of older baselibs
183-
set MPI = intelmpi
184-
endif
165+
# Get MPI stack from CMake
166+
set MPI_STACK = @MPI_STACK@
185167

186168
#######################################################################
187169
# Enter Experiment Specific Run Parameters
@@ -717,7 +699,7 @@ echo $GROUP > $HOME/.GROUProot
717699

718700
/bin/rm -f $EXPDIR/SETENV.commands
719701

720-
if( $MPI == openmpi ) then
702+
if( $MPI_STACK == openmpi ) then
721703

722704
# This turns off an annoying warning when running
723705
# Open MPI on a system where TMPDIRs are on a networked
@@ -730,7 +712,7 @@ EOF
730712
# The below settings seem to be recommended for hybrid
731713
# systems using MVAPICH2 but could change
732714

733-
else if( $MPI == mvapich ) then
715+
else if( $MPI_STACK == mvapich ) then
734716

735717
cat > $EXPDIR/SETENV.commands << EOF
736718
setenv MV2_ENABLE_AFFINITY 0
@@ -739,7 +721,7 @@ cat > $EXPDIR/SETENV.commands << EOF
739721
setenv MV2_GATHERV_SSEND_THRESHOLD 256
740722
EOF
741723

742-
else if( $MPI == mpt ) then
724+
else if( $MPI_STACK == mpt ) then
743725

744726
cat > $EXPDIR/SETENV.commands << EOF
745727
@@ -768,7 +750,7 @@ cat > $EXPDIR/SETENV.commands << EOF
768750
769751
EOF
770752

771-
else if( $MPI == intelmpi ) then
753+
else if( $MPI_STACK == intelmpi ) then
772754

773755
cat > $EXPDIR/SETENV.commands << EOF
774756
#setenv MPS_STAT_LEVEL 4

0 commit comments

Comments
 (0)