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
What are the benefits of wireless devices One benefit is that if everyone uses standard, everyone can talk to anyone. Another benefit is that extensive use of any standard will

Name the two commands that save the running-config to a TFTP server Ans)  Two commands are:- a) copy running tftp  b) write network

Q. Describe Physical Layer in OSI layers model? Physical Layer : Controls the transmission of the actual data onto the network. It describes the electrical signals, line state

In distributed routing computation, every packet switch calculates its routing table locally and transmit messages to the neighbors. It also updates information regularly. If a pac

Q. Modem stands for modulator - demodulator ? - Modulator are to creates an analog signal from binary data - Demodulator are to recovers the binary data from the modulated s

What are local variables? Local varaiables are those which are declared within a block of code like methods. Local variables should be initialised before accessing them.

Identify the purpose of the TCP three step handshakes Ans) The three step handshake establishes the parameters needed for a TCP connection. During the handshake process series n

Consider the procedure described for estimating average delay di. Suppose that u=0.1. Let r1-t1 be the most recent sample delay, let     r2 -t2 be the next most recent sample delay

What is the difference between CSMA/CD and CSMA/CA? CSMA/CD, or Collision Detect, retransmits data frames when a collision occurred. CSMA/CA, or Collision Avoidance, will first

Fragmentation - Wireless environment is very noisy - Corrupt frames must be retransmitted - Large frames must be divided into smaller ones to increase efficiency