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

Illustrate the working of networking bus topology, Illustrate the working o...

Illustrate the working of networking Bus Topology All stations attach, by appropriate hardware interfacing called as a tap, directly to a linear transmission medium, or bus. F

What is source routing, Q. What is Source Routing? Source Routing ...

Q. What is Source Routing? Source Routing - Sender of packet defines bridges and routes that packet should take - Complete path of bridge IDs and destination address i

Metrics for performance evaluation, Metrics For Performance Evaluation ...

Metrics For Performance Evaluation In this section, we would highlight different kinds of metrics involved for analyzing the performance of parallel algorithms for parallel co

What are the issues are there in network environment, What are the issues t...

What are the issues there in network environment Some of the issues necessary are: Network planning should be carried out covering the following important issues:

Objectives of operating system for parallel computer, Objective : After...

Objective : After going through this part you will be sure to explain the features of software and operating systems for parallel computers. In particular you should be able

Design a network security policy, SSK Software Corporation has opened an of...

SSK Software Corporation has opened an office in Toledo, Ohio. The office will have a wireless Wi-Fi (WLAN), and a Corporate wired Ethernet LAN. Workstation requirements are as

Discuss about lan topologies, Discuss about LAN topologies LAN topolog...

Discuss about LAN topologies LAN topologies:   Network topology is a physical schematic that demonstrates interconnection of the many users. There are four fundamental topolog

How does a token-passing protocol works, How does a Token-Passing Protocol ...

How does a Token-Passing Protocol works? The token-passing protocol relies on a control signal known as the token. A token is a 24-bit packet that circulates throughout the net

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