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

Ip checksum, This code properly implements the IP checksum function on a 32...

This code properly implements the IP checksum function on a 32-bit machine: unsigned short cksum(unsigned short *buf, int count) { unsigned long sum = 0; while (count--) { sum += *

Discuss about the latest internet and intranet technologies, Latest Interne...

Latest Internet and Intranet technologies Even though the security capabilities of the latest Internet and Intranet technologies have enabled the companies to control the avail

Define the term - hot swapping, Define the term - Hot swapping The rel...

Define the term - Hot swapping The reliability of the machine can be dramatically improved by installing the best components. Hot swapping is a concept through which component

LAN, categories of LAN

categories of LAN

What is boundary level masking, Q. What is Boundary Level Masking? ...

Q. What is Boundary Level Masking? If mask numbers are either 255 or 0: Bytes in the IP address that correspond to 255 in the mask will be repeated in the subnet ma

Dynamic configuration and signaling, Dynamic Configuration int pvm...

Dynamic Configuration int pvm_addhosts( char **hosts, int nhost, int *infos ) Add hosts to the virtual machine. hosts is an array of strings naming the hosts to be

Difference between tftp and ftp application layer protocols, What is the di...

What is the difference between TFTP and FTP application layer protocols? The Trivial File Transfer Protocol (TFTP) allows a local host to obtain files from a remote host but d

Internet infrastructure, Thus now you know how packets travel from one comp...

Thus now you know how packets travel from one computer to another computer over the Internet. however what's in-between? What in fact makes up the Internet infrastructure or backbo

What is round trip time, What is Round Trip Time? The duration of time ...

What is Round Trip Time? The duration of time it takes to send a message from one end of a network to the other and back, is known as RTT.

Describe smtp, a) Used for sending e-mail. b) Uses port 25.

a) Used for sending e-mail. b) Uses port 25.

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