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
Describe difference among Single path and Multipath?

FDDI Media Access Control Unlike CSMA/CD networks such like Ethernet token-passing networks are deterministic--you are able to calculate the maximum time that will pass before


Determine about the TCP/IP Stands for Transmission Control Protocol/Internet Protocol. This is the group of protocols that define the Internet and communication method used

Explain the cost of a path between two nodes Given a network of nodes linked by bidirectional links, where every link has a cost associated with it in each direction, explain t

Computer Networks 1. Differentiate WAN and LAN. 2. Describe the TCP/IP Reference Model with diagram. 3. Explain Circuit switching and message switching. 4. List the fu

Question : (a) List down and explain the different signal propagation behaviours that radio waves exhibit. (b) Explain the term Delay Spread with reference to signal propaga

Q. What is Bus Topology?  Multipoint configuration  One cable acts like a backbone to link all devices   Advantages: Effortlessness of installation and less cabling

Layers, Massages, Segments, Datagram's and Frames Figure 2.15 show the physical  path data takes down a  sending  end  systems  protocol  stack up and  down the  protocol stac

What is redirector in Networking? Redirector is software that intercepts file or prints I/O requests and changes them into network requests. This comes under presentation layer