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

Identify the purpose of the dlci, DLCI stands for Data Link Connection Iden...

DLCI stands for Data Link Connection Identifier. It identifies the local PVC.

Describe about packet switching, Q. Describe about Packet Switching? P...

Q. Describe about Packet Switching? Packet Switching - Data are transmitted in separate units - Called Packet - Packets are variable length blocks - The max leng

What are the internal threats - security, What are the Internal Threats ...

What are the Internal Threats Internal security problems are probably the most common. One never knows what someone is going to do. Even the most loyal employees or workers can

Error detection-- crc, Error Detection-- CRC Powerful error detecti...

Error Detection-- CRC Powerful error detection system Rather than addition, binary division is utilized A series of redundant bits called "CRC" or else "CRC remai

Assignment, Name the three ways or wireless data to be propagated.

Name the three ways or wireless data to be propagated.

Describe full-duplex transmission, Full Duplex - Capability for simultaneou...

Full Duplex - Capability for simultaneous data transmission among a sending station and a receiving station. It needs a workstation be attached to a switch, the NIC must support it

Determine the application areas of intranet, Determine the Application area...

Determine the Application areas of intranet The uses of an Intranet are only limited by imagination. Some of the larger sectors where the Intranet can be easily and success fu

Benefits of building up a well-designed intranet, Benefits of Building up a...

Benefits of Building up a well-designed Intranet Building up a well-designed Intranet can help the companies in the following activities that would improve their overall perfor

Determine the specification of fddi, FDDI has four specifications: 1. M...

FDDI has four specifications: 1. Media Access Control it defines how the medium is accessed 2. Physical Layer Protocol it defines data encoding/decoding procedures 3. Phy

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