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
MAC address called Physical address Because it's not changeable

As there will be more devices there will be more traffic of information. We can include capacity to WAN by adding more links and packet switches. Packet switches use not have compu


Illustrate the products based on Socks protocol There are a number of products based on SOCKS specifications such as Auto SOCKS available in the market. The latest version is S

TWO DIFFERENT KINDS OF TOPOLOGIES: LOGICAL TOPOLOGY:  It is described by the specific network technology. PHYSICL TOPOLOGY: It relays on the wiring scheme. NE

Discuss  about the JPEG and LDAP JPEG: Stands for Joint Photographic Experts Group.  A standard format of storing digitized, colour, or black-and-white photographs. JPEG fi

Connection Establishment TCP transmits  data in full duplex mode. When two TCP is two machines are  connected they are able  to send segments to each other simultaneously. This

Consider the site-to-site VPN scenario shown in Figure 2. Let's deploy the AH protocol on the two VPN routers so that no desktop on the two sites need to do any AH operations. Assu

Question 1 Define client and server. Explain the Client server model Question 2 What is a Mainframe System? Write down the features of Mainframe System Question 3

Wide Area Network WAN Wide  Area Network  ( WANs) connect larger geographic  areas such as  London the UK or the  world. In this types  of networks  dedicated transoceanic cab