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
PVM uses two environment variables when starting and running. Every PVM user needs to set these two variables to use PVM. The initial variable is PVM_ROOT, which is set to the loca

Recognize the command that shows traffic statistics on serial0/1? Ans) show interface serial 0/1

The bitonic sorting network needed log n number of stages for performing the task of sorting the list. The first n-1 stages of the circuit are able to sort two n/2 numbers and the

One of the most popular models for designing parallel algorithms is PRAM (Parallel Random Access Machine). A PRAM consists of unbounded number of processors interrelating with each

Network Allocation Vector Timer which shows how much time must pass before a station is allowed to check the channel

How many ways are there to execute VPN architecture?

Router(config-if)# no cdp enable is the  command to disable CDP on an interface

Determine the concept of placing antenna on hieght First, starting deployment simply placed cells in regions where there was high density of vehicle or human population. Once t

Explain twisted pair cable. A pair of wires twisted with each other is CALLED as twisted pair cable.  A set of four pairs of twisted wires are bundled to form cable. These are