#!/bin/bash #SBATCH -p public # targeting the public partition #SBATCH --ntasks-per-core=1 # disabling multithreading #SBATCH -n 40 # reserving 40 compute cores #SBATCH -J g40 # naming the job #SBATCH --array=0-12 # creating a SLURM job array of 13 sub-jobs # Array of temperatures TEMPERATURES=(1000 1100 1200 1300 1350 1400 1425 1450 1500 1550 1650 1750 1900) # If the number of SLURM tasks exceeds the size of TEMPERATURES, we exit if [ $SLURM_ARRAY_TASK_COUNT -gt ${#TEMPERATURES[@]} ] then echo "number of tasks > number of temperatures" echo "($SLURM_ARRAY_TASK_COUNT > ${#TEMPERATURES[@]})" exit 1 fi # JOB TASK ID with 3 zero padding id=$(printf %03d $SLURM_ARRAY_TASK_ID) MAIN_JOB_PATH="job_${SLURM_ARRAY_JOB_ID}" # main job path JOB_PATH="${MAIN_JOB_PATH}/${id}" # sub-job path # Run temperature let "temperature = ${TEMPERATURES[$SLURM_ARRAY_TASK_ID]}" # Activating the Python virtual environment source ../../.venv/bin/activate # Creating a directory dedicated to the run and moving into it mkdir -p $JOB_PATH cd $JOB_PATH # Launching the MPI computation and redirecting standard output to the output.log file mpiexec -n 40 llg3d -solver mpi -N 4000 -Jx 6000 -dx 1e-9 -T $temperature wait cd .. llg3d.post --job_dir .