Master construct program in parallel construct, Computer Networking

Assignment Help:

master construct

#include

extern float average(float,float,float);

void master_construct ( float* x, float* xold, int n, float tol )

 {

int c, i, toobig;

float error, y;

c = 0;

#pragma omp parallel

{

do{

#pragma omp for private(i)

for( i = 1; i < n-1; ++i ){

xold[i] = x[i];

}

#pragma omp single

{

toobig = 0;

}

#pragma omp for private(i,y,error) reduction(+:toobig)

for( i = 1; i < n-1; ++i ){

y = x[i];

x[i] = average( xold[i-1], x[i], xold[i+1] );

error = y - x[i];

if( error > tol || error < -tol ) ++toobig;

}

#pragma omp master

{

++c;

printf( "iteration %d, toobig=%d\n", c, toobig );

}

}while( toobig > 0 );

}

}


Related Discussions:- Master construct program in parallel construct

Determine about unique least-cost path, Determine about unique least-cost p...

Determine about unique least-cost path If there is a unique least-cost path, the two algorithms will yield the similar result because they are both guaranteed to search the lea

Binary addition, using binary adition, what is the result of 1010 + 10? Usi...

using binary adition, what is the result of 1010 + 10? Using binary addition, how would you repeatedly increment a number by 2?

Spanning tree protocol - ccna, Perform Basic Switch Configurations Step...

Perform Basic Switch Configurations Step 1: Cable a network that is similar to the one in the topology diagram.  You can use any current switch in your lab as long as it has

Addresses and connection identifiers, Address is a full unique identifier. ...

Address is a full unique identifier. Connectionless delivery needs address on every packet. Connection-oriented delivery may use a short hand that shows the connection rather th

Explain client and server networking model, Explain Client/Server Networkin...

Explain Client/Server Networking Model. A networking model where one or more powerful  computers (servers) give the dissimilar network services and all other user's computers (

Give example of the physical layer, FDDI, Token Ring and Ethernet are all p...

FDDI, Token Ring and Ethernet are all physical layer framing standards.

Security mechanism, How can the use of NAT and PAT, be considered a securit...

How can the use of NAT and PAT, be considered a security mechanism? Research the acronym(s) if it is not a part of your collection.

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