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
Question 1 Discuss the benefits and requirements of VOIP Question 2 Define the following Multicast routing protocol explain in detail with diagram Multicast backbone

QUESTION (a) In CSS, each element in a document is considered to be in an invisible box. Give three ways how to make the box visible (b) (i) Explain the meaning and use of t

Firewall is a device or a component that restricts access between a protected or an internal network from an external or untrustworthy network .A firewall basically limits unautho

State the list of protocols supported by the Intranet The following is the list of protocols supported by the Intranet: ARP: Address resolution Protocol is used to resol

DNS Message There are  the only  two kinds  of DNS message DNS query and reply messages. Further mote both query  and reply message have  the same  format  as shown in figure.

Write the Generic Name of the OSI Layer a)  The figures below illustrate, side by side, the OSI 7-layer reference model and the Internet protocol stack. Inside each box represen

Explain everything you can tell from the following: a. 00-01-00-01-13-FD-F4-C0-00-1E-33-92-CE-99 b. fe80::2c1e:18af:749b:91c5%12 c. 2002:8b64:6e3a::8b64:6e3a d. ::0

By utilizing measurements of the so-called pseudo range between an object and each of several earth orbiting GPS satellites, the object can be very accurately located in space. A g


Clients and Servers are dividing logical entities that work together over a network to accomplish a task. Many systems with very dissimilar architectures that are connected togethe