[Dart-dev] DART/branches Revision: 13153

dart at ucar.edu dart at ucar.edu
Thu May 2 16:10:09 MDT 2019


thoar at ucar.edu
2019-05-02 16:10:08 -0600 (Thu, 02 May 2019)
167
Removing extraneous mpi-specific build mechanism.
mkmf_perturb_chem_icbc_CORR_RT_MA   can build both serial and parallel code
using the traditional DART methodology.




Modified: DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_PERT_CHEM/ICBC_PERT/work/mkmf_perturb_chem_icbc_CORR_RT_MA
===================================================================
--- DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_PERT_CHEM/ICBC_PERT/work/mkmf_perturb_chem_icbc_CORR_RT_MA	2019-05-02 21:31:27 UTC (rev 13152)
+++ DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_PERT_CHEM/ICBC_PERT/work/mkmf_perturb_chem_icbc_CORR_RT_MA	2019-05-02 22:10:08 UTC (rev 13153)
@@ -5,11 +5,60 @@
 # http://www.image.ucar.edu/DAReS/DART/DART_download
 #
 # DART $Id$
+#
+# usage: mkmf_filter [ -mpi | -nompi ]
+#
+# without any args, builds filter without mpi libraries, and it will run
+# as a normal executable. if -mpi is given, it will be compiled with the mpi
+# libraries and can run with multiple cooperating processes.
 
-     ../../../../../../mkmf/mkmf -p perturb_chem_icbc_CORR_RT_MA.exe \
- -t  ../../../../../../mkmf/mkmf.template \
- -a "../../../../../.." path_names_perturb_chem_icbc_CORR_RT_MA
+if ( $#argv > 0 ) then
+  if ("$argv[1]" == "-mpi") then
+    setenv usingmpi 1
+  else if ("$argv[1]" == "-nompi") then
+    setenv usingmpi 0
+  else
+    echo "Unrecognized argument to mkmf_filter: $argv[1]"
+    echo "Usage: mkmf_filter [ -mpi | -nompi ]"
+    echo " default is to generate a Makefile without MPI support."
+    exit -1
+  endif
+else
+  setenv usingmpi 0
+endif
 
+# make a backup copy of the path_names file, and then use
+# sed to make sure it includes either the non-mpi subroutines,
+# or the subroutines which really call mpi.
+
+set pathFile = path_names_perturb_chem_icbc_CORR_RT_MA
+
+cp -f ${pathFile} ${pathFile}.back 
+
+if ( $usingmpi ) then
+
+  echo "Makefile uses MPI version of code."
+  sed -e 's;/perturb_chem_icbc_CORR_RT_MA;/perturb_chem_icbc_CORR_RT_MA_MPI;' ${pathFile}.back >! ${pathFile}
+  setenv wrapper_arg -w
+  set EXENAME = perturb_chem_icbc_CORR_RT_MA_MPI.exe
+
+else
+
+  echo "Makefile uses serial version of code."
+  rm -f using_mpi_for_filter
+  sed -e 's;/perturb_chem_icbc_CORR_RT_MA_MPI;/perturb_chem_icbc_CORR_RT_MA;' ${pathFile}.back >! ${pathFile}
+  setenv wrapper_arg ""
+  set EXENAME = perturb_chem_icbc_CORR_RT_MA.exe
+
+endif
+
+# remove temp file and now really call mkmf to generate makefile
+rm -f ${pathFile}.back
+
+    ../../../../../../mkmf/mkmf -p ${EXENAME} \
+-t  ../../../../../../mkmf/mkmf.template \
+-a "../../../../../.." ${wrapper_arg} ${pathFile}
+
 exit $status
 
 # <next few lines under version control, do not edit>

Deleted: DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_PERT_CHEM/ICBC_PERT/work/mkmf_perturb_chem_icbc_CORR_RT_MA_MPI
===================================================================
--- DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_PERT_CHEM/ICBC_PERT/work/mkmf_perturb_chem_icbc_CORR_RT_MA_MPI	2019-05-02 21:31:27 UTC (rev 13152)
+++ DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_PERT_CHEM/ICBC_PERT/work/mkmf_perturb_chem_icbc_CORR_RT_MA_MPI	2019-05-02 22:10:08 UTC (rev 13153)
@@ -1,24 +0,0 @@
-#!/bin/csh
-#
-# DART software - Copyright UCAR. This open source software is provided
-# by UCAR, "as is", without charge, subject to all terms of use at
-# http://www.image.ucar.edu/DAReS/DART/DART_download
-#
-# $Id$
-
-cp -f path_names_perturb_chem_icbc_CORR_RT_MA_MPI path_names_perturb_chem_icbc_CORR_RT_MA_MPI.back
-
-sed -e 's;/null_mpi_util;/mpi_util;' path_names_perturb_chem_icbc_CORR_RT_MA_MPI.back >! path_names_perturb_chem_icbc_CORR_RT_MA_MPI
-setenv wrapper_arg -w
-rm -f path_names_perturb_chem_icbc_CORR_RT_MA_MPI.back
-
-../../../../../../mkmf/mkmf -p perturb_chem_icbc_CORR_RT_MA_MPI.exe -t ../../../../../../mkmf/mkmf.template \
- -a "../../../../../.." ${wrapper_arg} path_names_perturb_chem_icbc_CORR_RT_MA_MPI
-
-exit $status
-
-# <next few lines under version control, do not edit>
-# $URL$
-# $Revision$
-# $Date$
-

Deleted: DART/branches/mizzi/models/wrf_chem/run_scripts/RUN_PERT_CHEM/ICBC_PERT/work/path_names_perturb_chem_icbc_CORR_RT_MA_MPI
===================================================================


More information about the Dart-dev mailing list