- •1.3.Describe the OpenMp programming model and compile programs with OpenMp.
- •1.4.Make definition of the classification of computer architectures, classification of parallel computing systems
- •1.5.Describe the process of setting the number of parallel streams in OpenMp.
- •1.8.Critically evaluate Synchronization in OpenMp.
- •1.9.Describe Directive #pragma omp for.
- •1.11.Specify iteration distribution modes cycle in OpenMp threads
- •1.14.Describe Directive #pragma omp parallel. Purpose. The omp parallel directive explicitly instructs the compiler to parallelize the chosen block of code.
- •1.12.Define the Amdahl's Law and its meaning for the programmer
- •1.13.Define the concepts of Stream, thread, process. Describe flow differences (filament) from the process. Processes
- •Threads
- •Parameters. Clause is any of the following clauses:
- •1.15.Critically evaluate locks (mutexes) in OpenMp
- •1.17. Critically evaluate the mpi programming model. Specify Communicator and ranks in the mpi.
- •1.18. Write, how the performance of computers is measured, in what units is measured, according to what law is growing, what are the limits of growth
- •1.20.Describe the function of creating and stop pThreads threads
- •2.1.Give an example of identification streams.
- •2.2.Prove the importance of protecting shared data with a mutex
- •2.3.Specify required elements of the program in mpi
- •2.4.Prove the importance of working with time in mpi. Describe procedure Measurements time of the program portion.
- •2.5.Passing arguments specify flow function
- •2.6.Provide examples of basic stream control operation
- •2.7. Prove the importance of data separation problems between the streams.
- •2.8.Prove the importance of using nVidia cuda in parallel programs.
1.8.Critically evaluate Synchronization in OpenMp.
Only one thread at a time can enter a critical region. It is high level synch.
There are two pragmas for critical sections: critical and atomic . The second one is more limited but has performance advantages.
The typical application of a critical section is to update a variable:
#pragma omp parallel
{
int mytid = omp_get_thread_num();
double tmp = some_function(mytid);
#pragma omp critical
sum += tmp;
}
1.9.Describe Directive #pragma omp for.
Pragmas that let you define how work is distributed or shared across the threads in a parallel region (#pragma omp section, #pragma omp for, #pragma omp single, #pragma omp task).
The omp for directive instructs the compiler to distribute loop iterations within the team of threads that encounters this work-sharing construct.
Pragmas can be controlled by clauses. For example, a num_threads clause can be used to control a parallel region pragma.
Pragma directives generally appear immediately before the section of code to which they apply. For example, the following example defines a parallel region in which iterations of a for loop can run in parallel:
#pragma omp parallel
{
#pragma omp for
for (i=0; i<n; i++)
...
}
1.10.Give examples of pipelined commands. Describe the architecture of von Neumann.
Von Neumann architecture is based on the stored-program computer concept, where instruction data and program data are stored in the same memory.
The Central Processing Unit (CPU) is the electronic circuit responsible for executing the instructions of a computerprogram. It is sometimes referred to as the microprocessor or processor.
1.11.Specify iteration distribution modes cycle in OpenMp threads
Loop parallelism is a very common type of parallelism in scientific codes, so OpenMP has an easy mechanism for it. OpenMP parallel loops are a first example of OpenMP worksharing constructs: constructs that take an amount of work and distribute it over the available threads in a parallel region.
A more natural option is to use the parallel for pragma:
#pragma omp parallel
#pragma omp for
for (i=0; i<N; i++) {
// do something with i
}
This has several advantages. For one, you don't have to calculate the loop bounds for the threads yourself, but you can also tell OpenMP to assign the loop iterations according to different schedules.
Usually you will have many more iterations in a loop than there are threads. Thus, there are several ways you can assign your loop iterations to the threads. OpenMP lets you specify this with the schedule clause. #pragma omp for schedule(....).
With static schedules, the iterations are assigned purely based on the number of iterations and the number of threads (and the chunk parameter; see later). In dynamic schedules, on the other hand, iterations are assigned to threads that are unoccupied. Dynamic schedules are a good idea if iterations take an unpredictable amount of time, so that load balancing is needed.
