diff --git a/env/CONTAINER.env b/env/CONTAINER.env new file mode 100755 index 0000000000..48014ab313 --- /dev/null +++ b/env/CONTAINER.env @@ -0,0 +1,39 @@ +#! /usr/bin/env bash + +if [[ $# -ne 1 ]]; then + + echo "Must specify an input argument to set runtime environment variables!" + echo "argument can be any one of the following:" + echo "atmanalrun atmensanalrun" + echo "aeroanlrun" + echo "anal sfcanl fcst post vrfy metp" + echo "eobs eupd ecen efcs epos" + echo "postsnd awips gempak" + exit 1 + +fi + +step=$1 + +export npe_node_max=40 +export launcher="mpirun" +export mpmd_opt="--multi-prog" + +# Configure MPI environment +export MPI_BUFS_PER_PROC=2048 +export MPI_BUFS_PER_HOST=2048 +export MPI_GROUP_MAX=256 +export MPI_MEMMAP_OFF=1 +export MP_STDOUTMODE="ORDERED" +export KMP_AFFINITY=scatter +export OMP_STACKSIZE=2048000 +export NTHSTACK=1024000000 + +ulimit -s unlimited +ulimit -a + + +if [ "${step}" = "ocnanalrun" ]; then + export NTHREADS_OCNANAL=1 + export APRUN_OCNANAL="${launcher} -n 2" +fi diff --git a/workflow/hosts.py b/workflow/hosts.py index 91925da71a..ee9510df9e 100644 --- a/workflow/hosts.py +++ b/workflow/hosts.py @@ -15,7 +15,7 @@ class Host: """ SUPPORTED_HOSTS = ['HERA', 'ORION', 'JET', - 'WCOSS2', 'S4'] + 'WCOSS2', 'S4', 'CONTAINER'] def __init__(self, host=None): @@ -32,6 +32,7 @@ def __init__(self, host=None): def detect(cls): machine = 'NOTFOUND' + container = os.getenv('SINGULARITY_NAME') if os.path.exists('/scratch1/NCEPDEV'): machine = 'HERA' @@ -43,6 +44,8 @@ def detect(cls): machine = 'WCOSS2' elif os.path.exists('/data/prod'): machine = 'S4' + elif container != None: + machine = 'CONTAINER' if machine not in Host.SUPPORTED_HOSTS: raise NotImplementedError(f'This machine is not a supported host.\n' + diff --git a/workflow/hosts/container.yaml b/workflow/hosts/container.yaml new file mode 100644 index 0000000000..3aab3df751 --- /dev/null +++ b/workflow/hosts/container.yaml @@ -0,0 +1,23 @@ +BASE_GIT: '' +DMPDIR: '/home/${USER}' +PACKAGEROOT: '' +COMROOT: '' +COMINsyn: '' +HOMEDIR: '/home/${USER}' +STMP: '/home/${USER}' +PTMP: '/home/${USER}' +NOSCRUB: $HOMEDIR +SCHEDULER: none +ACCOUNT: '' +QUEUE: '' +QUEUE_SERVICE: '' +PARTITION_BATCH: '' +PARTITION_SERVICE: '' +CHGRP_RSTPROD: 'YES' +CHGRP_CMD: 'chgrp rstprod' +HPSSARCH: 'NO' +LOCALARCH: 'NO' +ATARDIR: '${NOSCRUB}/archive_rotdir/${PSLOT}' +MAKE_NSSTBUFR: 'NO' +MAKE_ACFTBUFR: 'NO' +SUPPORTED_RESOLUTIONS: ['C96', 'C48']