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
Ring: It is a simple linear array where end nodes are associated.  It is equal to a mesh with wrap around connections.  The data transfer in a ring is generally one direction. So,

How can you identify the IP class of a given IP address? By looking at the first octet of any given IP address, you can recognize whether it's Class A, B or C. If the first oct

Normal 0 false false false EN-IN X-NONE X-NONE Networks classification

Q. Describe Flow and Error Control Mechanisms? Flow and Error Control Mechanisms - Stop and Wait ARQ - Go-Back ARQ - Selective Repeat ARQ

Can you describe transport and tunnel mode in detail with datagram packets?

The following DNA sequences are extracted from promoter region of genes which are co-regulated by the same transcription factor (TF). The nucleotide segments capitalized in the giv

What is Synchronous TDM? In STDM, the multiplexer allocates exactly the same time slot to every device at all times, whether or not a device has anything to transmit.

User Server Interaction Cookies of the world  wide  web  was originally designed  as a stateess entity. A client  sends a request and the server responds. Their  relationship

What is mesh network? A network in which there are many network links among computers to provide multiple paths for data to travel.

Sequence Number After  the bytes have been numbered TCP assigns a sequence number to each segment   that is  being sent. These sequence number for each segment  is the numb