Construct with private and firstprivate clauses, Computer Networking

Assignment Help:

In this example we will see the use of parallel construct with private and firstprivate clauses. At the end of the program i and j remain undefined as these are private to thread in parallel construct.

#include

int main()

{

int i, j;

i = 1;

j = 2;

#pragma omp parallel private(i) firstprivate(j)

{

i = 3;

j = j + 2;

}

printf("%d %d\n", i, j); /* i and j are undefined */

return 0;

}

In the following example, each thread in the parallel region decides what part of the global array x to work on, based on the thread number.


Related Discussions:- Construct with private and firstprivate clauses

Calculate the efficiency of stop-and-wait ARQ, Suppose that frames are 1250...

Suppose that frames are 1250 bytes long including 25 bytes of overhead. Also assume that ACK frames are 25 bytes long. Calculate the efficiency of stop-and-wait ARQ (a) Transmits a

What is logical link control, What is logical link control? One of two ...

What is logical link control? One of two sublayers of the data link layer of OSI reference model, as explained by the IEEE 802 standard. This sublayer is responsible for mainta

Show the importance of security, Q. Show the Importance of Security? Th...

Q. Show the Importance of Security? The Internet presents enormous business opportunities. The Internet is open to public, vulnerable to various attacks. One of the major

Explain different network structures in use, Computer Networking 1. Exp...

Computer Networking 1. Explain different network structures in use. 2. Elaborate the architecture and usage of ISDN. 3. Discuss the concept of framing in Data Link Layer

Illustrate error detection-simple parity check, Q. Illustrate Error Detecti...

Q. Illustrate Error Detection-Simple Parity Check? Error Detection-Simple Parity Check A redundant bit called as Parity Bit? is added to every data unit. Even Pa

What is virtual lans, Q. What is Virtual LANs? Virtual LANs - LAN...

Q. What is Virtual LANs? Virtual LANs - LAN (Local area network) configured by software not by physical wiring Virtual LANs - Divides a LAN into logical, in

Nfs, what is this ?

what is this ?

Fault tree construction rules, FAULT TREE CONSTRUCTION RULES (a)  Defi...

FAULT TREE CONSTRUCTION RULES (a)  Define the  undesired  fault  condition  as the  "Top"  event. The  fault  event describes the state of either the system or a component. (b

Define routing, Define Routing? The process of determining systematical...

Define Routing? The process of determining systematically hoe to forward messages toward the destination nodes based on its address is known as routing.

Which osi reference layer is concerned with logical address, There are two ...

There are two logical addressing :- a) Datalink is physical (hardware) addressing. b) Network is logical (software) addressing.

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