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
Command Structure: Commands are all-upper-case strings, either 4 or 6 characters in length. Table 1 shows the commands, and (for method commands) the parameters, return values, ex

Computer Networking 1. Explain different network structures in use. 2. Elaborate the architecture and usage of ISDN. 3. Discuss the concept of framing in Data Link Layer

What is the difference between a straight-through and crossover cable? A straight-through cable is used to connect computers to a hub, switch, or router. A crossover cable is u

what is max length of cable I can use

The Five steps to data encapsulation (IN ORDER): 1) User information is changed into data. 2) Data is changed into segments. 3) Segments are changed into datagram and pack

By using this command Router(config)# no cdp run we can disable CDP on the entire Router

Q. Show example on Hedge Fund? Hedge Fund have been playing a no-lose game In the easiest strategy a hedge fund borrows Hong Kong dollars (HKD) and then sells them in the

Ethernet Frame Fields Preamble - seven bytes of alternating 0s also 1s to notify receiver of incoming frame and to provide synchronization SFD (Start frame delimiter)

OBJECTIVES After studying this part, you should be able to: Explain the Metrics for Performance Evaluation; Notify about various Parallel System Overheads; Desc

restore the scrambled bits to their original order