From effb64ac06720f440ba217c88a80f8ce22c81314 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 15 Nov 2021 01:28:50 +0000 Subject: [PATCH 1/3] Modify structure of RUN_CMD_ --- ush/config_defaults.sh | 6 +++--- ush/setup.sh | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ush/config_defaults.sh b/ush/config_defaults.sh index ba3711f90..b0c5f1626 100644 --- a/ush/config_defaults.sh +++ b/ush/config_defaults.sh @@ -166,9 +166,9 @@ QUEUE_FCST="" # #----------------------------------------------------------------------- # -RUN_CMD_UTILS="mpirun -np 1" -RUN_CMD_FCST="mpirun -np \${PE_MEMBER01}" -RUN_CMD_POST="mpirun -np 1" +RUN_CMD_UTILS="" +RUN_CMD_FCST="" +RUN_CMD_POST="" # #----------------------------------------------------------------------- # diff --git a/ush/setup.sh b/ush/setup.sh index 1dcc748ab..700be3f0e 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -2380,6 +2380,18 @@ component if it is being used) are: # #----------------------------------------------------------------------- # +# Set up RUN_CMD for MACOS and LINUX +# +#----------------------------------------------------------------------- +# +if [ "$MACHINE" = "MACOS" ] && [ "$MACHINE" = "LINUX" ]; then + RUN_CMD_UTILS=${RUN_CMD_UTILS:-"mpirun -np 1"} + RUN_CMD_FCST=${RUN_CMD_FCST:-"mpirun -np ${PE_MEMBER01}"} + RUN_CMD_POST=${RUN_CMD_POST:-"mpirun -np 1"} +fi +# +#----------------------------------------------------------------------- +# # If the write-component is going to be used to write output files to # disk (i.e. if QUILTING is set to "TRUE"), make sure that the grid type # used by the write-component (WRTCMP_output_grid) is set to a valid value. @@ -2957,15 +2969,6 @@ fi # #----------------------------------------------------------------------- # -# Because RUN_CMD_FCST can include PE_MEMBER01 (and theoretically other -# variables calculated in this script), delete the first occurrence of it -# in the var_defns file, and write it again at the end. -# -#----------------------------------------------------------------------- -$SED -i '/^RUN_CMD_FCST=/d' $GLOBAL_VAR_DEFNS_FP -# -#----------------------------------------------------------------------- -# # Continue appending variable definitions to the variable definitions # file. # @@ -3064,7 +3067,7 @@ FVCOM_FILE="${FVCOM_FILE}" # NCORES_PER_NODE="${NCORES_PER_NODE}" PE_MEMBER01="${PE_MEMBER01}" -RUN_CMD_FCST=$(eval echo ${RUN_CMD_FCST}) +RUN_CMD_FCST="${RUN_CMD_FCST}" # #----------------------------------------------------------------------- # From 82bcdeecf2281870d964f77638453de1db2611bd Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 15 Nov 2021 01:36:50 +0000 Subject: [PATCH 2/3] Fix typo --- ush/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/setup.sh b/ush/setup.sh index 700be3f0e..35a571c43 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -2384,7 +2384,7 @@ component if it is being used) are: # #----------------------------------------------------------------------- # -if [ "$MACHINE" = "MACOS" ] && [ "$MACHINE" = "LINUX" ]; then +if [ "$MACHINE" = "MACOS" ] || [ "$MACHINE" = "LINUX" ]; then RUN_CMD_UTILS=${RUN_CMD_UTILS:-"mpirun -np 1"} RUN_CMD_FCST=${RUN_CMD_FCST:-"mpirun -np ${PE_MEMBER01}"} RUN_CMD_POST=${RUN_CMD_POST:-"mpirun -np 1"} From ec6f9669d9f3f63404f43275728e3ddf821fdb61 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Wed, 17 Nov 2021 19:03:23 +0000 Subject: [PATCH 3/3] move to easy fix --- ush/config_defaults.sh | 6 +++--- ush/setup.sh | 23 ++++++++++------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/ush/config_defaults.sh b/ush/config_defaults.sh index b0c5f1626..ba3711f90 100644 --- a/ush/config_defaults.sh +++ b/ush/config_defaults.sh @@ -166,9 +166,9 @@ QUEUE_FCST="" # #----------------------------------------------------------------------- # -RUN_CMD_UTILS="" -RUN_CMD_FCST="" -RUN_CMD_POST="" +RUN_CMD_UTILS="mpirun -np 1" +RUN_CMD_FCST="mpirun -np \${PE_MEMBER01}" +RUN_CMD_POST="mpirun -np 1" # #----------------------------------------------------------------------- # diff --git a/ush/setup.sh b/ush/setup.sh index 35a571c43..f00e3bf8d 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -2380,18 +2380,6 @@ component if it is being used) are: # #----------------------------------------------------------------------- # -# Set up RUN_CMD for MACOS and LINUX -# -#----------------------------------------------------------------------- -# -if [ "$MACHINE" = "MACOS" ] || [ "$MACHINE" = "LINUX" ]; then - RUN_CMD_UTILS=${RUN_CMD_UTILS:-"mpirun -np 1"} - RUN_CMD_FCST=${RUN_CMD_FCST:-"mpirun -np ${PE_MEMBER01}"} - RUN_CMD_POST=${RUN_CMD_POST:-"mpirun -np 1"} -fi -# -#----------------------------------------------------------------------- -# # If the write-component is going to be used to write output files to # disk (i.e. if QUILTING is set to "TRUE"), make sure that the grid type # used by the write-component (WRTCMP_output_grid) is set to a valid value. @@ -2969,6 +2957,15 @@ fi # #----------------------------------------------------------------------- # +# Because RUN_CMD_FCST can include PE_MEMBER01 (and theoretically other +# variables calculated in this script), delete the first occurrence of it +# in the var_defns file, and write it again at the end. +# +#----------------------------------------------------------------------- +$SED -i '/^RUN_CMD_FCST=/d' $GLOBAL_VAR_DEFNS_FP +# +#----------------------------------------------------------------------- +# # Continue appending variable definitions to the variable definitions # file. # @@ -3067,7 +3064,7 @@ FVCOM_FILE="${FVCOM_FILE}" # NCORES_PER_NODE="${NCORES_PER_NODE}" PE_MEMBER01="${PE_MEMBER01}" -RUN_CMD_FCST="${RUN_CMD_FCST}" +RUN_CMD_FCST="$(eval echo \'${RUN_CMD_FCST}\')" # #----------------------------------------------------------------------- #