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

Give the structure of an atm uni cell header, a) Consider a hypothetical a...

a) Consider a hypothetical arrangement of ‘self-learning' bridges shown in the figure below. Assuming all are initially empty, give the forwarding tables for each of the bridges B

Distributed data processing, In distributed data processing, explain two sc...

In distributed data processing, explain two scenarios where vertical partitioning and horizontal partitioning are used. Distributed Data Processing The distributed data pro

Encoding data options in parallel virtual machine , Encoding data options ...

Encoding data options PVM uses SUN's XDR library to generate a machine independent data format if you request it. Settings for the encoding option are: PvmDataDefault: Use X

Go back-n ( gbn) - transport layer, Go Back ( GBN) Go back  N ARQ is s...

Go Back ( GBN) Go back  N ARQ is specific  instance of the  automatic  repeat request protocols  in which  the sending  process continues to send  a number of frames specific

Describe network topology and vpn, Describe Network Topology and VPN Ne...

Describe Network Topology and VPN Network Topology refers to the layout of a computer network. It presents how devices and cables are physically laid out, as well as how they j

Importance of clientsin intranet server, Importace of Clientsin intranet se...

Importace of Clientsin intranet server The most interesting thing is that almost every computer can be connected as a client to the Intranet server. The client could be based

Elaborate the term - database connectivity, Elaborate the term - Database C...

Elaborate the term - Database Connectivity Basic connectivity A number of database management systems are available today such as the Oracle, Sybase, Ingres, etc. Most

Difference among flow control and error control, What is the difference am...

What is the difference among  flow control and error control?    Ans) Flow control: adjust and confirm data flow rate for successful transmission. Error Control: a method to

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