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

What is testing, Testing is used for estimate the quality of the product. U...

Testing is used for estimate the quality of the product. Unit Testing is tested for every part of the product. Integrate the unit & tested.

Header length - transport layer, Header  length This  field  speci...

Header  length This  field  specifies the  length of the TCP header  in 32 bit  words. This  information  allows  the receiver to know  the beginning of the data area becau

No retransmission - transport layer, No Retransmission This  protocols...

No Retransmission This  protocols  will not  through  the correctly received packets  but buffers than  and send  acknowledgment  for those packets. Thus  retransmission of th

What to do to connection with external communication, What to do to connect...

What to do to connection with external communication For dealing with external communication, the Web server must have a static IP. Having a static IP could also be a problemat

What can be done to fix signal attenuation problems, What can be done to fi...

What can be done to fix signal attenuation problems? A common way of dealing with like problem is to use repeaters and hub, because it will help regenerate the signal and thus

Describe the method of one way redistribution and mutual, Define  the conce...

Define  the concept of one way redistribution and mutual

Objectives of parallel programming, OBJECTIVES After reading this unit,...

OBJECTIVES After reading this unit, you should be able to: Describe the basics of parallel programming; Explain the parallel programming based on message passing;

Determine the term - backend lan, Determine the term - Backend LAN Back...

Determine the term - Backend LAN Backend networks are used to interconnect large systems like mainframes, supercomputers, and mass storage devices. The key needs here is for bu

Subtle point, It is possible for a datagram to generate ICMP errors after i...

It is possible for a datagram to generate ICMP errors after it has been fragmented. For example, suppose that each of two fragments cannot be delivered. Seemingly, this would mean

Application layer - computer network, Application Layer The  applicati...

Application Layer The  application layer is where  network  applications and their  application layer protocols  reside. The internet application layer includes many protocols

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