#!/usr/bin/env bash

#SBATCH --job-name={{ name }}
#SBATCH --account={{ account }}
#SBATCH --partition={{ partition }}
#SBATCH --nodes={{ nodes }}
#SBATCH --ntasks={{ tasks }}
# Counted per node
{{ extra_sbatch_line }}
#SBATCH --time={{ time }}
#SBATCH --output={{ logfile_path }}
#SBATCH --error={{ logfile_path }}
#SBATCH --array=1-5

NASTJA_BINARY="{{ nastja_binary_path }}"
CONFIG_FILE="{{ config_path }}"
OUTPUT_DIR="{{ output_dir_path }}"
module load Stages/2024 GCC/12.3.0 ParaStationMPI/5.9.2-1 CMake/3.26.3 mold/1.11.0 jq/1.6 git Python

echo "${NASTJA_BINARY_PATH}"
echo "${CONFIG_FILE}"
echo "${OUTPUT_DIR}"

cat "${CONFIG_FILE}"

mkdir -p "${OUTPUT_DIR}"

srun "${NASTJA_BINARY}" \
  -c "${CONFIG_FILE}" \
  -o "${OUTPUT_DIR}"

