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

Criteria for selecting a theme for a project, Q. Criteria for selecting a t...

Q. Criteria for selecting a theme for a project? Topics for projects as we indicated earlier should emerge from the children's world. Teaching often becomes boring and unintere

Explain parameter passing in procedures, Q. Explain Parameter Passing in Pr...

Q. Explain Parameter Passing in Procedures? Parameter passing is a very vital concept in assembly language. It makes assembly procedures more general. Parameter can be passed t

Discuss various enhanced services of stored program control, Discuss the va...

Discuss the various enhanced services that can be made available to the subscribers because of stored program control. One of the instant benefits of stored program control is

Megaflops, Speed in scientific computing is measured in megaflops, gigaflop...

Speed in scientific computing is measured in megaflops, gigaflops, teraflops and petaflops. A megaflop is 10 6 floating point arithmetic operations (+, -, *, /) in one second What

What are the techniques of data collection, What are the techniques of Data...

What are the techniques of Data Collection It can be either automatic or manual. Manual techniques can include: -  Keypads/Keyboards to type in data -  touch screens to s

Determine number of final selector in 10000 line exchange, In a 10000 line ...

In a 10000 line exchange, 0000 to 2999 is allotted to x group of subscribers, out of which 40% are active during busy hour. The remaining numbers are domestic numbers out of which

How to use an assembler, Q. How to use an Assembler? Symbolic instructi...

Q. How to use an Assembler? Symbolic instructions which we code in assembly language is called as- Source program. An assembler program translates source program in machine

Input - output devices using device controller, Q. Input - output Devices u...

Q. Input - output Devices using Device Controller? A device controller needs not to necessarily control a single device. It can typically control multiple I/O devices. It come

Write the truth table and simplify karnaugh map, For F = A.B.C + B.C.D ...

For F = A.B.C + B.C.D ‾ + A‾.B.C ,  write  the  truth  table and simplify using Karnaugh map . And. Simplification of Logic Function F = A B C + B C‾ D + A‾ B C. Therefore the

Explain about heterogeneous linked list, If you are using C language to imp...

If you are using C language to implement the heterogeneous linked list, what pointer type will you use? The heterogeneous linked list having different data types in its nodes a

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