Skip to content

Commit

Permalink
Add ecwam-bundle to main repo (#3)
Browse files Browse the repository at this point in the history
* Added source/* to gitignore

* Add arch files for Intel compilers ATOS

* Add arch files for m1mac

* Added ecwam-bundle

* Updated README with bundle instructions

* Deleted apple arch

* Removed IFS checks from env.sh

* Moved bundle files to package/bundle
  • Loading branch information
awnawab authored Aug 22, 2023
1 parent 6cfa424 commit 8a63bf9
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ doc/latex
.nfs*
build/*
install/*
env.sh
source/*
ecbundle
/env.sh
*.DS_Store
.vscode
*.mod
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@ Optionally, tests can be run to check succesful compilation, when the feature TE
### Generate derived-types data structures
The derived-types storing grid-point data in ecWam can be configured in `src/ecwam/yowfield_mod_config.yaml`. If the fypp preprocessor and Python + pyyaml are found, then the configuration file is used to expand the accompanying `src/ecwam/yowfield_mod.fypp` into Fortran derived-type objects. The glue-code required to turn the derived-types members into FIELD API objects is also generated. If fypp and pyyaml are not found, then the existing `src/ecwam/yowfield_mod.F90` is used. Generation of the derived-type data structures can be disabled by passing the following build time option: `-DENABLE_GEN_DERIV_TYPES=OFF`.

## Build using ecWAM bundle

Another way of building ecWAM is to use the bundle definition included in `package/bundle`:

$ ./package/bundle/ecwam-bundle create --bundle package/bundle/bundle.yml # Checks out dependency packages
$ ./package/bundle/ecwam-bundle build [--build-type=<build-type>] [--arch=<path-to-arch>] [--option]

The bundle also facilitates setting environment variables and compiler flags relevant to certain architectures by specifying the corresponding arch file at the build step. For example, to build on the ECMWF Atos system using Intel compilers and the hpcx-openmpi `MPI` library:

`--arch=package/bundle/arch/ecmwf/hpc2020/intel/2021.4.0/hpcx-openmpi/2.9.0`

The following options can also be configured during the bundle build step:
- `--without-mpi` - Disable MPI
- `--without-omp` - Disable OpenMP
- `--with-field_api` - Build using FIELD_API repo in `source/field_api`

Finally, additional `CMake` options can also be set during the bundle build step:

`--cmake-"OPTION=<arg>"`

Running ecWAM
=============

Expand Down
44 changes: 44 additions & 0 deletions package/bundle/arch/ecmwf/hpc2020/default/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Source me to get the correct configure/build/run environment

# Store tracing and disable (module is *way* too verbose)
{ tracing_=${-//[^x]/}; set +x; } 2>/dev/null

module_load() {
echo "+ module load $*"
module load $*
}
module_unload() {
echo "+ module unload $*"
module unload $*
}
module_purge() {
echo "+ module purge"
module purge
}

# Unload all modules to be certain
module_purge

# Load modules
module_load prgenv/intel
module_load intel/2021.4.0
module_load hpcx-openmpi/2.9.0
module_load intel-mkl/19.0.5
module_load fftw/3.3.9
module_load netcdf4/4.7.4
module_load hdf5/1.10.6
module_load eigen/3.3.7
module_load cmake/3.20.2
module_load ninja/1.10.0
module_load fcm/2019.05.0
module_load aec/1.0.4

# Setting required for bit reproducibility with Intel MKL:
export MKL_CBWR=AUTO,STRICT

# Record the RPATH in the executable
export LD_RUN_PATH=$LD_LIBRARY_PATH

# Restore tracing to stored setting
{ if [[ -n "$tracing_" ]]; then set -x; else set +x; fi } 2>/dev/null

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Source me to get the correct configure/build/run environment

# Store tracing and disable (module is *way* too verbose)
{ tracing_=${-//[^x]/}; set +x; } 2>/dev/null

module_load() {
echo "+ module load $*"
module load $*
}
module_unload() {
echo "+ module unload $*"
module unload $*
}
module_purge() {
echo "+ module purge"
module purge
}

# Unload all modules to be certain
module_purge

# Load modules
module_load prgenv/intel
module_load intel/2021.4.0
module_load hpcx-openmpi/2.9.0
module_load intel-mkl/19.0.5
module_load fftw/3.3.9
module_load netcdf4/4.7.4
module_load hdf5/1.10.6
module_load eigen/3.3.7
module_load cmake/3.20.2
module_load ninja/1.10.0
module_load fcm/2019.05.0
module_load aec/1.0.4

# Setting required for bit reproducibility with Intel MKL:
export MKL_CBWR=AUTO,STRICT

# Record the RPATH in the executable
export LD_RUN_PATH=$LD_LIBRARY_PATH

# Restore tracing to stored setting
{ if [[ -n "$tracing_" ]]; then set -x; else set +x; fi } 2>/dev/null

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Source me to get the correct configure/build/run environment

# Store tracing and disable (module is *way* too verbose)
{ tracing_=${-//[^x]/}; set +x; } 2>/dev/null

module_load() {
echo "+ module load $*"
module load $*
}
module_unload() {
echo "+ module unload $*"
module unload $*
}
module_purge() {
echo "+ module purge"
module purge
}

# Unload all modules to be certain
module_purge

# Load modules
module_load prgenv/intel
module_load intel/2021.4.0
module_load intel-mpi/2021.4.0
module_load intel-mkl/19.0.5
module_load fftw/3.3.9
module_load netcdf4/4.7.4
module_load hdf5/1.10.6
module_load eigen/3.3.7
module_load cmake/3.20.2
module_load ninja/1.10.0
module_load fcm/2019.05.0
module_load aec/1.0.4

# Setting required for bit reproducibility with Intel MKL:
export MKL_CBWR=AUTO,STRICT

# Record the RPATH in the executable
export LD_RUN_PATH=$LD_LIBRARY_PATH

# Restore tracing to stored setting
{ if [[ -n "$tracing_" ]]; then set -x; else set +x; fi } 2>/dev/null

53 changes: 53 additions & 0 deletions package/bundle/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
### Bundle

name : ecwam-bundle
version : 0.0.0
cmake : CMAKE_LINK_DEPENDS_NO_SHARED=ON
ENABLE_OMP=ON


projects :

- ecbuild :
git : https://github.com/ecmwf/ecbuild
version : master
bundle : false

- eccodes :
git : https://github.com/ecmwf/eccodes
version : master
cmake : ENABLE_MEMFS=ON

- fiat :
git : https://github.com/ecmwf-ifs/fiat
version : main

- field_api :
git : ${BITBUCKET}/RDX/field_api
version : master
optional: true
cmake : >
BUILD_field_api=OFF
ENABLE_CUDA=OFF
ENABLE_FIELD_API_TESTS=OFF
- ecwam :
dir : $PWD
version : main
require : fiat

options :

- without-mpi :
help : Disable MPI
cmake : ENABLE_MPI=OFF

- without-omp :
help : Disable OpenMP
cmake : ENABLE_OMP=OFF

- with-field_api :
help : Enable FIELD_API
cmake : BUILD_field_api=ON

23 changes: 23 additions & 0 deletions package/bundle/ecwam-bundle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# BOOTSTRAP ecbundle-build or ecbundle-create,
# and pass arguments to it.

ecbundle_VERSION=develop

BUNDLE_DIR="$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd -P )"

# Download ecbundle scripts if not already available
command_exists () { type "$1" &> /dev/null ; }
if ! command_exists ecbundle ; then
if [[ ! -d ${BUNDLE_DIR}/ecbundle ]]; then
git clone https://github.com/ecmwf/ecbundle ${BUNDLE_DIR}/ecbundle
( cd ${BUNDLE_DIR}/ecbundle && git checkout ${ecbundle_VERSION} )
fi
export PATH=${BUNDLE_DIR}/ecbundle/bin:${PATH}
fi

{ module unload python3; module load python3; } 2>/dev/null

set -e
ecbundle "$@"

0 comments on commit 8a63bf9

Please sign in to comment.