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

Repeaters, REPEATERS:  Repeaters are needed when copper wire communica...

REPEATERS:  Repeaters are needed when copper wire communication is takes place. According to the fact that electrical signal goes weaker while travelling over copper lines. A

Network, What are the main features of TCP connections? Why is it said that...

What are the main features of TCP connections? Why is it said that TCP provides full-duplex service?

Tunnelling - point to point, Tunnelling To guarantee privacy for the  o...

Tunnelling To guarantee privacy for the  organization, VPN specifies that each IP datagram destined for private  use of the  organization, must  first be  encrypted and then en

Describe the following topics, Describe the following topics A . LAN B . M...

Describe the following topics A . LAN B . MAN C . WAN D . ARPANET

Name the 10base5 connectors, 10Base5 Connectors Transceiver - inter...

10Base5 Connectors Transceiver - intermediary device as well called a medium attachment unit (MAU) Performs CSMA/CD function may perhaps contain small buffer Atta

Hyper text transfer protocols ( http), Hyper  Text Transfer Protocols ( HT...

Hyper  Text Transfer Protocols ( HTTP) The Hyper text  protocols ( HTTP) is at  the heart  of the  web. If a browser  developer follows  the rules  of the HTTP, the  browser w

What is tdm, What is TDM? TDM is a digital process that can be applied ...

What is TDM? TDM is a digital process that can be applied when the data rate capacity of the transmission medium is greater than the data rate needed by the sending and receivi

What is the difference among tftp and ftp application, What is the differen...

What is the difference among TFTP and FTP application layer protocols? The Trivial File Transfer Protocol (TFTP) permits a local host to get files from a remote host but does n

sorting circuit along with odd-even merging circuit, As we previously know...

As we previously know, the merge sort algorithm needs two circuits, i.e. one for merging and second for sorting the sequences. Thus, the sorting circuit has been derived from the a

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