High Performance Computing (HPC) Lec4
High Performance Computing (HPC) Lec4
(HPC)
Lecture 4
Basic approach
Find compute intensive loops
Make the loop iterations independent ..
So they can safely execute in any order
without loop-carried dependencies
j+=2;
j={5+2,7+2,9+2,…….)-→ j=5+2*(i+1)
Where i is the thread id (0,1,2,….)
Nowait
Double A[10];
int main()
A, index, count
{
int index[10];
#pragma omp parallel temp temp temp
work(index);
printf(“%d\n”, index[0]);
A, index, count
}
void work(int *index)
{
A, index and count are shared
double temp[10]; by all threads.
static int count; temp is local to each thread
...
Changing storage attributes
One can selectively change storage attributes constructs using the following
clauses*
SHARED
PRIVATE
FIRSTPRIVATE
THREADPRIVATE
The value of a private inside a parallel loop can be transmitted to a global value
outside the loop with:
LASTPRIVATE
The default status can be modified with:
DEFAULT (PRIVATE | SHARED | NONE)
Private Clause
openmp.org
https://hpc-tutorials.llnl.gov/openmp/
openmp-examples-4.5.0.pdf
The basic parallel construct · OpenMP Little Book
How to build a cluster
HPC Cluster
HPC cluster components
Head or Login Node: This node validates users and may set up
specific software on the compute nodes.
Compute Nodes: These perform numerical computations. Their
persistent storage may be minimal, while the DRAM memory will be
high.
Accelerator Nodes: Some nodes may include one or more
accelerators, while smaller HPC clusters, purpose built for a specific
use may be set up where all nodes contain an accelerator.
Example GPUs.
HPC cluster components
Job priority
Computer resource availability
License key if job is using licensed software
Execution time allocated to user
Number of simultaneous jobs allowed for a user
Estimated execution time
Availability of peripheral devices
Operator prompt dependency. Some schedulers provide sophisticated
features, such as real-time scheduling in accordance with external
events, automatic restart in case of failures and automated incident
reporting.
Cluster Monitoring tools
Choose one of the cluster management ,job scheduler and monitoring tools.
Register your choice with Eng. Basant this Section
A full report about this tool will be delivered with 5 slides presentation
Duedate: 2 November 2024