Parallel construct in openmp, Computer Networking

Assignment Help:

Parallel Construct

The syntax of the parallel construct is as follows:

#pragma omp parallel [set of clauses]

 where clause is one of the following:

 structured-block

if(scalar-expression)

private(list)

firstprivate(list)

default(shared | none)

 shared(list)

 copyin(list)

When a thread encounters a parallel construct, a set of new threads is created to implement the parallel region. Within a parallel region every thread has a unique thread number. Thread number of the master thread is zero. Thread number of a thread can be getting by the call of library function omp_get_thread_num. Now, we are giving the explanation of the clauses used in a parallel construct.

(a) Private Clause:

These clauses states one or more list items to be private to a thread. The syntax of the private clause is

 private(list).

(b) Firstprivate Clause:

The firstprivate clause states one or more list items to be private to a thread, and initializes each of them with the value that the corresponding original item has when the construct is encountered. The syntax of the firstprivate clause is as follows:

 firstprivate(list).

(c) Shared Clause:

The shared clause declares one or more list items to be shared between all the threads in a team. The syntax of the shared clause is :

 shared(list)

(d) Copyin Clause:

The copyin clause gives a mechanism to copy the value of the master thread's threadprivate variable to the threadprivate variable of each other member of the team implementing the parallel region. The syntax of the copyin clause is :

 copyin(list)


Related Discussions:- Parallel construct in openmp

Show a simplex stop and wait automatic repeat request, Q. Show a simplex St...

Q. Show a simplex Stop and Wait automatic repeat request? A simplex Stop and Wait ARQ - Normal Operation - Frame lost - Acknowledgement lost - Acknowledgement de

System analysis, explain the appropriateness of economic and behavioral fea...

explain the appropriateness of economic and behavioral feasibility

Building and running mpi programs, MPI parallel programs are written with c...

MPI parallel programs are written with conventional languages like, C and Fortran  .One or more header files such as "mpi.h" may be needed to give the necessary definitions and dec

10base-t, 10BASE-T:  This is another standard of wiring function. It i...

10BASE-T:  This is another standard of wiring function. It is usually known 10Base-T, TP Ethernet or Twisted Pair. It removes AUI cable with twisted pair cable and thick coax

Define guided media, Q. Define Guided Media? - Offers a conduit from on...

Q. Define Guided Media? - Offers a conduit from one device to another - Signal is directed as well as contained by physical limits of medium - Twisted-pair and coaxial ut

Explain the physical and logical paths in a computer communi, Explain the p...

Explain the physical and logical paths in a computer communication network also

Command that shows traffic statistics on serial 0/1, Recognize the command ...

Recognize the command that shows traffic statistics on serial0/1? Ans) show interface serial 0/1

Which layer defines bit synchronization, Physical layers defines with synch...

Physical layers defines with synchronizing the 1s and 0s on the wire.

Difference between authentication and deauthentication, Difference between ...

Difference between Authentication and Deauthentication Authentication: Used to establish the self of stations to each other. Deauthentication: This service is appealed whene

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd