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

Obtain 1''s and 2''s complement, Obtain 1's and 2's complement of 1010 usin...

Obtain 1's and 2's complement of 1010 using only four-digit representation. Solution: 1's complement: 1's complement of 1010 is  Please note that wherever you ha

First-order inference rules, First-Order Inference Rules: Here now we ...

First-Order Inference Rules: Here now we have a clear definition of a first-order model is that we can define soundness for first-order inference rules in the same way such we

Define peripheral, Define peripheral. Devices that are under the direct...

Define peripheral. Devices that are under the direct control of computer are said to be linked online. These devices are intended to read information into or out of the memory

Explain metadata, What is metadata? Metadata is data that explains anot...

What is metadata? Metadata is data that explains another data. Class definition is metadata. Models are inherently metadata as they explain the things being modeled.

Give examples of different parameter-passing mechanisms, Explain different ...

Explain different parameter passing mechanisms to a function with the help of example? The different parameter-passing mechanisms are given below: 1.   Call by value 2.

Explain about open system, Q. Explain about Open System? The 'Open Syst...

Q. Explain about Open System? The 'Open System' is a system within its environment. It receives input from environment as well as provides output to environment.  Illustrati

Define interrupt processing, Q. Define Interrupt Processing? On complet...

Q. Define Interrupt Processing? On completion of execution of an instruction machine checks whether there is any pending interrupt request for interrupts which are enabled. If

Two layer artificial neural networks, Two Layer Artificial Neural Networks:...

Two Layer Artificial Neural Networks: However decision trees are whenever powerful they are as a simple representation scheme. Whereas graphical on the surface that they can b

Execution of a program in cpu, Execution of a program in CPU is completed e...

Execution of a program in CPU is completed employing different set of registers and their individual circuitry. As CPU registers are used for execution of interrupt service routine

Explain the structure of virtual enterprise, Explain the Structure of Virtu...

Explain the Structure of Virtual Enterprise. The virtual enterprise can be a suitable structure to explore the emerging opportunities for forming value in the information socie

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