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
Identify the 3 major functions at layer 3 of the OSI model Ans) Layer three explains the path, forwards the packet and executes software / logical addressing.

A fairly renowned approach in this area is OpenMP, a recently developed industry standard for shared memory programming on architectures with uniform memory access characteristics.

The most expensive method of accessing the Internet is to employ leased lines that directly connect to the ISP. This will enhance access rate to anywhere between 64 K and 1.5 Mbps,


Describe the functions and significances of all fields (such as Source Port and Destination Port) of a TCP header. Functions and significance of tcp header's fields FIELDS

What are the benefits of Networking? The following are the distinct notes in favor of computer networking. a. The computers, staff and information can be well managed b.



No Retransmission This  protocols  will not  through  the correctly received packets  but buffers than  and send  acknowledgment  for those packets. Thus  retransmission of th