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

Path overhead - sonet sdh , Path  Overhead It is part  of SPE  and con...

Path  Overhead It is part  of SPE  and contain followings  information: Performance monitor of synchronous transport , signal , path , track ,parity ,checks,  and path  status.

Configure ip settings for the linksys wrt300n- ccna, Configure IP Settings ...

Configure IP Settings for the Linksys WRT300N The best way to understand the following settings is to think of the WRT300N as being same to a Cisco IOS-based router with two di

Differentiate between fast fading and slow fading, Differentiate between Fa...

Differentiate between Fast fading and Slow fading Fast fading refers to changes in signal strength among a transmitter and receiver as the distance among the two changes by a s

Physical addressing in a wan, PHYSICAL ADDRESSING IN A WAN:  The physi...

PHYSICAL ADDRESSING IN A WAN:  The physical addressing in a WAN is same as in LAN in the following way: The data is send in packets equivalent to frames. Every pack

What is primary and secondary ring - fddi, What is primary and secondary ri...

What is primary and secondary ring One of the two FDDI rings is known as the primary ring; the other is called the secondary ring. The primary ring is utilized for data tra

Recognize the command that shows the sap table, show ipx servers is the co...

show ipx servers is the command that shows the SAP table

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

Explain the power of semantic web languages, What is the Power Of Semantic ...

What is the Power Of Semantic Web Languages? Ans) The major power of Semantic Web languages is that anyone can create one, simply by publishing some RDF that defines a set of

Determine the concept of placing antenna on hieght, Determine the concept o...

Determine the concept of placing antenna on hieght First, starting deployment simply placed cells in regions where there was high density of vehicle or human population. Once t

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