Please tackle the tasks yourself first, before looking at the solutions :-)
Go to the Learn Ultra page to find out how to connect to NCC via the commandline.
Once there, execute the following to access a GPU node:
srun -c 2 --gres=gpu:1 --partition=tpg-gpu-small --pty /bin/bash
module load cuda/12.0
nvcc your_source_code.cu -o your_executable
module load nvidia-hpc
nvc++ -fopenmp -mp=gpu test.cpp -o test_executable
OMP_NUM_THREADS
OMP_NUM_TEAMS
OMP_THREAD_LIMIT
Pkease note that these are upper bounds and do not guarantee that the ocde is executed with this exact number of threads. For instance, slurm might overwrite these values dependent on the reservation parameters.
module load llvm-clang
module load cuda/11.5
clang++ -fsycl -fsycl-targets=nvptx64-cuda my_source_code.cpp -o my_executable