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

Identify three udp characteristics, UPD is a layer 4 Transport protocol. It...

UPD is a layer 4 Transport protocol. It is connection-less due to it does establish a connection thus the 3 step handshake is not needed, it does NOT execute any flow control or ac

Show the seven layers of iso''s osi model, Q. Show the seven layers of ISO'...

Q. Show the seven layers of ISO's OSI model? Ans:- The seven layers are given below:   -  Application Layer -  Presentation Layer -  Session Layer -  Transport Laye

How to protect computer hardware by threats, How to protect computer Hardwa...

How to protect computer Hardware by threats The first component in the computer system vulnerable to attacks or threats, and most important to be protected, is the hardware.

What do you mean by openMP, Q. What do you mean by OpenMP? OpenMP is a ...

Q. What do you mean by OpenMP? OpenMP is a compiler directive based standard developed in late 1990s together by a group of main computer software and hardware vendors. It is p

Explain the working of transceivers, Explain the working of Transceivers ...

Explain the working of Transceivers Transceivers are used to connect nodes to the several Ethernet media. Most computers and network interface cards having a built-in 10BaseT o

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

What are the issues are there in network environment, What are the issues t...

What are the issues there in network environment Some of the issues necessary are: Network planning should be carried out covering the following important issues:

components in the following command ''interface serial0/1/1'', Normal 0 ...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Des key, Assume the following 64-bit DES key (expressed in hexadecimal): FE...

Assume the following 64-bit DES key (expressed in hexadecimal): FEFE FEFE FEFE FEFE (a) What is the term for such a key? (b) State the value of each of the 48-bit round keys

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