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

Show the importance of risc processors, Q. Show the Importance of RISC Proc...

Q. Show the Importance of RISC Processors? Reduced Instruction Set Computers recognize a comparatively limited number of instructions. One benefit of a reduced instruction set

Define the working of flip flops, Define the working of Flip Flops? Fli...

Define the working of Flip Flops? Flip flop is the basic unit of storage this is used to store one bit of information. Flip-flops are the synchronous bistable devices. The term

Electric typewriter in information distribution, Electric typewriter : Ele...

Electric typewriter : Electric typewriters are similar to standard typewriters but with an electronic motor taking the place of human energy. It is much faster than the standard m

Explain disadvantage of optimal page replacement algorithm, Explain Disadva...

Explain Disadvantage of Optimal Page Replacement Algorithm Optimal page replacement algorithm cannot be implemented in the general purpose operating system as it is impossible

Documentation introduction, Documentation is done to give others with infor...

Documentation is done to give others with information and ease maintenance. The best documentation is done in the headers (function and scripts) and directly in the code. Any usefu

Explain the importance of object oriented modelling, Explain the importance...

Explain the importance of Object Oriented Modelling It is important to note that wi t h the growing complexity of systems, significance of modelling techniques increases. Beca

What is configuration, What is configuration?  Turing  machine  compute...

What is configuration?  Turing  machine  computes,  changes  occur  in  the  current  state,  the  current  tap contents  and  the  current  head  location. A  setting  of  the

Draw the logic diagram of 4-bit odd parity checkers, Normal 0 f...

Normal 0 false false false EN-IN X-NONE X-NONE

Multi-threaded processors, Multi-Threaded Processors In unit 2, we have...

Multi-Threaded Processors In unit 2, we have gone through the use of distributed shared memory in parallel computer architecture. Although the use of distributed shared memory

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