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
Explain about the Integrating Intranet These Intranets are designed to replace the complexity of in-house communications and processing systems that large organisations ofte

Q. Show the application layer of Osi reference model? - The application layer is OSI layer that is closest to the user. - It offers network services to the user's applicatio

Question: a) (i) Describe the entire process of credit card processing, identifying the different steps and parties involved. (ii) What are the roles of the acquiring ban

Q. Illustrate the Model for Network Security? - A message is transferred from one party (Principal) to another. - A logical information channel is founded between the t


Question: a) The cpio utility has three operating modes. What are they? b) The characters of the permission string are broken up into three groups of three characters. Ex

What is NOS? NOS, or Network Operating System, are specialized software whose major task is to give network connectivity to a computer in order for it to be able to converse wi

Mail Message  Format When an e mail  is sent from one person  to another  a header containing peripheral information precedes  the body  of the message itself. This contained


The Five steps to data encapsulation (IN ORDER): 1) User information is changed into data. 2) Data is changed into segments. 3) Segments are changed into datagram and pack