You are here: Home Education Tutorials Summer School GPU exercises

GPU exercises

This lab assignment is designed to give you experience leveraging OpenCL to convert a standard C program for parallel execution on multiple CPU and GPU cores. You will start by profiling a model PDE solver. Using those performance results you will move portions of the computation over to an OpenCL GPU device to accelerate the computation. At each step you will analyze the resulting performance and answer a series of questions to provoke you to think about what is going on.

Instructions

Follow these instructions to complete the computer exercise.

Code

Download and unpack this file which contain the code for this exercise.

Work sheet

Links

Preparing and submitting a job.

Don't forget to replace "username" and directory names according to your account and own directory names!

 

1. Login to Zorn
ssh username@zorn.pdc.kth.se
2. Change to your working directory
cd /cfs/zorn/nobackup/u/username
3a. Copy your source code,
cp –r ~/yourcode ./
cd ./yourcode/
3b. or use the sample solution cd solution_code/
4. Compile the code
make clean; make all
5a Open a job script in an editor
nano job.sh
5b Write into this file the test:
#!/bin/bash
cd /cfs/zorn/nobackup/u/username/yourcode
make run
6. Make it executable and submit the job
chmod +x job.sh
qsub –l walltime=10:00 ./job.sh
7. Watch occasionally the job status (every few minutes is enough - it does not change so faster) and wait for the output in your working directory. It will be a file with the name "job.e<job-number>". You saw the job number during the submission.
qstat