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
Features of FDM 1.The FDM channel carries  only  one phone  circuit  at a time. 2.If an FDM channel is not in sue then  it is  sits idle and cannot be   used by  other user

OBJECTIVES After reading this unit, you should be able to: Describe the basics of parallel programming; Explain the parallel programming based on message passing;

LOW-Earth Orbiting have more advantageous in Mobile based communication devices like PDAs, Cell phones and automobile communications. The LOW-Earth Orbiting is a satellite of orbit

Submission instructions: Answer the following questions using a text processing software and submit your answers via connex. Possible file formats for your submission file(s) are .

It treats all processors as equivalent. Any processor can do the work of any other processor. Applications are separated into threads that can run simultaneously on any available p

Problem 1: (a) Briefly explain each of the following wireless standards: (i) WiFi (ii) WiMAX (iii) 3G. Problem 2: (b) Bluetooth is an industrial specific

DNS cache poisoning The DNA cache poisoning generally refers to the process of maintaining or developing the false information, in the cache of DNS server. This process refers

Q. Show the Congestion avoidance in TCP? Slow Start (SS) & Additive Increase (AI) (AI=Congestion Avoidance) start with the congestion window (cwnd) = max segment si


Brigdes Introduction - LAN may require to cover more distance than the media can handle effectively or - Number of stations may perhaps be too great for efficient frame d