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
Questions: 1. A 5V Zener diode has a maximum power dissipation of 2W. What is the maximum current that can be safely passed through the device? 2. List three properties of a

What does a Standard IP Access-list use as test criteria Ans) Standard IP access list use only source address.

Mesh : This is two dimensional networks.  In this all processing elements are organised in a two dimensional grid. The processor in the row i and column j are indicated by PE i .

If the number of incoming clients invokes exceeds the number of processes in a server class, the TP Monitor might be dynamically start new ones and this is known as Load balancing.

10Base5 - Thicknet A rigid coaxial cable (RG-8) approx 0.4 in' thick used in the original Ethernet networks Bus topology LAN utilize base signalling with a maximum se

Explain the term FTP: File Transfer Protocol A very common method of moving files between two Internet sites. FTP is a special way to log in to another Internet site for pur

Connection Oriented Multiplexing And De multiplexing TCP socket  identified by 4 tuple: a.Source IP address b.Source port number c.Destination IP address d.Destina

Q. What do you mean by Flow Control? - How much data sender is capable to transmit before receiving the ACK - Why flow control? - Limitation with receiver 1. Processin

What do you mean by platform independence? Platform independence means that we can write and compile the java code in one platform (eg Windows) and can implement the class in a

Transmission Control Protocol - TCP is a connection oriented transport layer protocol with built unreliability. It considers a large block of data and breaks it down into segments