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

What is the structure of ip multicast address, Question : (a) Several ...

Question : (a) Several techniques are now available for users to connect to the Internet. (i) A modem is commonly used to dial up to the Internet. Why is a modem needed fo

My Printer, Cannot print from Computer recently

Cannot print from Computer recently

Wideband digital cross connects, Wideband Digital Cross Connects A SONE...

Wideband Digital Cross Connects A SONET  cross  connect  accepts  various  optical  carries  rates accesses the  STS signals  and switches at this level . it  is idally used at

Which layer defines the physical topology, The Physical layer deals with th...

The Physical layer deals with the definite physical medium and the method of transporting 1s and 0s.

Determine the working of lan within a corporate network, Determine the work...

Determine the working of LAN within a corporate network It should be very clear right from the beginning that a firewall is not simply for protecting a corporate network from u

The world wide web http, The World  Wide Web HTTP The Hyper text Tran...

The World  Wide Web HTTP The Hyper text Transfer Protocols( HTTP) is a protocols  used mainly to  access data on the world  wide  web. HTTP functions as a carbonation of FTP(

Fiber distributed data interface, Question 1 Write short notes on (i) F...

Question 1 Write short notes on (i) Fiber Distributed Data Interface (ii) Serial Line Question 2 Explain Internet layer and transport layer Internet layer Tran

System deadlock in shared programme structures, System Deadlock A dead...

System Deadlock A deadlock refers to the situation when simultaneous processes are holding resources and preventing each other from completing their implementation. The fol

Master construct program in parallel construct, master construct #incl...

master construct #include extern float average(float,float,float); void master_construct ( float* x, float* xold, int n, float tol )  { int c, i, toobig; floa

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