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

Top level domain servers, TOP Level Domain  (TLD) Servers These  serve...

TOP Level Domain  (TLD) Servers These  servers are responsible  for top  level  domains such  as com org net edu, and  going  and all  the country  top level  domains  such  a

What is difference among arp and rarp, What is difference among ARP and RAR...

What is difference among ARP and RARP? The address resolution protocol (ARP) is used to associate the 32 bit IP address with the 48 bit physical address, used by a host or a ro

Explain the term dimensionality of interconnection network, Dimensionality ...

Dimensionality of Interconnection Network Dimensionality refers the arrangement of processing elements or nodes in an interconnection network. In linear network or single dimen

Which layer is responsible for framing, The Data link layer performs the fo...

The Data link layer performs the following: Responsible for physically passing data from single node to another. Translates messages from the upper layers into data frames and adds

Network Fundamentals, I need help in designing a network for a fictional co...

I need help in designing a network for a fictional company.

Topologies, discuss communication isolation and privatization in network to...

discuss communication isolation and privatization in network topologies

What is remote procedure call, What is Remote Procedure Call (RPC)? RPC...

What is Remote Procedure Call (RPC)? RPC hides the intricacies of the network by using the ordinary process call mechanism familiar to every programmer. A client process calls

Example of parallel sections construct, This example demonstrates the use o...

This example demonstrates the use of parallel sections construct. The three functions, fun1, fun2, and fun3, all can be executed concurrently.  Note that all the section directives

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