Cleanup old platform specific module loading code

Cleanup module loading code for decommisioned systems.
Further, merge the actual loading of modules into single line as a workaround
to prevent an issue with lmod's automatic reloading of module dependencies.
This might not fix all reltated issues.
This commit is contained in:
Christoph Niethammer 2022-11-02 15:44:17 +00:00
parent 7940dde4b9
commit 6335b47a65

92
sit
View file

@ -2,12 +2,15 @@
#
# Install script inspired by the ebuild system of Gentoo Linux
#
# Copyright (c) 2011-2018 Christoph Niethammer <niethammer@hlrs.de>
# Copyright (c) 2011-2022 Christoph Niethammer <niethammer@hlrs.de>
#
set -e
#set -x
#source colors.sh
#echo -e "${RED}DEBUGME: $MPI_VERSION${ENDCOLOR}"
function show_help() {
echo "Usage: $0 [options] [action] <sit package name>"
echo "Options:"
@ -115,48 +118,30 @@ else
fi
if [ "$COMPILER" == "system" ] ; then
echo "Using system default compiler"
COMPILER="" # prevent any compiler specs in the prefix
else
sit_info_verbose "COMPILER: $COMPILER"
sit_info_verbose "COMPILER version: $COMPILER_VERSION"
sit_info_verbose "MPI: $MPI"
sit_info_verbose "MPI version: $MPI_VERSION"
case $PLATFORM in
hazelhen)
module swap $(module list -l 2>&1 | awk '/^PrgEnv-/{print $1}') PrgEnv-${COMPILER}
if [ ! -z "$COMPILER_VERSION" ] ; then
if [ "${COMPILER}" == "gnu" ] ; then
module swap gcc gcc/$COMPILER_VERSION
else
module swap $COMPILER $COMPILER/$COMPILER_VERSION
fi
# adjust MPICH and libsci versions to match compiler
# module load cray-mpich-compat/v7 || module load cray-mpich-compat/v6
fi
MPI_DIR=$MPICH_DIR
module unload craype-hugepages16M
module sw craype-network-aries craype-network-none
module unload cray-mpich
module sw craype-haswell craype-sandybridge
hawk|vulcan)
COMPILER_MODULE=${COMPILER}${COMPILER_VERSION:+"/${COMPILER_VERSION}"}
MPI_MODULE=${MPI}${MPI_VERSION:+"/${MPI_VERSION}"}
MPI_VERSION_NUM=${MPI_VERSION%%-*}
sit_info_verbose "MPI version num: $MPI_VERSION_NUM"
;;
hawk)
if [ -z "$COMPILER_VERSION" ] ; then
COMPILER_MODULE=${COMPILER}
else
COMPILER_MODULE=${COMPILER}/${COMPILER_VERSION}
fi
echo "Loading compiler module ${COMPILER_MODULE}"
module load ${COMPILER_MODULE}
system)
echo "Using system default compiler and MPI"
COMPILER="" # prevent any compiler specs in the prefix
MPI=""
;;
laki|vulcan|*)
if [ -z "$COMPILER_VERSION" ] ; then
COMPILER_MODULE=compiler/${COMPILER}
else
COMPILER_MODULE=compiler/${COMPILER}/${COMPILER_VERSION}
fi
echo "Loading compiler module ${COMPILER_MODULE}"
module load ${COMPILER_MODULE}
*)
sit_fail "Unknown or unsupported system"
;;
esac
fi
echo "Loading modules: ${COMPILER_MODULE} ${MPI_MODULE}"
module load "${COMPILER_MODULE}" "${MPI_MODULE}"
if [ ! -z "${COMPILER}" ] ; then
# reevaluate compiler version
@ -173,35 +158,6 @@ fi
if [ ! -z "$MPI" ] ; then
MPI_MODULE="$MPI"
sit_info_verbose "MPI: $MPI"
sit_info_verbose "MPI version: $MPI_VERSION"
if [ ! -z "$MPI_VERSION" ] ; then
MPI_VERSION_NUM=${MPI_VERSION%%-*}
case $MPI in
impi)
MPI_MODULE=${MPI_MODULE}${MPI_VERSION_NUM:+"/${MPI_VERSION_NUM}"}
;;
*)
MPI_MODULE=${MPI_MODULE}${MPI_VERSION_NUM:+"/${MPI_VERSION_NUM}-$COMPILER-$COMPILER_VERSION"}
;;
esac
fi
case $PLATFORM in
vulcan)
MPI_MODULE="mpi/$MPI"
;;
hawk)
MPI_MODULE="$MPI"
;;
*)
sit_error "mpi not supported on this platform"
;;
esac
echo "Loading MPI module ${MPI_MODULE}"
module load $MPI_MODULE
case $COMPILER in
intel)
if [[ $MPI == "impi" ]] ; then
@ -214,7 +170,7 @@ if [ ! -z "$MPI" ] ; then
MPIFC="mpif90"
fi
;;
gnu|*)
*)
MPICC="mpicc"
MPICXX="mpicxx"
MPIFC="mpif90"