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

Firewall architectures-dual homed host architecture, Dual Homed Host Archit...

Dual Homed Host Architecture This setup consists of a host machine with two or more IP addresses for each of its physical port. One port is connected to intranet and other to the

Addresses and connection identifiers, Address is a full unique identifier. ...

Address is a full unique identifier. Connectionless delivery needs address on every packet. Connection-oriented delivery may use a short hand that shows the connection rather th

Illustrate addressing, Addressing Complicated addressing scheme because...

Addressing Complicated addressing scheme because there may be intermediate stations (APs), identified by flags

Which statement is true regarding half duplex, Half duplex is analogous to ...

Half duplex is analogous to a one a lane bridge, it can handle traffic in both directions but no at the similar time.

What is packet filter, What is packet filter? Packet filter is a standa...

What is packet filter? Packet filter is a standard router up to with some extra functionality. The extra functionality permits every incoming or outgoing packet to be inspected

Describe the star topology, QUESTION a) The aim of a computer network ...

QUESTION a) The aim of a computer network is to increase efficiency and reduce costs. Explain how networks of computers achieve the above. b) Describe the star topology. Su

What is the disadvantage of a star topology, What is the disadvantage of a ...

What is the disadvantage of a star topology? One major drawbacks of star topology is that once the central hub or switch get damaged, the whole network becomes unusable.

use dijkstras shortest-path algorithm compute short path, Consider the fol...

Consider the following network example. With the indicated link costs along each link in the figure, use Dijkstra's shortest-path algorithm to compute the shortest path from x to a

Byte number - transport layer, Byte Number TCP number all data  bytes ...

Byte Number TCP number all data  bytes that  are transmitted  in a connection. Numbering  is independent  in each direction when TCP receives bytes of data  a process. It stor

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

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