Master construct program in parallel construct, Computer Networking

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 );

}

}

Posted Date: 3/4/2013 5:24:34 AM | Location : United States







Related Discussions:- Master construct program in parallel construct, Assignment Help, Ask Question on Master construct program in parallel construct, Get Answer, Expert's Help, Master construct program in parallel construct Discussions

Write discussion on Master construct program in parallel construct
Your posts are moderated
Related Questions

Firewall The NAT router allows receiving of number of a data streams. If it receives a transmission in the form of acknowledgement or data streams or error responses from an ex

WHAT IS NETWORK???

There are two logical addressing :- a) Datalink is physical (hardware) addressing. b) Network is logical (software) addressing.

Torus: The mesh network with wrap around connections is termed as Tours Network. Figure: Torus network

Why Does metric translation takes place in redistributing routes?


Processor Arrangements It is a very frequent event in data parallel programming to group a number of processors to perform definite tasks. To reach this goal, HPF gives a direc

What common software problems can lead to network defects? Software related problems can be any or a combination of the following: - Client server problems - Application

What is anonymous FTP? Anonymous FTP is a way of granting user access to files in public servers. Users that are permitted access to data in these servers do not require identi