Timing in mpi program, Computer Networking

MPI_Wtime ( ) returns elapsed wall-clock time in seconds as some arbitrary point in past. Elapsed time for program segment is specified by the difference between MPI_Wtime values at starting and end of process. Process clocks are not essentially synchronised, so clock values are not essentially comparable across the processes, and care must be taken in determining overall running time for parallel program. Even if clocks are explicitly synchronised, variation across clocks still can't be predictable to be significantly less than round-trip time for zero-length message among the processes.

Now, we shall explain use of these functions with an example.

Example 1:

#include

int main(int argc, char **argv) {

int i, tmp, sum, s, r, N, x[100];

MPI_Init(&argc, &argv);

MPI_Comm_size(MPI_COMM_WORLD, &s);

MPI_Comm_rank(MPI_COMM_WORLD, &r);

If(r==0)

{

printf( "Enter N:");

scanf ("%d", &N);

for (i=1; i

MPI_Send(&N, 1, MPI_INT,i, i, MPI_COMM_WORLD);

for (i=r, i

sum+= x[i];

for (i=r, i

{

PRAM Algorithms

 MPI_Recv(&tmp, 1, MPI_INT,i, i,  MPI_COMM_WORLD, &status); Sum+=tmp;

}

printf( "%d", sum);

}

else {

MPI_Recv(&N, 1, MPI_INT,0, i, MPI_COMM_WORLD, &status);

for (i=r, i

sum+= x[i];

MPI_Send(&sum, 1, MPI_INT, 0, i, MPI_COMM_WORLD);

}

MPI_Finalize( );

}

Posted Date: 3/2/2013 7:13:41 AM | Location : United States







Related Discussions:- Timing in mpi program, Assignment Help, Ask Question on Timing in mpi program, Get Answer, Expert's Help, Timing in mpi program Discussions

Write discussion on Timing in mpi program
Your posts are moderated
Related Questions
Q. Explain Full Duplex data transmission? - Have two separate Communication channels as well as use each one for simplex Data traffic (in different directions). - If this is

Firewalls After several  security  related internet  newsgroups  started overflowing  with posts it becomes  clear something  hand to done to help  secure  networks. The first

Skype is a web-based service which offers cheap and free phone calls. Explain step by step (in terms of networking technology) what really happens from the point when you initiate

Identify and briefly explain any four key requirements that need to be examined when considering deploying a WLAN technology.

University of Wolverhampton School of Technology 6CI007 Database Server Management Resit Assessment Hand in December 14th 2012 In this assignment you will build a small database t

A network in which there is multiple network links among computers to provide multiple paths for data to travel.


Take the maximum packet lifetime, T.  It's stated that T must be big enough to make sure the packet and its ACK have vanished.  Why do we have to have the ACK?

Hardware requirement for an intranet To setup a WAN, one would need to have some type of communication between different sites. National ISDN, Very Small Aperture Terminal (VSA

How does a Token-Passing Protocol works? The token-passing protocol relies on a control signal known as the token. A token is a 24-bit packet that circulates throughout the net