Timing in mpi program, Computer Networking

Assignment Help:

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( );

}


Related Discussions:- Timing in mpi program

What are intrusion detection systems, Question : a) Give three example...

Question : a) Give three examples of vulnerable services which are among the overwhelming majority of successful attacks. b) Name the five outside sources which can be the

What is shielded twisted pair, Q. What is Shielded Twisted Pair? - A me...

Q. What is Shielded Twisted Pair? - A metal foil or braided-mesh covering encases every pair of insulated conductors to prevent electromagnetic noise called crosstalk - Cros

Network design, Get the network design for a company

Get the network design for a company

How is computer networks used in marketing and sales, How is computer netwo...

How is computer networks used in marketing and sales, financial services, teleconferencing? Computer network have led to a new age of all of these services. They have helped in

Difference between multiprogramming and multithreading, Question: a) L...

Question: a) List three characteristics and two potential problems of a peer-to-peer environment. b) List three characteristics and two potential problems of a client/

Describe some common threats to the hardware, Describe some common threats ...

Describe some common threats to the hardware Theft of a computer, printer, or other resources. Tampering by a disinterested or frustrated employee who takes every chan

Distinguish between physical topology and logical topology, Question: (...

Question: (a) (i) Distinguish between Physical topology and Logical topology. (ii) Explain the following statement with the help of a diagram: "A star topology can have a l

What is round trip time, What is Round Trip Time? The duration of time ...

What is Round Trip Time? The duration of time it takes to send a message from one end of a network to the other and back, is known as RTT.

Types of vts sonet sdh, Types of VTs There are  several  option for  pa...

Types of VTs There are  several  option for  payload are actually mapped into the VT.  Locked mode VTs  bypass the pointers with a fixed  byte oriented mapping of limited flexi

Name the factors that affect the performance of the network, Name the facto...

Name the factors that affect the performance of the network? a. Number of Users b. Type of transmission medium c. Hardware d. Software

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd