In order to successfully complete this assignment you need to participate both individually and in groups during class. Have one of the instructors check your notebook and sign you out before leaving class. Turn in your assignment using D2L.
ICA 23: Alternatives#
![]() |
![]() |
Agenda for today’s class (70 minutes)#
(20 minutes) Pre class Review
(5 minutes) Submitting CUDA Jobs on the HPCC
(20 minutes) Homework Questions
(25 minutes) Introducing MPI
1. Pre class Review#
Discuss the various alternatives to cuda and their pros and cons.
2. Submitting CUDA Jobs on the HPCC#
Review the below code on how to submit a CUDA job to the HPCC.
%%writefile cuda_submit.sb
#!/bin/bash
#SBATCH --time=01:00:00
#SBATCH -c 1
#SBATCH -N 1
#SBATCH --gres=gpu:1
#SBATCH --mem=4gb
cd ${SLURM_SUBMIT_DIR}
time srun ./mycudaprogram
#Prints out job statistics
js ${SLURM_JOB_ID}
!sbatch cuda_submit.sb
3. Homework Questions#
Homework 3 is due Sunday. If you are struggling with anything, use this time in class to get help. Ask me questions or work together with your groups to figure out how to get the CUDA code working.
4. Introducing MPI#
Our next big topic in class will be doing “Shared Network Parallization” using MPI (Message Passing Interface). MPI and it’s libraries are loaded by default on the HPCC.
✅ DO THIS: Get either the Pandemic or Galaxsee example working using MPI on the HPCC. Here are the basic steps:
Compile the code without X11 options (there are no monitors on the HPC side.
Write a submission script (similar to the one below).
Submit the job and debug any errors.
%%writefile cuda_submit.sb
#!/bin/bash
#SBATCH --time=01:00:00
#SBATCH -c 1
#SBATCH -N 10
#SBATCH --mem=40gb
time srun ./mympiprogram
#Prints out job statistics
js ${SLURM_JOB_ID}
✅ QUESTION: What is different about the above submission script as compared to a shared memory job (OpenMP) or a GPU job (CUDA)?
Put your answer to the above question here.
✅ DO THIS: What would a scaling study look like for this type of job? Can you think of a way to automatically vary the number of nodes (N) from from 1,2,4,8 etc?
Put your answer to the above question here.
Congratulations, we’re done!#
Have one of the instructors check your notebook and sign you out before leaving class. Turn in your assignment using D2L.
Written by Dr. Dirk Colbry, Michigan State University (Updated by Dr. Nathan Haut in Spring 2025)
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.