0% found this document useful (0 votes)
61 views2 pages

Department of Software Engineering: Course Code: CS332 Class: BESE6AB Lab 12: MPI (Part 2)

This document provides instructions for a lab assignment on message passing interface (MPI) for the Distributed Computing course (CS332). Students are asked to write a program to benchmark data transfer between two processes by sending arrays of floating point numbers back and forth in packets of varying length. They must use MPI_Wtime() to time each send and receive, calculate the average time per operation, and determine the transfer rate in bytes/second. A loop is then added to investigate how timing varies with message size from 1 to 10001 elements in increments of 1000, and up to 90001 elements. Students must submit their code and screenshots on the learning management system.

Uploaded by

Nust Razi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views2 pages

Department of Software Engineering: Course Code: CS332 Class: BESE6AB Lab 12: MPI (Part 2)

This document provides instructions for a lab assignment on message passing interface (MPI) for the Distributed Computing course (CS332). Students are asked to write a program to benchmark data transfer between two processes by sending arrays of floating point numbers back and forth in packets of varying length. They must use MPI_Wtime() to time each send and receive, calculate the average time per operation, and determine the transfer rate in bytes/second. A loop is then added to investigate how timing varies with message size from 1 to 10001 elements in increments of 1000, and up to 90001 elements. Students must submit their code and screenshots on the learning management system.

Uploaded by

Nust Razi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Department of Software Engineering

Course Code: CS332

Class: BESE6AB

Lab 12: MPI (Part 2)

Date: December 18, 2018

Time: 2:00 am – 5:00 pm

Instructor: Dr. Asad Waqar Malik

CS332: Distributed Computing Page 1


Lab 12: Mpi
Introduction

Its time to benchmark the data transfer between two processes. let's write a simple program
(pingpong) in which two processes send packets of information back and forth several times and
record the amount of time required. The packets of information consist of an array of dummy
floating point numbers which vary in length from one floating point number to 10,001 floating
point numbers. These packets are sent back and forth from one process to another 100 times and
the total amount of time required is recorded. From this timing data the average amount of time
per send/receive is computed as well as the transfer rate (bandwidth) in bytes/sec.

First of all, you'll need to use the MPI_Wtime() routine for timing the calls. This routine returns
the time expressed in seconds (see man MPI_Wtime). In order to time something two
MPI_Wtime() calls are needed and the difference between the returned values should be taken to
obtain the total elapsed time (in wall clock seconds).

After you've inserted two MPI_Wtime() calls to estimate the average time taken for one message
to complete a one way trip, calculate the transfer rate in bytes per second. What did you find?

Now, add a loop around the timing calls changing the length of the message (length varies from
1 to 10001 in increments of 1000) to investigate how the time taken varies with the size of the
message. Note the reading by varying the size to 90001

Deliverables

Submit code files and screenshots on LMS.

CS332: Distributed Computing Page 2

You might also like