Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Updated build scripts with the new environment module
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 15, 2024
1 parent 78d9d77 commit 314655f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
26 changes: 21 additions & 5 deletions buildscripts/build_rcac_gnu.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/zsh -l
# installs an editable (local) package in release mode on Negishi
# Builds Swiftest on the Purdue RCAC cluster system using the GNU compiler
# This is a convenience script for Kaustub


# The default build type is Release, in which case the Python package is installed in editable mode. Otherwise, only the Fortran
# library and executables are built, but not installed, so that the user can run them from the build directory.

set -a
SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)
cd ${ROOT_DIR}
BUILD_TYPE=${1:-"Release"}

# Set the OMP_NUM_THREADS variable to be the number of CPUS if this is a compute node, or 1 if this is a frontend or login node
if { hostname | grep -E 'fe|login'; } >/dev/null 2>&1; then
OMP_NUM_THREADS=1
else
OMP_NUM_THREADS=$(squeue -u $(whoami) | grep $SLURM_JOB_ID | awk -F' ' '{print $6}')
fi

MACHINE_NAME=$(uname -n | awk -F. '{
if ($2 == "negishi" || $2 == "bell")
print $2;
Expand All @@ -22,6 +29,15 @@ MACHINE_NAME=$(uname -n | awk -F. '{
}
}')

if { conda env list | grep 'mintongroup'; } >/dev/null 2>&1; then
print -n "The mintongroup conda environment was detected"
else
print -n "The mintongroup conda environment was not detected. Creating it now..."
/depot/daminton/apps/build_mintongroup_conda.sh
fi



if [[ $MACHINE_NAME == "bell" ]]; then
module purge
module use /depot/daminton/etc/modules/bell
Expand All @@ -34,7 +50,7 @@ if [[ $MACHINE_NAME == "bell" ]]; then
module load ninja/1.11.1
if [[ $BUILD_TYPE == "Release" ]]; then
module load use.own
module load conda-env/swiftest-env-py3.8.5
module load conda-env/mintongroup-py3.8.5
fi
elif [[ $MACHINE_NAME == "negishi" ]]; then
module purge
Expand All @@ -48,7 +64,7 @@ elif [[ $MACHINE_NAME == "negishi" ]]; then
module load ninja/1.11.1
if [[ $BUILD_TYPE == "Release" ]]; then
module load use.own
module load conda-env/swiftest-env-py3.9.13
module load conda-env/mintongroup-py3.9.13
fi
fi

Expand Down
23 changes: 18 additions & 5 deletions buildscripts/build_rcac_intel.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#!/bin/zsh -l
# installs an editable (local) package on Bell
# This is a convenience script for Kaustub
# To use in Release mode, be sure to create the swiftest-env module first. Using the RCAC tools it's the following commands:
# To use in Release mode, be sure to create the mintongroup module first. Using the RCAC tools it's the following commands:
# $ conda env create -f environment.yml
# $ conda-env-mod module -n swiftest-env --jupyter

# $ conda-env-mod module -n mintongroup --jupyter

set -a
SCRIPT_DIR=$(realpath $(dirname $0))
ROOT_DIR=$(realpath ${SCRIPT_DIR}/..)
cd ${ROOT_DIR}
BUILD_TYPE=${1:-"Release"}

# Set the OMP_NUM_THREADS variable to be the number of CPUS if this is a compute node, or 1 if this is a frontend or login node
if { hostname | grep -E 'fe|login'; } >/dev/null 2>&1; then
OMP_NUM_THREADS=1
else
OMP_NUM_THREADS=$(squeue -u $(whoami) | grep $SLURM_JOB_ID | awk -F' ' '{print $6}')
fi

MACHINE_NAME=$(uname -n | awk -F. '{
if ($2 == "negishi" || $2 == "bell")
print $2;
Expand All @@ -24,6 +30,13 @@ MACHINE_NAME=$(uname -n | awk -F. '{
}
}')

if { conda env list | grep 'mintongroup'; } >/dev/null 2>&1; then
print -n "The mintongroup conda environment was detected"
else
print -n "The mintongroup conda environment was not detected. Creating it now..."
/depot/daminton/apps/build_mintongroup_conda.sh
fi


if [[ $MACHINE_NAME == "bell" ]]; then
module purge
Expand All @@ -38,7 +51,7 @@ if [[ $MACHINE_NAME == "bell" ]]; then
module load netcdf/4.7.4
module load netcdf-fortran/4.5.3
module load use.own
module load conda-env/swiftest-env-py3.8.5
module load conda-env/mintongroup-py3.8.5
MACHINE_CODE_VALUE="Host"
elif [[ $MACHINE_NAME == "negishi" ]]; then
module purge
Expand All @@ -53,7 +66,7 @@ elif [[ $MACHINE_NAME == "negishi" ]]; then
module load netcdf-c/4.9.0
module load netcdf-fortran/4.6.0
module load use.own
module load conda-env/swiftest-env-py3.9.13
module load conda-env/mintongroup-py3.9.13
MACHINE_CODE_VALUE="SSE2"
fi

Expand Down

0 comments on commit 314655f

Please sign in to comment.