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

Define the term - hot swapping, Define the term - Hot swapping The rel...

Define the term - Hot swapping The reliability of the machine can be dramatically improved by installing the best components. Hot swapping is a concept through which component

Explain in brief about crc, What is CRC The CRC is computed while trans...

What is CRC The CRC is computed while transmission and appended to output stream as soon as last bit goes out onto wire. If the CRC were in header, it will be necessary to make

Explain the Physical layer, Explain the Physical layer The Physical lay...

Explain the Physical layer The Physical layer of the OSI model sets standards for sending and receiving electrical signals among devices. It explains how digital data (bits) ar

What is an error, Q. What is an Error? At any time bits flow from one p...

Q. What is an Error? At any time bits flow from one point to another they are subject to unpredictable changes because of interference The interference is able to change the

Determine the window positions for succession of events, Two neighbouring n...

Two neighbouring nodes (A and B) use a Go-Back-N protocol with a 3-bit sequence number and a window size of 4. Acknowledgments are cumulative. Assuming A is transmitting and B is r

Advantage of ip sec tunnelling mode, Advantage of IP sec  Tunnelling Mode ...

Advantage of IP sec  Tunnelling Mode IP Sec  tunnelling mode  has the  following  advantages: a.Security : Ts IP sec tunnelling mode  secure somewhat but  not the best. In a

What are the two broad class classifications, What are the two broad class ...

What are the two broad class classifications under which Networks can be divided? All computer networks fit in one of the two dimensions namely: a)      Transmission Technol

What are the bridges, Bridges - Operate in both physical and data link ...

Bridges - Operate in both physical and data link layers - Utilized to divide a network into smaller segments - May as well relay frames between separate LANs - Keeps t

Explain the term ftp- file transfer protocol, Explain the term FTP: File T...

Explain the term FTP: File Transfer Protocol A very common method of moving files between two Internet sites. FTP is a special way to log in to another Internet site for pur

Pvm library routines, In this part we shall give a short description of the...

In this part we shall give a short description of the routines in the PVM 3 user library. Each PVM program should include the PVM header file "pvm3.h" (in a C program) or "fpvm3.h"

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