forked from RivinHD/Tsunami-Simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunchSimulation.sh
More file actions
57 lines (46 loc) · 1.58 KB
/
launchSimulation.sh
File metadata and controls
57 lines (46 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
#SBATCH --job-name=launch_simulation
#SBATCH --output=launch_simulation.out
#SBATCH --partition=s_standard
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=00:10:00
#SBATCH --cpus-per-task=36
#SBATCH --mem=4G
set -e
BuildDirectory="/home/$USER/tsunami/Tsunami-Simulation/build"
ScriptDirectory="/home/$USER/tsunami/Tsunami-Simulation"
# Loading cmake to launch this task
echo "Loading needed modules"
module load tools/cmake/3.22.2
module load libs/netcdf/4.6.1-gcc-7.3.0
module load compiler/gcc/11.2.0
module load compiler/intel/2020-Update2
# Cleaning up Build Directory
echo "Cleaning up Build Directory"
rm -rf "$BuildDirectory"
mkdir "$BuildDirectory"
cd "$BuildDirectory"
# Setting up cmake
echo "Setting up cmake"
# intel compiler can only be used without io
#CC="/cluster/intel/parallel_studio_xe_2020.2.108/compilers_and_libraries_2020/linux/bin/intel64/icc" \
#CXX="/cluster/intel/parallel_studio_xe_2020.2.108/compilers_and_libraries_2020/linux/bin/intel64/icpc" \
# Options: -D REPORT=ON
cmake .. -DCMAKE_BUILD_TYPE=Release
# Compiling c++
# Options:
# --config: Release, Debug
# --target: simulation, sanitize, test, sanitize_test, test_middle_states
echo "Building the project"
cmake --build . --target simulation -j 36
#creating ouput directory
directory=/beegfs/$USER/$(date +"%F_%H-%M")
mkdir $directory
# Coping requiered resources for this job
echo "Copying files to $directory"
cp simulation $directory/simulation
mkdir $directory/resources
cp -R resources/* $directory/resources/
echo "Launching the job"
sbatch -D "$directory" "$ScriptDirectory"/simulation.sh