Master construct program in parallel construct, Computer Networking

Assignment Help:

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

}

}


Related Discussions:- Master construct program in parallel construct

Transport layer protocols , TCP (Transmission Control Protocol) and UDP are...

TCP (Transmission Control Protocol) and UDP are used by TCP/IP. SPX (Sequenced Packet Exchange) is used with IPX. NBP (Name Binding Protocol) is used with Appletalk.

Define unicast - multicast and reserved addresses, Q. Define Unicast - Mult...

Q. Define Unicast - Multicast and Reserved Addresses? Unicast, Multicast, and Reserved Addresses Unicast address - identifies a specific device Multicast address

IPV6, is DVMRP multicast prtocol supports IPV6?

is DVMRP multicast prtocol supports IPV6?

What are the disadvantages of bus topology, What are the disadvantages of b...

What are the disadvantages of bus topology? The disadvantages of bus topology are: a. The bus networks are dissimilar to reconfigure, especially when the acceptable number o

Determine the signal bandwidth and the amplitudes, 1. A low voltage digital...

1. A low voltage digital device has a low state of 0 V and a high state of 1.8 V. It generates a signal train of high pulses at a rate of 1 MHz, these pulses having a 10 ns width a

Networking services, Your Windows client failed to broadcast to all servers...

Your Windows client failed to broadcast to all servers that it has accepted an IP address offer. What step is this in the four-step DORA process? a. Discovery b. Offering c. Reques

Different types of subnet classfull networks are present, How many dissimil...

How many dissimilar types of subnet classful networks are present?

Cpe is an acronym for, Customer Premise Equipment (CPE) are devices physica...

Customer Premise Equipment (CPE) are devices physically located at the subscriber's premises. Includes both owned and leased equipment.

Authoritative dns servers application layer, Authoritative DNS Servers ...

Authoritative DNS Servers Every  organization with publicly  accessible hosts  ( such  as web  server and mail  several  on the  internet  must  provide  publicly accessible D

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd