Construct with private and firstprivate clauses, Computer Networking

Assignment Help:

In this example we will see the use of parallel construct with private and firstprivate clauses. At the end of the program i and j remain undefined as these are private to thread in parallel construct.

#include

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 following example, each thread in the parallel region decides what part of the global array x to work on, based on the thread number.


Related Discussions:- Construct with private and firstprivate clauses

Objectives of performance evaluations, OBJECTIVES After studying this ...

OBJECTIVES After studying this part, you should be able to: Explain the Metrics for Performance Evaluation; Notify about various Parallel System Overheads; Desc

Illustrate stop-and-wait automatic repeat request, Q. Illustrate Stop-and-W...

Q. Illustrate Stop-and-Wait Automatic Repeat request? - Simplest flow as well as error control mechanism - The sending device keeps a duplicate copy of the last frame transm

Connection, how to connect two pc in lan?

how to connect two pc in lan?

What are the major technologies to create client application, What are the ...

What are the five major technologies that can be used to create Client/Server applications? Database Servers Groupware TP Monitors Distributed Objects Intranets.

Intradomain and interdomain routing protocols?, Describe the concept of int...

Describe the concept of intradomain and interdomain routing protocols?

Which layer is responsible for coordinating communication , Which layer is ...

Which layer is responsible for coordinating communication between systems Ans) The Session layer performs the following: Responsible for establishing and maintaining connections

Explain about the digital traffic channels, Explain about the Digital traff...

Explain about the Digital traffic channels The most notable difference among the two generations is that first generation systems are almost purely analog, while second generat

Install, how to install xp via network

how to install xp via network

What is meant by transparency, Transparency really means adumbrating the ne...

Transparency really means adumbrating the network and its servers from the users and even the application programmers.

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