Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
habrok:additional_information:course_material:advanced_exercises_solutions [2023/09/27 08:06] – [Exercise 1.7: Use a job array] pedro | habrok:additional_information:course_material:advanced_exercises_solutions [2024/10/28 14:40] (current) – [Exercise 0] Changed to GitLab link aurel | ||
---|---|---|---|
Line 20: | Line 20: | ||
===== Exercise 0 ===== | ===== Exercise 0 ===== | ||
- | The files needed to complete these exercises are on [[https://github.com/rug-cit-hpc/ | + | The files needed to complete these exercises are on [[https://gitrepo.service.rug.nl/cit-hpc/habrok/ |
< | < | ||
- | git clone https://github.com/rug-cit-hpc/ | + | git clone https://gitrepo.service.rug.nl/cit-hpc/habrok/ |
</ | </ | ||
Line 331: | Line 331: | ||
**Run these commands on the imagefile to see what they do.** | **Run these commands on the imagefile to see what they do.** | ||
- | As you have seen these commands result in numbers that we could use in our script. In order to store a number | + | As you have seen these commands result in numbers that we could use in our script. In order to store the output |
< | < | ||
myvar=$( command ) | myvar=$( command ) | ||
Line 758: | Line 758: | ||
You can study the resulting image using the command: | You can study the resulting image using the command: | ||
< | < | ||
+ | module load ImageMagick/ | ||
display -resize 30% conv_Microcrystals.jpg | display -resize 30% conv_Microcrystals.jpg | ||
</ | </ | ||
Line 770: | Line 771: | ||
#SBATCH --mem=4GB | #SBATCH --mem=4GB | ||
#SBATCH --time=00: | #SBATCH --time=00: | ||
- | #SBATCH --partition=short | + | #SBATCH --partition=regular |
#SBATCH --job-name=Blurring | #SBATCH --job-name=Blurring | ||
#SBATCH --output=singlecpu.out | #SBATCH --output=singlecpu.out | ||
Line 777: | Line 778: | ||
module purge | module purge | ||
# Load the compilers | # Load the compilers | ||
- | module load foss/2020a | + | module load foss/2022b |
+ | # Load the conversion tool | ||
+ | module load ImageMagick/ | ||
# Compile the program | # Compile the program | ||
make | make | ||
Line 804: | Line 807: | ||
After performing this exercise, you should obtain something like the following: | After performing this exercise, you should obtain something like the following: | ||
- | {{:peregrine: | + | {{:habrok: |
The '' | The '' | ||
Line 839: | Line 842: | ||
**Run the blurring app with 2, 4, 8, and 16 MPI tasks, each using one core and running on a separate node.** Make note of the runtimes, as well as the overall wallclock time. How does this differ from the previous exercise? | **Run the blurring app with 2, 4, 8, and 16 MPI tasks, each using one core and running on a separate node.** Make note of the runtimes, as well as the overall wallclock time. How does this differ from the previous exercise? | ||
+ | |||
+ | You can try to resubmit the job with 4 nodes to a '' | ||
+ | |||
+ | The " | ||
+ | |||
<hidden Solution> | <hidden Solution> | ||
Line 847: | Line 855: | ||
After performing this exercise, you should get something like this: | After performing this exercise, you should get something like this: | ||
- | {{:peregrine: | + | {{:habrok: |
It is interesting to compare this graph with the one from exercise 2.2. The main difference is in '' | It is interesting to compare this graph with the one from exercise 2.2. The main difference is in '' | ||
Line 869: | Line 877: | ||
So far, you've been using either multiple CPUs on a single machine (OpenMP), or on multiple machines (MPI), to parallelize and speed up the image processing. In this exercise, you will have a look at how to use GPUs to achieve parallelization. In the folder named '' | So far, you've been using either multiple CPUs on a single machine (OpenMP), or on multiple machines (MPI), to parallelize and speed up the image processing. In this exercise, you will have a look at how to use GPUs to achieve parallelization. In the folder named '' | ||
- | We've reserved one GPU node with 2 k40 GPUs for this course. The reservation is called '' | + | We've reserved one GPU node with 2 V100 GPUs for this course. The reservation is called '' |
< | < | ||
#SBATCH --reservation=advanced_course | #SBATCH --reservation=advanced_course | ||
</ | </ | ||
- | **Request 1 (one) GPU of type k40 on the '' | + | **Request 1 (one) GPU of type V100 on the '' |
**Compare the times from exercise 2.2 with what you obtain now**. You might want to make the problem a bit harder by processing all the files from the '' | **Compare the times from exercise 2.2 with what you obtain now**. You might want to make the problem a bit harder by processing all the files from the '' | ||
Line 879: | Line 887: | ||
Programming the GPU is not for the faint of heart, though OpenACC makes it relatively easy. If you read C code, **study the code and try to figure out where is the GPU used**. If you plan to use an existing application with the GPU, you needn' | Programming the GPU is not for the faint of heart, though OpenACC makes it relatively easy. If you read C code, **study the code and try to figure out where is the GPU used**. If you plan to use an existing application with the GPU, you needn' | ||
- | <hidden Solution> | + | <hidden Solution> |
- | + | < | |
- | ''# | + | #SBATCH --gpus-per-node=v100:1 |
- | + | #SBATCH --reservation=advanced_course | |
- | '' | + | </ |
</ | </ | ||