From 7830672bb79647a4b1482ba918eff7d22f5d3f3b Mon Sep 17 00:00:00 2001 From: Abishek Gopal Date: Tue, 2 Mar 2021 11:47:56 -0600 Subject: [PATCH] adding support for TAMU Grace --- Config/config_postprocess.xml | 12 ++-- Machines/grace_modules | 27 +++++++ Machines/machine_postprocess.xml | 72 +++++++++++++++++++ Templates/batch_grace.tmpl | 15 ++++ cesm_utils/cesm_utils/create_postprocess | 16 ++++- .../ice/Config/config_diags_ice.xml | 6 +- .../ocn/Config/config_diags_ocn.xml | 8 +-- env_reqs.txt | 22 +++--- 8 files changed, 151 insertions(+), 27 deletions(-) create mode 100755 Machines/grace_modules create mode 100644 Templates/batch_grace.tmpl diff --git a/Config/config_postprocess.xml b/Config/config_postprocess.xml index d738d20..e49caa8 100644 --- a/Config/config_postprocess.xml +++ b/Config/config_postprocess.xml @@ -62,7 +62,7 @@ @@ -70,7 +70,7 @@ @@ -78,7 +78,7 @@ @@ -86,7 +86,7 @@ @@ -94,7 +94,7 @@ @@ -102,7 +102,7 @@ diff --git a/Machines/grace_modules b/Machines/grace_modules new file mode 100755 index 0000000..b642b75 --- /dev/null +++ b/Machines/grace_modules @@ -0,0 +1,27 @@ +#!/bin/bash -l + +echo "Loading modules for CESM_postprocessing tool..." + +module purge +ml intel/2019b +ml ANTLR +ml HDF5 +#ml NCL/6.6.2 +#ml NCO/4.7.9 +#ml netCDF/4.6.1 +ml Python/2.7.16 + +export NCARG_ROOT=/scratch/group/ihesp/software/share/ncl-6.6.2 +export NCO_PATH=/scratch/group/ihesp/software/share/nco-4.9.4/nco-4.9.7 +export NETCDF4_PATH=/scratch/group/ihesp/software/share/netcdf-c-4.7.4/install2019b_2 +export LD_LIBRARY_PATH=$NCARG_ROOT/lib:$NCO_PATH/lib:$NETCDF4_PATH/lib:$LD_LIBRARY_PATH +export PATH=$NCARG_ROOT/bin:$NCO_PATH/bin:$NETCDF4_PATH/bin:$PATH + + +#source /ihesp/user/agopal/CESM_postprocessing/cesm-env2/bin/activate +#export PYTHONPATH=/ihesp/user/agopal/CESM_postprocessing/pynio/site-packages:$PYTHONPATH +#export PYTHONPATH=/ihesp/user/agopal/CESM_postprocessing/pynio/build/lib.linux-x86_64-2.7/PyNIO:$PYTHONPATH +#export PYTHONPATH=/ihesp/user/agopal/CESM_postprocessing/cesm-env2/lib/python2.7/site-packages/PyNIO:$PYTHONPATH +#export PYNIOPATH=/ihesp/user/agopal/CESM_postprocessing/pynio/site-packages/PyNIO + + diff --git a/Machines/machine_postprocess.xml b/Machines/machine_postprocess.xml index 1670cc0..858aa72 100644 --- a/Machines/machine_postprocess.xml +++ b/Machines/machine_postprocess.xml @@ -2,6 +2,78 @@ + + 3 + 3 + 3 + mpirun + + f2py + + gfortran + -c -g -O2 + -I/scratch/group/ihesp/software/share/netcdf-c-4.7.4/install2019b_2/include -I/scratch/group/ihesp/software/share/netcdf-fortran-4.5.3/install2019b_2/include + -L/scratch/group/ihesp/software/share/netcdf-c-4.7.4/install2019b_2/lib -L/scratch/group/ihesp/software/share/netcdf-fortran-4.5.3/install2019b_2/lib -lnetcdff -L/sw/eb/sw/GCCcore/8.3.0/lib64 -L/sw/eb/sw/GCCcore/8.3.0/lib -L/sw/eb/sw/OpenBLAS/0.3.7-GCC-8.3.0/lib -L/sw/eb/sw/ScaLAPACK/2.0.2-gompi-2019b/lib64 -L/sw/eb/sw/FFTW/3.3.8-intel-2019b/lib -lnetcdf -lm -lpthread + + + module purge + + + module load intel/2019b + module load ANTLR + module load HDF5 + module load GSL/2.6 + module load Python/2.7.16 + export NCARG_ROOT=/scratch/group/ihesp/software/share/ncl-6.6.2 + export NCO_PATH=/scratch/group/ihesp/software/share/nco-4.9.4/nco-4.9.7/install + export NETCDF4_PATH=/scratch/group/ihesp/software/share/netcdf-c-4.7.4/install2019b_2 + export LD_LIBRARY_PATH=$NCARG_ROOT/lib:$NCO_PATH/lib:$NETCDF4_PATH/lib:$LD_LIBRARY_PATH + export PATH=$NCARG_ROOT/bin:$NCO_PATH/bin:$NETCDF4_PATH/bin:$PATH + export PYTHONPATH=/scratch/group/iheso/software/CESM_postprocessing/cesm-env2/lib/python2.7/site-packages/PyNIO:$PYTHONPATH + + + + + 12 + 12 + 12 + /scratch/group/ihesp/obs_root/amwg/amwg_data + + + 12 + 12 + /scratch/group/ihesp/obs_root/pcwg/ice/data + + + 12 + 12 + 12 + /scratch/group/ihesp/obs_root/lnd_diag_data + + + 12 + 10 + /scratch/group/ihesp/obs_root + + + 3 + 3 + /glade/p/cesm/lmwg_dev/oleson/ILAMB/ILAMB_all + + + 3 + 3 + /glade/p/cesm/omwg/obs_data/IOMB + + + + + 64 64 diff --git a/Templates/batch_grace.tmpl b/Templates/batch_grace.tmpl new file mode 100644 index 0000000..fd7b59e --- /dev/null +++ b/Templates/batch_grace.tmpl @@ -0,0 +1,15 @@ +#! /bin/bash -l + +#SBATCH -n {{ pes }} +#SBATCH -N {{ nodes }} +#SBATCH --ntasks-per-node={{ ppn }} +#SBATCH -t {{ wallclock }} +#SBATCH -p medium +#SBATCH -J {{ processName }} +#SBATCH -A {{ project }} +#SBATCH --mem {{ memory }} +#SBATCH -m block +#SBATCH --mail-type=end # send email when job ends +#SBATCH --mail-type=fail # send email if job fails +#SBATCH --mail-user=agopal@tamu.edu + diff --git a/cesm_utils/cesm_utils/create_postprocess b/cesm_utils/cesm_utils/create_postprocess index 4bcfabb..4ec67b2 100755 --- a/cesm_utils/cesm_utils/create_postprocess +++ b/cesm_utils/cesm_utils/create_postprocess @@ -117,7 +117,7 @@ def commandline_options(): help='show exception backtraces as extra debugging output') parser.add_argument('-debug', '--debug', nargs=1, required=False, type=int, default=0, - help='debugging verbosity level output: 0 = none, 1 = minimum, 2 = maximum. 0 is default') + help='debugging verbosity level output: 0 = none, 1 = minimum, 2 = maximum. 2 is default') parser.add_argument('-caseroot', '--caseroot', nargs=1, required=True, help='fully quailfied path to case root directory (required)') @@ -131,6 +131,9 @@ def commandline_options(): parser.add_argument('-username', '--username', nargs=1, required=False, help='User name (optional). Defaults to user login name.') + parser.add_argument('-machine', '--machine', nargs=1, required=False, + help='Machine name (optional). Defaults to grace') + parser.add_argument('-add-dav', '--add-dav', dest='add_dav', nargs=1, required=False, help='Fully qualified path to the root of the CESM postprocessing ' \ 'virtualenv for the NCAR DAV cluster. This option sets the XML ' \ @@ -471,7 +474,7 @@ def create_batch(ppDir, pes, batchTmpl, runTmpl, postProcessCmd, mpiCmd, outFile if not rc: raise OSError(err_msg) - debug = '--debug 0' + debug = '--debug 2' if options.debug: debug = '--debug {0}'.format(options.debug[0]) @@ -597,6 +600,11 @@ def initialize_main(envDict, options, standalone): if options.cesmtag: envDict['CESM_TAG'] = options.cesmtag[0] + # set the project code + envDict['MACH_TMP'] = os.getenv('MACH') + if options.machine: + envDict['MACH_TMP'] = options.machine[0] + # set the project code envDict['PROJECT'] = os.getenv('PROJECT') if options.project: @@ -650,7 +658,9 @@ def main(options): envDict['PP_CASE_PATH'] = os.path.abspath(pp_case_path) # get the machine name from the hostname - hostname = cesmEnvLib.get_hostname() + #hostname = cesmEnvLib.get_hostname() + hostname = envDict['MACH_TMP'] + print hostname envDict['MACH'] = cesmEnvLib.get_machine_name(hostname, '{0}/Machines/machine_postprocess.xml'.format(envDict['POSTPROCESS_PATH'])) # check for undefined machine diff --git a/diagnostics/diagnostics/ice/Config/config_diags_ice.xml b/diagnostics/diagnostics/ice/Config/config_diags_ice.xml index 23619e8..6c647b0 100644 --- a/diagnostics/diagnostics/ice/Config/config_diags_ice.xml +++ b/diagnostics/diagnostics/ice/Config/config_diags_ice.xml @@ -262,7 +262,7 @@ Applies to both model and control cases." @@ -346,7 +346,7 @@ Applies to both model and control cases." @@ -354,7 +354,7 @@ Applies to both model and control cases." diff --git a/diagnostics/diagnostics/ocn/Config/config_diags_ocn.xml b/diagnostics/diagnostics/ocn/Config/config_diags_ocn.xml index 5f9b83c..0176274 100644 --- a/diagnostics/diagnostics/ocn/Config/config_diags_ocn.xml +++ b/diagnostics/diagnostics/ocn/Config/config_diags_ocn.xml @@ -200,7 +200,7 @@ Applies to both model and control cases." @@ -232,7 +232,7 @@ Applies to both model and control cases." @@ -240,7 +240,7 @@ Applies to both model and control cases." @@ -304,7 +304,7 @@ Applies to both model and control cases." diff --git a/env_reqs.txt b/env_reqs.txt index 8784a0a..d80d47c 100644 --- a/env_reqs.txt +++ b/env_reqs.txt @@ -1,11 +1,11 @@ -Cython -scipy -numpy -pandas -netCDF4 -mpi4py -cf_units -cftime -matplotlib -Jinja2 -sympy +Cython==0.29.21 +scipy==1.2.3 +numpy==1.16.6 +pandas==0.24.2 +netCDF4==1.5.4 +mpi4py==3.0.3 +cf_units==2.1.4 +cftime==1.2.1 +matplotlib==2.2.5 +Jinja2==2.11.2 +sympy==1.5.1