#!/bin/bash -l # #SBATCH --nodes=1 #SBATCH --job-name=PyTest #SBATCH --partition=48cpu_192mem #SBATCH --ntasks-per-node=48 #SBATCH --time=1-00:00:00 #SBATCH --mail-type=ALL export OMP_NUM_THREADS=1 module purge module load Python # Set up temporary scratch directory scratchlocation=/scratch/users if [! -d $scratchlocation/$USER]; then mkdir -p $scratchlocation/$USER fi tdir=$(mktemp -d $scratchlocation/$USER/$SLURM_JOB_ID) cd $tdir if [! -d “$tdir”]; then echo "Temporary scratch directory does not exist ..." echo "Something is wrong, contact support." exit fi # Copy the python script cp $SLURM_SUBMIT_DIR/input.py $tdir/ # run the job mpirun python input.py # Copy output cp $tdir/out.txt $SLURM_SUBMIT_DIR/ rm -rf $tdir