Case for Interactive HPC Session on Mac
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.eduJOBID=`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