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
IEEE 802.3-Ethernet Introduction LAN (Local Area Network) - network connecting devices in a limited geographic area usually privately owned and limited to a single o

Question: (a) Do you agree with the following statements (specify your reasons to support your answer for each):- i) Policies are the foundation for the development of sta

Medium Earth Orbiting satellite is an orbit which is located just above the few hundred miles to a few thousands above the earth surface. It is of higher advantage than Low orbit s


Question 1 requires you to develop firewall rules based on a fictitious organisation. Scenario: You work for a security-conscious company, xC-Cure, who develop encryption t

What are the main features of TCP connections? Why is it said that TCP provides full-duplex service?

Advanced Interface Module (AIM) socket This is an 100 pin internal socket. It is provide for plug in the Advance interface module card. Purpose of AIM card is concentrate in th

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

TYPES OF PARALLEL PROGRAMMING There are several parallel programming models in common use. Some of these are: Message Passing; Data Parallel programming; Shared

what is software