Construct with private and firstprivate clauses, Computer Networking

Assignment Help:

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.


Related Discussions:- Construct with private and firstprivate clauses

Comparison and contrast between the osi and tcp-ip model, Q. Comparison and...

Q. Comparison and Contrast between the OSI and TCP-IP Model? This presentation would discuss a few comparison and contrast between the 2 main reference models which use the con

Explain priority and reservation of token passing, Priority and Reservation...

Priority and Reservation Higher priority stations may possibly access the token sooner Each station has a priority code Since token passes by station waiting to t

What are the fundamentals of intranet, Fundamentals of intranet Introd...

Fundamentals of intranet Introduction The history of the Intranet starts right from the days when computer networks came in. However, it could find a name and place for it

Describe the tcp/ip reference model, Computer Networks 1. Differentiate...

Computer Networks 1. Differentiate WAN and LAN. 2. Describe the TCP/IP Reference Model with diagram. 3. Explain Circuit switching and message switching. 4. List the fu

What is shielded twisted pair, Q. What is Shielded Twisted Pair? - A me...

Q. What is Shielded Twisted Pair? - A metal foil or braided-mesh covering encases every pair of insulated conductors to prevent electromagnetic noise called crosstalk - Cros

Types of redundancy checks, Types of Redundancy Checks Parity Check ...

Types of Redundancy Checks Parity Check Simple Parity Check Two Dimensional Parity Check / Longitudinal Redundancy Check (LRC) CRC (Cyclic Redundancy Check)

Explain different protocols of internet, WEB TECHNOLOGY 1. Explain diff...

WEB TECHNOLOGY 1. Explain different protocols of internet. 2. Differentiate between DHTML and HTML. 3. What do you understand by Event-driven Programming? Classify differ

What is uniform delivery time, What is uniform delivery time A uniform ...

What is uniform delivery time A uniform delivery time is required for voice, so amount of jitter in net- work is significant. This could be expressed as standard deviation of d

Lan hardware and packet filtering, LAN HARDWARE AND PACKET FILTERING: ...

LAN HARDWARE AND PACKET FILTERING: The diagram below explain the LAN hardware LAN INTERFACE:  LAN interface operates all details of frame reception and transmis

Determine 802.11a OFDM, 802.11a OFDM a) Orthogonal frequency-division m...

802.11a OFDM a) Orthogonal frequency-division multiplexing utilizing a 5-GHz band b) Same as FDM except all sub bands are used by only one source at a given time c)  Secu

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd