#!/bin/bash -l # Request 8 cores from omp queue (example needs multicores) #$ -pe omp 8 # Set number of array jobs (Total Bin Count) #$ -t 1-10 # Load a MATLAB module on the SCC module load matlab/2019a # Set variable for Total Bin Count export SGE_TOTAL_BINS=N # Check if input exists to set number to compute # s=1+2+3+..+n=n(n+1)/2 with n = NUMBER_SUMS, # set to 100 if no input is supplied if [ -z $1 ] then NUMBER_SUMS=$1 else NUMBER_SUMS=100 fi # Call MATLAB to run hello_pct.m with 8 parpool workers # With SGE_TASK_ID as each independent array job number matlab -nodisplay -r "hello_pct_array($SGE_TASK_ID,$SGE_TOTAL_BINS,$NUMBER_SUMS, $NSLOTS); exit"