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
FDDI has four specifications: 1. Media Access Control it defines how the medium is accessed 2. Physical Layer Protocol it defines data encoding/decoding procedures 3. Phy

Q. Function of TCP/IP Transport Layer ? TCP/IP Transport Layer - Defines two standard transport protocols UDP and TCP - TCP equipment a dependable data-stream protocol

Q. How to connect Remote LANs? - Remote bridges acting as connecting devices to connect LANs and point-to-point networks such as leased telephone lines or ADSL lines

What is MAN? MAN - Metropolitan Area Networks. MAN is bigger than a LAN and as its name implies, covers the area of a single city. MANs rarely extend beyond 100 KM and frequ

What is BGP (Border Gateway Protocol)? It is a protocol used to promote the set of networks that can be reached within an autonomous system. BGP enable this information to be c

Question: (a) Explain the issue associated with vertices when the scan line scan line polygon fill algorithm is being applied? (b) Explain the logic of shortening edges to a


Question 1: a) Give three examples of Shells in Linux. b) Differentiate between the Join command and the Paste command in Linux, use an example to support your answer.

Recognize the command to show the Frame Relay map table Ans) Router# show frame-relay map is the the command to show the Frame Relay map table

Brigdes Introduction - LAN may require to cover more distance than the media can handle effectively or - Number of stations may perhaps be too great for efficient frame d