Use of parallel construct with private clause, Computer Engineering

Assignment Help:

Q. Use of parallel construct with private clause?

In this example we would see use of parallel construct with private and firstprivate clauses. At end of program i and j remain undefined because these are private to thread in parallel construct.  

#include < stdio.h >

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 subsequent illustration every thread in parallel region determines what part of global array x to work on based on thread number.


Related Discussions:- Use of parallel construct with private clause

Complex micro-controller, The 68Hc11 is actually a complex micro-controller...

The 68Hc11 is actually a complex micro-controller its contains internally RAM, EEPROM, Parallel IO and serial ports, hardware timers and a 8 channel ADC.  The internal structure is

Illustrate lcd technology, Q. Illustrate LCD Technology? The technology...

Q. Illustrate LCD Technology? The technology behind LCD is known as Nematic Technology since the molecules of liquid crystals used are nematic which implies that rod-shaped. Th

Where time synchronization is necessary, Time synchronization is necessary ...

Time synchronization is necessary in? Time synchronization is essential in TDM.

What do you mean by data warehousing, What do you mean by data warehousing?...

What do you mean by data warehousing? Data warehouse implies as: a) It is subject oriented b) It is integrated and c) It is time variant d) It is non-volatile colle

Device drivers in ms-dos, In MS-DOS device drivers are installed and loaded...

In MS-DOS device drivers are installed and loaded dynamically it implies that they are loaded into memory when computer is started or re-booted and accessed by operating system as

Over fitting considerations, Over fitting Considerations : Hence in le...

Over fitting Considerations : Hence in left unchecked there backpropagation in multi-layer networks can be highly susceptible to overfitting itself to the training examples. B

What is cache coherency, Cache coherence refers to the integrity of data st...

Cache coherence refers to the integrity of data stored in local caches of a shared resource. Cache coherence is a special case of memory coherence. When clients in a system, mainly

Explain the architecture of ss7, Explain the architecture of SS7 . A ...

Explain the architecture of SS7 . A block schematic diagram of the CCITT no. 7 signaling system is demonstrated in figure. Signal messages are passed by the central proces

Difference between static and dynamic RAM, Difference between static and dy...

Difference between static and dynamic RAM. Draw the circuits of one cell of each and explain its working. Ans: Differentiation among Static RAM and Dynamic RAM: Static

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