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

State the drawbacks of laptop as compared to PC, State the drawbacks of lap...

State the drawbacks of laptop compared to PC The main disadvantages of laptops compared to desk top PCs are: -  They tend to be more expensive to purchase -  It's easie

How does vb.net achieve polymorphism, How does VB.NET/C# achieve polymorphi...

How does VB.NET/C# achieve polymorphism?  VB.Net / C# provide polymorphism through the following mechanisms: 1. Inheritance - base class gives overridable methods which ar

Interrupt and scanning method of keypad operation, INTERRUPT METHOD - USING...

INTERRUPT METHOD - USING PORTB CHANGE INTERRUPT By using 4 by 4 matrix keypad connected to PORTA and PORTB. The rows are connected to PORTA-Low (RA1-RA4) and the columns are co

Targeting for new business, Assume you own your own small party supply and ...

Assume you own your own small party supply and rental business. You keep an Excel list of potential customers and clients who have rented or purchased from you in the past 2 years.

What is meant by a priority encoder, What is meant by a priority encoder? ...

What is meant by a priority encoder? Ans: Priority encoder- Basically an encoder is a combinational circuit which performs the inverse operation of a decoder. The input c

What do you mean by program counter, Q. What do you mean by Program Counter...

Q. What do you mean by Program Counter? Program Counter (PC): It determines the instruction that is to be executed next which means after the execution of an on-going instructi

Define object oriented and structured development, How object oriented deve...

How object oriented development is dissimilar from structured development object oriented development is dissimilar from structured development of the system. In the structure

What will occur when contents of register are shifter left, What will occur...

What will occur when contents of register are shifter left, right? This is well known that into left shift all bits will be shifted left and LSB will be appended along with 0 a

Prior conditions - logic programs, Prior Conditions - Logic programs: ...

Prior Conditions - Logic programs: However firstly there we must make sure that our problem has a solution. Whether one of the negative examples can be proved to be true from

Artificial life - artificial intelligence, Artificial Life - artificial int...

Artificial Life - artificial intelligence: Give birth to new exits forms.  A swot of Artificial Life will certainly direct on what it means for a complex system to be 'aliv

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