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

Illustrate the advantages of VLANs, Q. Illustrate the Advantages of VLANs? ...

Q. Illustrate the Advantages of VLANs? - Cost and time reduction in moving stations from one group to another - Creation of virtual workgroups - Security Position of

What are the key functions of data link layer, What are the key functions o...

What are the key functions of data link layer? Data link layer transfers data in a structured and reliable manner so that the service given by the physical layer is utilized by

Advantages of mobile wireless network, Advantages of mobile wireless networ...

Advantages of mobile wireless network over a wired network is it is very much popular, it is very easy to set up, it requires a simple plug and the speed and reliability is very

Determine the uses of firewalls, Determine the uses of firewalls The fi...

Determine the uses of firewalls The firewalls available today do all the things, viz., like filter the data packets, provide proxy services and do stateful inspection of packet

Calculate the peak-to-peak voltage of the signal, A multimeter is used to m...

A multimeter is used to measure a sinusoidal signal and reads 2V RMS; what is the peak-to-peak voltage of the signal? A mark will be deducted if you do not quote your answer to 2 s

What is the frame, What is the Frame A presentation format, which en...

What is the Frame A presentation format, which enables Web page designers and users to mark a part of the screen for links to other pages. Frames usually appear on the left

Disadvantages of ip sec tunnelling mode, Disadvantages of IP sec  Tunnelli...

Disadvantages of IP sec  Tunnelling mode IP sec  tunnelling  mode has the  following  disadvantage a.Encryption of  small  packets  generates a lot  networks  over head  thu

Explain the term dimensionality of interconnection network, Dimensionality ...

Dimensionality of Interconnection Network Dimensionality refers the arrangement of processing elements or nodes in an interconnection network. In linear network or single dimen

What is the client side of applications, What is the client side of applica...

What is the client side of applications To build the client side of applications, developers use various tools. Some of the popular software development environments include Vi

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