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 are the control frames for lost tokens, Control Frames for Lost Tokens...

Control Frames for Lost Tokens If station goes down ... token lost Predecessor listens for data frame or token Noticing none, retransmits token Sends whofoll

Explain bus topology, Explain Bus Topology. The physical Bus topology i...

Explain Bus Topology. The physical Bus topology is the easiest and most widely used of the network designs. It having of one continuous length of cable (trunk) and a terminatin

Applications of networks, Q. Applications of networks? End systems (h...

Q. Applications of networks? End systems (hosts): - Run application programs - Example email, Web - At -edge of network Client/server model - Client host

Which statement is true regarding half duplex, Half duplex is analogous to ...

Half duplex is analogous to a one a lane bridge, it can handle traffic in both directions but no at the similar time.

Why do we require a subnet mask? , If the host has the subnet ID why do we ...

If the host has the subnet ID why do we require a subnet mask?

Multimode for transmitting optical signals, Q. Multimode for transmitting o...

Q. Multimode for transmitting optical signals? - Multiple beams from light source travel through core at different paths - Multimode step-index fiber Density remains

Summary of osi model, Q. Summary of osi model? - There was no standard ...

Q. Summary of osi model? - There was no standard for networks in the early period and as a result it was difficult for networks to communicate with each other. - The ISO (In

TCP for live video, 1. What advantages and disadvantages does TCP have for ...

1. What advantages and disadvantages does TCP have for live video teleconferencing applications

Program to use of lastprivate clause, This example illustrate the use of la...

This example illustrate the use of lastprivate clause void for_loop (int n, float *a, float *b) { int i; #pragma omp parallel { #pragma omp for lastprivate(i) for

What is groupware server, Groupware addresses the management of semi-struct...

Groupware addresses the management of semi-structured information like text, image, mail, bulletin boards and the flow of work. These Client/Server systems have people in direct co

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