C++
The tutorial assumes you have already worked through the MPI Example Tutorial. Therefore, the instructions here are abbreviated but will follow the same format so you may easily consult the extended tutorial.
Table of Contents
Note: Do not execute jobs on the login nodes; only use the login nodes to access your compute nodes. Processor-intensive, memory-intensive, or otherwise disruptive processes running on login nodes will be killed without warning.
Step 1: Access Your Allocation
If you need to request an allocation, see instructions here.
Open a Bash terminal (or PuTTY for Windows users).
Execute
ssh username@hpc.cofc.edu
.When prompted, enter your or password.
Step 2: Create a SLURM Script
Example SLURM Script
Here is an example SLURM script for running a batch job on the cluster.
Step 3: Compile the C++ Program from Source
MPI Hello World Source Code
C++ Procedure
Compile the C++ source into a binary executable file.
Use
ls -al
to verify the presence of thehello_world_cpp
binary in your working directory.
Step 4: Run the Job
Use
sbatch
to schedule your batch job in the queue.This command will automatically queue your job using SLURM and produce a job ID number (shown below). You can check the status of your job at any time with the
squeue -j <JOB_ID>
command.You can also stop your job at any time with the
scancel
command.View your results. You can view the contents of these files using the
more
command followed by the file name.
Your output should look something like this (the output is truncated.):
Download your results (using the
scp
command or an SFTP client) or move them to persistent storage.
Additional Examples
Last updated