- •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.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
- •1.14.Describe Directive #pragma omp parallel. Purpose. The omp parallel directive explicitly instructs the compiler to parallelize the chosen block of code.
- •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.
2.3.Specify required elements of the program in mpi
We cannot tell which "Hello world" line was printed by which process. To identify a process we need some sort of process ID and a routine that lets a process find its own process ID. MPI assigns an integer to each process beginning with 0 for the parent process and incrementing each time a new process is created. A process ID is also called its "rank".
MPI also provides routines that let the process determine its process ID, as well as the number of processes that are have been created.
It is important to realize that separate processes share no memory variables. They appear to be using the same variables, but they are really using COPIES of any variable defined in the program.
As a result, these programs cannot communicate with each other by exchanging information in memory variables. Instead they may use any of a large number of MPI communication routines. The two basic routines are:
MPI_Send, to send a message to another process, and
MPI_Recv, to receive a message from another process.
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
function to memoize
equality function for arguments
equality function for return type
Two main changes to enter the type:
Since memoize is a generic function who's return type depends on the type parameters, you need to include a return type. If you don't, Flow will infer a return type, and Flow only infers monomorphic types, not polymorphic types.
Add an upperbound for ArgsType to say it's either a tuple or an array.
Functions have two places where types are applied: Parameters (input) and the return value (output).
Using inference, these types are often optional:
function concat(a, b) {
return a + b;}
concat("foo", "bar"); // Works!
concat(true, false); // Error!
Sometimes Flow’s inference will create types that are more permissive than you want them to be.
function concat(a, b) {
return a + b;}
concat("foo", "bar"); // Works!
concat(1, 2); // Works!
There are three forms of functions that each have their own slightly different syntax.Function Declarations. Here you can see the syntax for function declarations with and without types added.
2.6.Provide examples of basic stream control operation
Streams are an important component of small-program design and unix philosophy but there are many other important abstractions worth considering.
I/O in node is asynchronous, so interacting with the disk and network involves passing callbacks to functions.
There are 5 kinds of streams: readable, writable, transform, duplex, and "classic".
All the different types of streams use .pipe() to pair inputs with outputs.
.pipe() is just a function that takes a readable source stream src and hooks the output to a destination writable stream dst:
src.pipe(dst)
.pipe(dst) returns dst so that you can chain together multiple .pipe() calls together:
a.pipe(b).pipe(c).pipe(d)
which is the same as:
a.pipe(b);
b.pipe(c);
c.pipe(d);
This is very much like what you might do on the command-line to pipe programs together:
a | b | c | d
Readable streams produce data that can be fed into a writable, transform, or duplex stream by calling .pipe():
readableStream.pipe(dst)
