[SOLVED] CS代考计算机代写 c++ compiler cache algorithm c/c++ file system CS402 LAB SESSION 2: OPENMP

30 $

File Name: CS代考计算机代写_c++_compiler_cache_algorithm_c/c++_file_system_CS402_LAB_SESSION_2:_OPENMP.zip
File Size: 923.16 KB

SKU: 8516988936 Category:

Or Upload Your Assignment Here:


CS402 LAB SESSION 2: OPENMP
1. Introduction
OpenMP (Multiprocessing) is an API and runtime which enables the program- ming of multiple processing cores with shared memory. The API is a collection of functions and pragmas; the former allows the querying of information such as the number of active threads, and the latter allows the definition of parallel regions. In these parallel regions, threads are spawned by the OpenMP runtime and the code within is executed on multiple cores. These threads are then able to communicate with each other using shared memory.
This lab will give a basic introduction on how to use the OpenMP API to exploit parallelism in applications.
2. Remote Working
As with the first lab sheet, you will once again be working remotely for this lab session. We recommend that you make use of the DCS managed Batch Compute System1 for completing the following lab exercises. This section will explain how to get started with the DCS cluster, and how you can make use of it to run any programs you write during completion of this lab sheet.
First, connect to one of the DCS Login/Remote nodes using one of the follow- ing two commands (where u1XXXXXX is be replaced by your username and nn in remote-nn is replaced by the last two digits of your username):
$ ssh [email protected]
$ ssh [email protected]
Then, connect to the login node of the cluster, kudu: $ ssh kudu
Once you have connected to kudu you will see that you can access all of the files that you have saved in your DCS file system. It’s important that you do not run your C programs directly on the login node, but instead submit them using a batch submission script. In order to do this, firstly load the necessary environment module for the compiler using the following command:
1Further information on the Batch Compute System can be found here: https://warwick. ac.uk/fac/sci/dcs/intranet/user_guide/batch_compute
1

2 CS402 LAB SESSION 2: OPENMP
$ module load cs402-mpi
As was the case in the previous lab sheet, this will give you access to the required compilers. Once you have compiled your code, it can be submitted for execution using a submission script. A sample job submission script is provided below:
#!/bin/bash
#SBATCH –job-name=example-job # Job name for tracking
#SBATCH –partition=cs402
#SBATCH –nodes=1
#SBATCH –ntasks-per-node=1
#SBATCH –cpus-per-task=2
#SBATCH –time=00:01:00
module load cs402-mpi
srun ./
# Partition you wish to use
# Number of compute nodes used by your job
# Number of CPU cores used on each node
Listing 1: A sample Batch Script for job submission (submit.sbatch)
Save this script to a file called submit.sbatch – you can then copy/adjust this script as necessary once you begin to tackle the lab exercises. For example, if you take a look at the Hello World in OpenMP exercise (Section 4.1), it might be sensible to change the job name to hello-world. The final line of your script would also need to be changed to srun ./helloWorldOMP. If you want to run your programs using more cores/threads, you can adjust the cpus-per-task parameter in the script. The compute nodes on kudu have 6 CPU cores, however for the majority of the exercises in this lab sheet, running your code using only 2 OpenMP threads should be appropriate.
When you have successfully prepared your script, your job can be submitted using the following command (where

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考计算机代写 c++ compiler cache algorithm c/c++ file system CS402 LAB SESSION 2: OPENMP
30 $