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
Question: a) Describe the triangular delivery and two crossing problem that appears in Mobile IP. b) Discovery, Registration and Tunneling are three basic capabilities of Mo

Determine the level of Fibre Channel standard The Fibre Channel standard is organized into five levels: FC-0: The Physical Interface and Media Level handles a variety of phy

configure a router . get the default gateway

Financial Services Today   financial services are totally depended  on computer network. Application includes credit history searchers foreign exchange and  investment service

Transition Phases A PPP connection goes through phases  which can be  shown in a transition phase . Dead: In  the dead phase  the link is not  being used. There is  no ac


Fragmentation - Wireless environment is very noisy - Corrupt frames must be retransmitted - Large frames must be divided into smaller ones to increase efficiency

How Firewall configuration makes all the difference The greatest blunder that any company make is to just install a firewall and think that they have ensured perfect securit

Hardware difficulty It refers to the price of hardware logic like connectors, wires, switches, arbiter etc. that are required for execution of interconnection network.

Genome4U is a scientific research project at a large university in the United States. Genome4U has recently started a large-scale project to sequence the genomes of 250,000 volun