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

Explain disk cartridges, Q. Explain Disk Cartridges ? Disk Cartridges:...

Q. Explain Disk Cartridges ? Disk Cartridges: Removable disk cartridges are an option to hard disk units as a form of secondary storage. Cartridge generally comprises one or

Draw back of assigning one bit position to control signals, What is the dra...

What is the draw back of assigning one bit position to each control signals? Assigning individual bits to every control signal results in long microinstructions due to the numb

Subscript and an index in a table definition, What is the difference betwee...

What is the difference between a subscript and an index in a table definition? Ans) A subscript is a working storage data definition item, typically a PIC (999) where a value mu

What are the various functional verification methodologies, What are the va...

What are the various functional verification methodologies Ans: TLM (Transaction Level Modelling) Linting RTL Simulation (Environment  involving  :  stimulus  generators,

Why stored program control gains superiority over hard wired, In what way i...

In what way is stored program control superior to hard wired control? The SPC gains superiority over hard wired because of following points: SP C Ha

History of information technology and organisations, History of Information...

History of Information Technology and Organisations The increasing sophistication in information systems and the growth in their use have been influenced by three main factors

stores on each line a part number, Make a file "parts_inv.dat" that stores...

Make a file "parts_inv.dat" that stores on each line a part number, cost, and quantity in inventory, e.g.: 123 5.99 52 456 3.97 100 333 2.22 567 Use fscanf to read this infor

What is a multiple line field, What is a multiple line field? A multipl...

What is a multiple line field? A multiple line field is a special part of field which allows the user to enter multiple lines of data into it.

Explain level of a node, Level of a node The root is at level zero and ...

Level of a node The root is at level zero and the level of the node is 1 more than the level of its parent

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