Skip to content

Commit

Permalink
Add sonic HPC
Browse files Browse the repository at this point in the history
  • Loading branch information
vaishakp committed Sep 27, 2024
1 parent f31009c commit 5ee9484
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/Installation/InstallationOnClusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,27 @@ The second command with `SPECTRE_DEBUG=ON` enables sanity checks and
optimizations. This means it can be used in production-level runs to ensure
there aren't any subtle bugs that might only arise after a decently
long simulation.

## Sonic at ICTS-TIFR

Cluster documentation: https://it.icts.res.in/docs/sonic-cluster

1. Clone the spectre source code and set `SPECTRE_SOURCE` to point it.
2. Create a build directory and set `SPECTRE_BUILD` to it.
3. Set `SPECTRE_INSTALL` to the destination location.
4. Setup the software environment
1. Set the location of optimized libraries and load environment modules:
```
export SOFT_DIR=/mnt/pfs/vaishak.p/soft
. $SOFT_DIR/modules-5.2.0/init/bash
```
Add these lines to your `.bashrc` and source it.
2. Copy the `privatemodules` dir from `$SOFT_DIR` to your home directory
5. Source the `$SPECTRE_SOURCE/support/Environments/Sonic.sh` script.
6. Build SpECTRE by changing to `$SPECTRE_BUILD` and using one of the commands
`spectre_run_cmake`. This by default compiles SpECTRE in Release
mode, without debug symbols and LTO, using gcc, and with system
malloc. If you wish to compile in debug mode or with LTO ot other options,
simply suffix the additional cmake flags to the command.
7. Use `make` to build your targets and use `make install` to deploy the
executables.
50 changes: 50 additions & 0 deletions support/Environments/sonic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/env sh

# Distributed under the MIT License.
# See LICENSE.txt for details.

spectre_setup_modules() {
echo "All modules on Sonic are provided by the system"
}

spectre_load_modules() {
# The order here is important
module load use.own
# module load gcc/11.1.0
module load spectre-env > /dev/null 2>&1
}

spectre_unload_modules() {
# The order here is important
module unload spectre-env > /dev/null 2>&1
# module unload gcc/11.1.0
module unload use.own
}

spectre_run_cmake() {
if [ -z ${SPECTRE_SOURCE} ]; then
echo "You must set SPECTRE_SOURCE to the cloned SpECTRE directory"
return 1
fi

if [ -z ${SPECTRE_INSTALL} ]; then
echo "You must set SPECTRE_INSTALL to the target directory"
return 1
fi

spectre_load_modules > /dev/null 2>&1
cmake -D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D CMAKE_Fortran_COMPILER=gfortran \
-D CHARM_ROOT=$CHARM_ROOT \
-D MEMORY_ALLOCATOR=SYSTEM \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_PYTHON_BINDINGS=ON \
-D ENABLE_PARAVIEW=ON \
-D MACHINE=Sonic \
-D USE_XSIMD=yes \
-D DEBUG_SYMBOLS=OFF \
-D CMAKE_INSTALL_PREFIX=$SPECTRE_INSTALL \
"$@" \
$SPECTRE_SOURCE
}
14 changes: 14 additions & 0 deletions support/Machines/Sonic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Distributed under the MIT License.
# See LICENSE.txt for details.

Machine:
Name: Sonic
Description: |
HPC at ICTS-TIFR hosted by AstroRel.
More information:
https://it.icts.res.in/docs/sonic-cluster/
DefaultTasksPerNode: 3
DefaultProcsPerTasks: 32
DefaultQueue: "long"
DefaultTimeLimit: "1-00:00:00"
LaunchCommandSingleNode: ["mpirun", "-n", "1"]
17 changes: 17 additions & 0 deletions support/SubmitScripts/Sonic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "SubmitTemplateBase.sh" %}

# Distributed under the MIT License.
# See LICENSE.txt for details.

# Sonic is an HPC at ICTS-TIFR hosted by its AstroRel group.
# More information:
# https://it.icts.res.in/docs/sonic-cluster/

{% block head %}
{{ super() -}}
#SBATCH --nodes {{ num_nodes | default(1) }}
#SBATCH --ntasks-per-node 3
#SBATCH --cpus-per-task 32
#SBATCH -p {{ queue | default("long") }}
#SBATCH -t {{ time_limit | default("1-00:00:00") }}
{% endblock %}

0 comments on commit 5ee9484

Please sign in to comment.