Typical HPC Day - Mac

Case: You already have an HPC account and you are a Mac user.  You have developed your MATLAB code on your workstation, but it is not sufficient to run your entire data set   You have an account on the KSU HPC and you have tested your code on the HPC in an interactive session against some sample data.  Now, it is time to run against a larger data set.

Use Global Protect VPN: whether on or off-campus

 In top menu bar access (globe icon)

 Be sure vpn-groups selected when you connect.

Use Cyberduck or Terminal.app (SFTP or SSH): upload a new data file.

 $ scp /Users/your_netid/new_data_file   your_netid@hpc.kennesaw.edu:/data/home/your_netid/data_folder/

Use Terminal.app to start an SSH session:

ssh your_netid@hpc.kennesaw.edu

Move a copy of your uploaded data to your scratch directory

$ cp ~/data_folder /path to your scratch directory/

Note: Assume the matlab_script.m below will access the new data file (read-only).
fileID = fopen(’new_data_file’, r);

Write your R job submission (run_matlab.pbs):

#!/bin/bash
#PBS -l nodes=1:ppn=1
#PBS -l walltime=10:00:00
#PBS -m abe
#PBS -M your_email@kennesaw.edu

JOBID=`echo $PBS_JOBID | cut -f1 -d.`

module load MATLAB

# Create a temp workdir under scratch
mkdir -p ${HOME}/scratch/matlab
export PBS_MATLAB_WORKDIR=$( mktemp -d -p ${HOME}/scratch/matlab workdir_XXXXXXXXXX )

matlab -nodisplay -nosplash -logfile ${FILE}.log -r "run ${FILE}"

# Delete temp workdir
rm -rf ${PBS_MATLAB_WORKDIR}

Submit your job with qsub:

qsub run_matlab.pbs -vFILE=${PWD}/matlab_script.m

Check your output file / results

$ cat file_with_results   

or   

$ cat o.job_id 

Exit

$ exit

©