Skip to content

Commit

Permalink
Fixed assignment of NNODES in the run_croco.bash file, and testing co…
Browse files Browse the repository at this point in the history
…nditional assignment in the actions workflow yml (#33)
  • Loading branch information
zachsa committed Apr 17, 2023
1 parent 8579dec commit ded2f69
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/run_algoa-bay-forecast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ jobs:
WORKDIR: ${{ needs.workdir.outputs.WORKDIR }}
MODEL_RUN_DATE: ${{ needs.envs.outputs.MODEL_RUN_DATE }}
SHA: sha-${{ github.sha }}
BRANCH_REF: ${{ needs.envs.outputs.BRANCH_REF }}
steps:
- name: Source ~/.bashrc (for NVM - required for non-interactive shells)
continue-on-error: true # Maybe Node.js exists anyway
Expand All @@ -205,8 +206,8 @@ jobs:
uses: nick-fields/retry@master
with:
timeout_minutes: 30 # Script is considered failed if this limit is reached
retry_wait_seconds: 10 # Wait 10 minutes and try again
max_attempts: 10
retry_wait_seconds: 300 # Wait 5 minutes and try again
max_attempts: ${{ if eq(env.BRANCH_REF, 'next') }}1{{ else }}5{{ endif }}
retry_on: any
warning_on_retry: true
shell: bash
Expand All @@ -230,8 +231,8 @@ jobs:
uses: nick-fields/retry@master
with:
timeout_minutes: 30 # Script is considered failed if this limit is reached
retry_wait_seconds: 10 # Wait 10 minutes and try again
max_attempts: 10
retry_wait_seconds: 300 # Wait 5 minutes and try again
max_attempts: ${{ if eq(env.BRANCH_REF, 'next') }}1{{ else }}5{{ endif }}
retry_on: any
warning_on_retry: true
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"arange",
"arcgis",
"asgeojson",
"AUTOTILING",
"autovacuum",
"backdata",
"BASEMAP",
Expand All @@ -31,6 +32,7 @@
"Cubehelix",
"DFFE",
"dirout",
"distrib",
"Dockerized",
"dtype",
"Egagasini",
Expand Down Expand Up @@ -78,6 +80,7 @@
"notistack",
"numpy",
"OISST",
"OPENMP",
"Parens",
"PGCONNECT",
"pgdata",
Expand Down
1 change: 1 addition & 0 deletions models/algoa-bay-forecast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Local development](#local-development)
- [Deployment](#deployment)
- [Server requirements](#server-requirements)
- [Server configuration](#server-configuration)
Expand Down
3 changes: 0 additions & 3 deletions models/algoa-bay-forecast/croco.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ ARG NP_XI=2
ENV NP_ETA=$NP_ETA
ENV NP_XI=$NP_XI

RUN NNODES=$(( $NP_XI * $NP_ETA )) \
&& export NNODES=$NNODES

RUN apt-get update \
&& apt-get install -y \
mpich \
Expand Down
6 changes: 3 additions & 3 deletions models/algoa-bay-forecast/croco/run-model/run_croco.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ TIME_prev=$3 # i.e. 20220606 set as env variable called RESTART_FILE_DATE in .y
HDAYS=5 # Fixed value in this context
FDAYS=5
NH_AVG=1 # The temporal average of the output file in hours edited to save every hour
NH_AVGSURF=1 # The temporal average of the output file (only surface variables) in hours
NDAYS=$((HDAYS + FDAYS))
NH_AVGSURF=1 # The temporal average of the output file (only surface variables) in hours
NDAYS=$((HDAYS + FDAYS))
INDIR=$(pwd) # where the croco_frcst.in file is stored, in the current setup it is in the same directory
MPI_NUM_PROCS=${NNODES:-4} # In the Docker environment, NNODES will always be set. The default is 4 when this file is used directly
MPI_NUM_PROCS=$(( ${NP_ETA:-2} * ${NP_XI:-2} ))
EXEDIR=$(pwd)
INPUTDIR=$RUNDIR/croco/forcing
SCRATCHDIR=$RUNDIR/croco/scratch
Expand Down

0 comments on commit ded2f69

Please sign in to comment.