It's UWAweek 47

help5507

This forum is provided to promote discussion amongst students enrolled in CITS5507 High Performance Computing.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 148 articles.
Currently 12 other people reading this forum.


 UWA week 34 (2nd semester, week 5) ↓
SVG not supported

Login to reply

👍x1
helpful
1:36pm Wed 21st Aug, Abdul M.

Hi, I assume you are running in Setonix using the batch script.

The batch script example shows that you request one server (--node=1) and 28 tasks (--ntasks=28). The ntasks option means you are asking for 28 independent processes with the default number of threads = 1. That's why you will find the program output is "Hello from thread 0" 28 times because it comes from 28 independent processes.

In the slide, it was assumed that you are only running on a single computer, with one process, AND asking for multithreading with four threads. That's why you are seeing different thread numbers.

If you want to achieve the same results with the slide, you can add this line on the batch script before running your program:

...
cc -o test -fopenmp ./test.c

# Add this line
export OMP_NUM_THREADS=4

srun ./test

The output will be 28 processes with four threads each, resulting in 28 x 4 = 112 lines of output. You can see the different thread ID in each process.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy