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

What happens in cdma systems, Question: (a) Suppose that you are a comm...

Question: (a) Suppose that you are a communication engineer and you have to construct a mobile telephone network with bandwidth W = 4.2 MHz in each link. The data rate is

State about the communications network, State about the communications netw...

State about the communications network 1) The communications network may only accept blocks of data up to a specific size.   (2) Error control might be more effective with a

What is meant by transparency, Transparency really means adumbrating the ne...

Transparency really means adumbrating the network and its servers from the users and even the application programmers.

Combine subtitution and transposition, how to own cipher to encrypt and dec...

how to own cipher to encrypt and decrypt message by combine both substitution ans transposition algorithm using c program

Protocol comes under hybrid dynamic type, Which protocol comes under Hybrid...

Which protocol comes under Hybrid dynamic type? Ans)  EIGRP (ENHANCED INTERIOR GATEWAY ROUTING PROTOCOL) comes under hybrid dynamic.

Explanation of internetworking terms and concepts, Question: (a) Outlin...

Question: (a) Outline the main interactions that take place when a user requests a valid web resource in the Address Bar of a modern web client till the resource is eventually

Define about unix systems and windows servers, What protocol can be applied...

What protocol can be applied when you need to transfer files between different platforms, such among UNIX systems and Windows servers? Use FTP (File Transfer Protocol) for file

Layer of security, Other than performance  issues, there could be security ...

Other than performance  issues, there could be security reasons for using something like xinetd.  Make simple design in which a new version of xinetd gives a layer of security.

What are some drawbacks of implementing a ring topology, What are some draw...

What are some drawbacks of implementing a ring topology? In case one workstation on the network varies a malfunction, it can bring down the whole network. Another drawback is t

Tree interconnection network, Tree interconnection network Tree inter...

Tree interconnection network Tree interconnection network(TIN)), processors are organized in a whole binary tree pattern.

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