Skip to content
Snippets Groups Projects
Commit 9c168783 authored by Fabian.Jakub's avatar Fabian.Jakub
Browse files

first try to run through the icon install with a encapsulated spack

parent d1652911
No related branches found
No related tags found
1 merge request!3Refactor folder structure. Putting configuration files and namelists inside...
function spack_env() {
export SPACK_SETUP_ENV=spack/share/spack/setup-env.sh
export SPACK_VENV=spack_icon_env
export SPACK_USER_CACHE_PATH=${WORKDIR}/SPACK_USER_CACHE_PATH
export SPACK_DISABLE_LOCAL_CONFIG=true
}
function install_spack() {
spack_env
#TODO: Would be good to enable the re-utilization of existing spack packages (via packages.yaml or upstreams.yaml)
if [ ! -f ${SPACK_SETUP_ENV} ]; then
git clone ${SPACK_URL} -b ${SPACK_BRANCH}
fi
. ${SPACK_SETUP_ENV}
spack env create $SPACK_VENV
spack env activate -p $SPACK_VENV
spack compiler find
}
function load_spack() {
}
\ No newline at end of file
spack_env
if [ ! -f ${SPACK_SETUP_ENV} ]; then install_spack; fi
. ${SPACK_SETUP_ENV}
spack env activate -p $SPACK_VENV
}
......@@ -14,24 +14,28 @@ fi
# Go to the working directory
cd ${WORKDIR}
# Check if experiment's spack installation already exists, if it doesn't, clone it.
SPACK_ENV=spack/share/spack/setup-env.sh
if [ ! -f ${SPACK_ENV} ]; then
git clone ${SPACK_URL} -b ${SPACK_BRANCH}
#TODO: Would be good to enable the re-utilization of existing spack packages (via packages.yaml or upstreams.yaml)
fi
# Setup the environment
source ${SPACK_ENV}
. ${WORKDIR}/proj/platforms/common/spack_utils.sh
load_spack
if [ $(
spack find icon-nwp@${ICON_VERSION} &>/dev/null
echo $?
) -ne 0 ]; then
echo "Installing icon-nwp@${ICON_VERSION}."
# Compile openmpi with schedulers=slurm
spack install openmpi%${SPACK_COMPILER}+legacylaunchers schedulers=slurm
spack install icon-nwp@${ICON_VERSION}%${SPACK_COMPILER} ^openmpi%${SPACK_COMPILER}
if [[ $(spack compiler info ${SPACK_COMPILER}) ]]; then
echo "Found Compiler"
else
echo "could not find compiler, try to install it... this may take a while"
spack add ${SPACK_COMPILER}
spack install
spack compiler add $(spack location --install-dir $SPACK_COMPILER)
fi
spack add ucx%${SPACK_COMPILER}+dc+dm+ib_hw_tm+mlx5_dv+rc+rdmacm+thread_multiple+ud+verbs~cuda
spack add openmpi%${SPACK_COMPILER}+pmi+legacylaunchers~cuda schedulers=slurm fabrics=ucx
spack add icon-nwp@${ICON_VERSION}%${SPACK_COMPILER} ^openmpi%${SPACK_COMPILER}
spack install
else
echo "icon-nwp@${ICON_VERSION} already installed!"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment