#!/bin/tcsh #SBATCH --time=1:00:00 # walltime, abbreviated by -t #SBATCH --nodes=1 # number of cluster nodes, abbreviated by -N #SBATCH -o slurm-%j.out-%N # name of the stdout, using the job number (%j) and the first node (%N) #SBATCH --ntasks=1 # number of MPI tasks, abbreviated by -n # additional information for allocated clusters #SBATCH --account=baggins # account - abbreviated by -A #SBATCH --partition=kingspeak # partition, abbreviated by -p # just in case purge the old modules and load Matlab module module purge module load matlab # directory with the Matlab inputs, must contain run_matlab.m set DATADIR="/uufs/chpc.utah.edu/common/home/u0123456/matlab_input_files" # scratch directory where the Matlab is run set SCRDIR="/scratch/serial/u0123456/matlab_run1" # make scratch dir, copy input data there and cd to it mkdir -p $SCRDIR cp $DATADIR/* $SCRDIR cd $SCRDIR # run matlab program via the run_matlab script matlab -nodisplay -r run_matlab -logfile matlab_batch.log # create results directory in home DATADIR mkdir $DATADIR/result # copy results from scratch to the result dir - replace matlab_outputs* # with your own results files cp -r matlab_outputs* $DATADIR/result