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

Sorting using interconnection networks, The combinational circuits use the ...

The combinational circuits use the comparators for comparing the storing and number them on the basis of minimum and maximum functions. Likewise, in the interconnection networks th

Classless addressing over classfull addressing scheme, What is the benefit ...

What is the benefit of using classless addressing over classfull addressing scheme?

Define tp monitor, There is no commonly accepted meaning for a TP monitor. ...

There is no commonly accepted meaning for a TP monitor. According to Jeri Edwards' a TP Monitor is "an OS for transaction processing".

Show the congestion avoidance in tcp, Q. Show the Congestion avoidance in T...

Q. Show the Congestion avoidance in TCP? Slow Start (SS) & Additive Increase (AI) (AI=Congestion Avoidance) start with the congestion window (cwnd) = max segment si

Explain how the LAN model be developed, Explain how the lan model be develo...

Explain how the lan model be developed The LAN model can be developed incrementally. If LAN is just a long cable. it cannot be brought down by single failure (if servers are re

What is domain name, Domain Name A domain name is a way to recognize an...

Domain Name A domain name is a way to recognize and locate computers connected to the Internet.  This is a text name of a computer in network or Internet. Domain names are chan

Show the use of flow control, Q. Show the Use of flow control? Flow co...

Q. Show the Use of flow control? Flow control denotes to a set of procedures used to restrict the amount of data that the sender can send before waiting for Error Control

What is quantum computing, In quantum computing, we use the method of qubit...

In quantum computing, we use the method of qubits, superposition and coherence. A normal bit can be in only two states - 0 and 1. But a qubit it can be in 0, 1, or in the superposi

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:

Explain about stored procedure, A stored procedure is a named collection of...

A stored procedure is a named collection of SQL statements and procedural logic that is compiled, verified and kept in a server database. It is typically treated like any other dat

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