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

Synchronous tdm and statistical tdm, Difference between synchronous tdm and...

Difference between synchronous tdm and statistical tdm

Determine the mean node-node path, Mean node-node path The mean node-no...

Mean node-node path The mean node-node path is two times the mean node-root path.  Number the levels of the tree with the root as 1 and the deepest level as N.  The path from t

Role of software in intranet, Role of Software in Intranet For an Intr...

Role of Software in Intranet For an Intranet to be successful, it must have strong software support. In this section, a brief description of the operating system, groupware an

Introduction-parallel algorithms, Introduction An algorithm is defined ...

Introduction An algorithm is defined as a series of computational steps required to accomplish an exact task. The algorithm works for a given input and will terminate in a well

Case study, Scenario: Your Case Study must be based on the information prov...

Scenario: Your Case Study must be based on the information provided. There will be no additional information. This must be submitted in a .doc, or .pdf format. If you send a few

Explain about data link layer sub layers, Data Link Layer Sub layers ·  L...

Data Link Layer Sub layers ·  Logical Link Control (LLC) - upper layer · Handles control information, logical addressing and data · MAC (Medium Access Control) - lower layer ·

What are the important topologies for networks, What are the important topo...

What are the important topologies for networks? BUS topology: In this every computer is directly linked to primary network cable in a single line. Advantages: Inexpensive,

Networking security, difference between spambox and inbox in gmail

difference between spambox and inbox in gmail

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