-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
592cbe6
commit a46a62d
Showing
11 changed files
with
259 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# JOPA Container | ||
|
||
Contains the dependencies required to build mo-bundle and run JOPA | ||
|
||
https://github.com/MetOffice/mo-bundle | ||
|
||
# Building JOPA / mo-bundle | ||
|
||
## NCI, with a container | ||
|
||
1. Load the container | ||
|
||
``` | ||
module use /g/data/access/ngm | ||
module load envs/jopa | ||
``` | ||
|
||
2. Build Jopa inside the container | ||
|
||
``` | ||
cd mo-bundle | ||
imagerun cmake --preset=bom-container --workflow | ||
``` | ||
|
||
## Met Office VDI, no container | ||
|
||
1. Install Spack, and activate with `$SPACK/share/spack/setup-env.sh` | ||
|
||
2. Copy `configs/meto_vdi/*` to the Spack configuration directory (e.g. `~/.spack` or `$SPACK/etc/spack`) | ||
|
||
3. Install and setup a compiler, e.g. GCC 9 | ||
|
||
``` | ||
spack install gcc@9 | ||
spack compiler find $(spack find --format='{prefix}' gcc@9) | ||
``` | ||
|
||
4. Install the environment with GCC and MPICH | ||
|
||
``` | ||
export SPACK_COMPILER="gcc@9" | ||
export SPACK_MPI="mpich +slurm" | ||
srun -q -n1 -c10 --mem=40G --time=120 env -u SLURM_NODELIST ./bin/install.sh jopa-v0 | ||
``` | ||
|
||
5. Activate the environment | ||
|
||
``` | ||
spack load $SPACK_COMPILER | ||
spack env activate jopa-v0 | ||
export SPACK_ENV_VIEW=$SPACK_ENV/.spack-env/view | ||
``` | ||
|
||
6. Build mo-bundle | ||
|
||
``` | ||
cd mo-bundle | ||
cmake --preset=bom-container --workflow | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
export CPATH="$SPACK_VIEW/include_r8:${CPATH:-}" | ||
export LIBRARY_PATH="$SPACK_VIEW/lib64:$SPACK_VIEW/lib:${LIBRARY_PATH:-}" | ||
export LD_LIBRARY_PATH="$SPACK_VIEW/lib64:$SPACK_VIEW/lib:${LD_LIBRARY_PATH:-}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
set -o pipefail | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "$(readlink -f ${BASH_SOURCE[0]})" )" &> /dev/null && pwd ) | ||
|
||
# Add FMS | ||
echo "CPATH=$(spack find --format '{prefix}' fms)/include_r4:\$CPATH" >> $SPACK_ROOT/bin/activate-full.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
spack: | ||
specs: | ||
- eckit@1.24.4 compression=lz4 | ||
- ecmwf-atlas@0.35.0 +fckit +trans +tesselation +fftw | ||
- fckit@0.11.0 | ||
- ectrans@1.2.0 +fftw | ||
- fiat | ||
- odc | ||
|
||
- openblas | ||
- boost | ||
- cmake | ||
- ecbuild | ||
- eigen | ||
- git-lfs | ||
- gsl-lite | ||
- jedi-cmake | ||
- lapack | ||
- netcdf-c | ||
- netcdf-cxx4 | ||
- netcdf-fortran | ||
- ninja | ||
- nlohmann-json-schema-validator | ||
- nlohmann-json@3.10 | ||
- py-pybind11 | ||
- shumlib | ||
- udunits | ||
- zstd | ||
- fms@2023.04 precision=32,64 +deprecated_io +pic | ||
- nccmp | ||
- py-pycodestyle | ||
- parallel-netcdf | ||
- parallelio | ||
- bufr | ||
|
||
packages: | ||
git-lfs: | ||
require: '%gcc' | ||
go: | ||
require: '%gcc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class Shumlib(MakefilePackage): | ||
homepage = "https://code.metoffice.gov.uk/trac/utils/wiki/shumlib" | ||
parallel = False | ||
|
||
url = "https://github.com/metomi/shumlib/archive/refs/tags/um13.0.tar.gz" | ||
|
||
version( | ||
"um13.0", | ||
sha256="50f43a2f8980e8fbeafd053376612503bcb17c34948297f19b2c95ce0642b340", | ||
url="https://github.com/metomi/shumlib/archive/refs/tags/um13.0.tar.gz", | ||
) | ||
|
||
def edit(self, spec, prefix): | ||
env["PLATFORM"] = "spack" | ||
env["FPP"] = "cpp" | ||
env[ | ||
"FPPFLAGS" | ||
] = "-C -P -undef -nostdinc -DEVAL_NAN_BY_BITS -DEVAL_DENORMAL_BY_BITS" | ||
env["FCFLAGS_OPENMP"] = "-fopenmp" | ||
env["FCFLAGS_PIC"] = "-fPIC" | ||
env["FCFLAGS_SHARED"] = "-shared" | ||
env["CCFLAGS_OPENMP"] = "-fopenmp" | ||
env["CCFLAGS_PIC"] = "-fPIC" | ||
env["AR"] = "ar -rc" | ||
|
||
env["DIR_ROOT"] = self.stage.source_path | ||
env["LIBDIR_OUT"] = prefix | ||
env["SHUM_USE_C_OPENMP_VIA_THREAD_UTILS"] = "false" | ||
|
||
def install(self, spec, prefix): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
set -o pipefail | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "$(readlink -f "${BASH_SOURCE[0]}")" )" &> /dev/null && pwd ) | ||
|
||
|
||
cat <<EOF | ||
Running jopa test in $BASEDIR | ||
EOF | ||
|
||
pushd "$BASEDIR" | ||
|
||
export jedi_cmake_ROOT=$(envrun spack find --format '{prefix}' jedi-cmake) | ||
|
||
if [[ "${TEST_STAGE:-}" != "two" ]]; then | ||
# Download sources | ||
|
||
if [[ ! -d "$BASEDIR/jedi-bundle" ]]; then | ||
envrun git clone -b 8.0.0 https://github.com/JCSDA/jedi-bundle | ||
fi | ||
|
||
#sed -i jedi-bundle/CMakeLists.txt -e '/mom6/D' | ||
#sed -i jedi-bundle/CMakeLists.txt -e '/soca/s/UPDATE )/UPDATE RECURSIVE )/' | ||
|
||
mkdir -p build | ||
pushd build | ||
|
||
|
||
# Download bundle packages | ||
envrun ecbuild -- ../jedi-bundle | ||
|
||
# Fixup FMS linking | ||
sed -i ../jedi-bundle/mom6/CMakeLists.txt \ | ||
-e 's/target_link_libraries(\(.*\) fms)/target_link_libraries(\1 FMS::fms_r8)/' | ||
sed -i ../jedi-bundle/fv3-jedi-lm/src/CMakeLists.txt \ | ||
-e 's/list( APPEND FV3JEDILM_LIB_DEP fms )/list( APPEND FV3JEDILM_LIB_DEP FMS::fms_r8 )/' | ||
sed -i ../jedi-bundle/fv3/model/fv_control.F90 \ | ||
-e 's/,\s*INPUT_STR_LENGTH//' | ||
sed -i ../jedi-bundle/fv3/CMakeLists.txt \ | ||
-e 's/PUBLIC_LIBS\s\+fms/PUBLIC_LIBS FMS::fms_r8/' | ||
sed -i ../jedi-bundle/soca/src/soca/CMakeLists.txt \ | ||
-e 's/target_link_libraries(\(.*\) fms\s*)/target_link_libraries(\1 FMS::fms_r8)/' | ||
|
||
# Reprocess after patches | ||
# envrun ecbuild -- ../jedi-bundle | ||
|
||
popd | ||
fi | ||
|
||
|
||
if [[ "${TEST_STAGE:-}" != "one" ]]; then | ||
pushd build | ||
|
||
# Build package | ||
envrun make VERBOSE=1 -j ${PBS_NCPUS:-4} | ||
|
||
popd | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters