Construct with private and firstprivate clauses, Computer Networking

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.

Posted Date: 3/4/2013 5:20:35 AM | Location : United States







Related Discussions:- Construct with private and firstprivate clauses, Assignment Help, Ask Question on Construct with private and firstprivate clauses, Get Answer, Expert's Help, Construct with private and firstprivate clauses Discussions

Write discussion on Construct with private and firstprivate clauses
Your posts are moderated
Related Questions
Internet  Protocols  Control Protocols ( IPCP)  The  internet  protocols  control protocols  establishes  configures and terminates the TCP/ IP network  protocols  layer in a PPP


Explain Asynchronous FDDI Asynchronous bandwidth is allocated utilizing an eight-level priority scheme. Every station is assigned an asynchronous priority level. FDDI as wel

Explain teh term- Bits and Bitmap Many tiny dots, which are put together to make a picture. Bits are combined to make a graphic image called a bitmap. GIF and JPEG files are

How an Ethernet Worked? The operation of Ethernet can be explained in simple terms as follows: Each computer on the Ethernet Network, also called as a node, operates indepen

What is Redundancy? The method of including extra information in the transmission solely for the purpose of comparison. This technique is known as redundancy.

High Availability Oracle web  cache supports  content  aware  load  balancing  and fail  over  detection. The  features ensure that cache messes are directed to the most  avai

What is Connection-oriented communication Connection-oriented communication can be in three phases. In establishment phase a request is made to set up the connection. Only afte

What are MAC addresses? MAC, or Media Access Control, uniquely identifies a device on the network. It is also called as physical address or Ethernet address. A MAC address is m

The table below gives a summary of special IP addresses.