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

Q. Evaluate Error Detection in CRC Polynomials? The divisor in the CRC generator is most habitually represented as an algebraic Polynomial. Reasons: It is short


Question 1: ‘There is an overwhelming imperative for organisations to analyse every bit of information they can extract from their huge data warehouses for competitive advant

Explain the basic of Network Properties   The subsequent properties are related with interconnection networks. 1)  Topology: It refers how the nodes a network are systema

INDEPENDENT Loops HPF gives additional opportunities for parallel implementation by using the INDEPENDENT directive to assert that the iterations of a do-loop can be done indep

Q. How is computer networks used in Financial services? Financial services:   Today's financial services are totally depended on networks. Application includes credit history

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

Repeaters - Operate only in physical layer - Connects two segments of the same LAN - Both segments must be of the same protocol - Only forwards frames; does not filter

Question : (a) How do you relate the subsequent terms in the context of an information system: data, information and decision-making. (b) Why do you think organisations nowa