Thursday, February 28, 2013

Implementation

Implementation
In openmp program is divided into successive and line of latitude vicinitys( twin means that part of the code can be parallelized).we explicitly indicate the parallel regions and the type of parallelism (data or the structural parallelism) using compiler directionals. OPENMP provides seven main leadings. individually leading is supported with set of clauses that add exact constrained properties to the directive.
Directives:
#pragma omp parallel
#pragma omp for [clause[,]]
#pragma omp sections
#pragma omp single
#pragma omp barrier
#pragma omp master
#pragma omp parallel for
#pragma omp parallel sections
Each directive specifies a specific property of the following period to the compiler. Based on the property and the way of execution of weave we corresponding convert it into the mpi code where in each c are for in MPI is analogous to the delineate in OPENMP.
Following are the properties of each block and their equivalent conversions…
1 . # pragma omp parallel [clauses, []]
This directive describes the parallel regions in the code(part that to be penalise in parallel).The serial regions are kill by a single thread called Master Thread and at the start of the parallel regions invokes separate threads to run the region specified the above directive in parallel.
Ex :
#include<omp.h>
#include<stdio.

Order your essay at Orderessay and get a 100% original and high-quality custom paper within the required time frame.

h>
Main()
{
Int A[5];
A[0]=0; // averment 1
A[1]=1; // record 2
A[2]=2; //Statement 3
#pragma omp parallel
{
A[3]=3; //Statement 4
A[4]=4; //Statement 5
}
}
Description :
The block containing statement #4 and statement #5 is defined as parallel region by the parallel directive and hence this block go away be executed by set of threads .
Conversions :
In the converted MPI code , serial regions of OPENMP code are redundantly executed in all the answeres of MPI . Whereas parallel regions of OPENMP code are executed in parallel through processes in MPI(but each processs work in the parallel region in MPI...If you want to get a full essay, order it on our website: Orderessay



If you want to get a full essay, wisit our page: write my essay .

No comments:

Post a Comment