






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







This project builds on the work that has been done to capture MPI call information and record them in a compressed form. These traces are later replayed using the replay engine. The aim of the project was to add timing information into MPI traces and use that information while replaying the traces. This essentially simulates the computation time between any two MPI calls.e
First of all, the timing information is captured during the MPI program execution. This is done within the record engine. This work is being done in a separate project. (See http://www4.ncsu.edu/~akdalmia/Projects/itdmpit.html) This work intends to cover using the timing delta information while replaying the trace. A little bit of introduction is required as to what exactly is meant by capturing timing deltas. A program whose trace is required is linked against the record engine and allowed to run. The record engine has wrappers, through which it catches all MPI calls. Within these wrappers, the amount of time spent in computation since the last MPI call is computed. This value needs to be stored. However, the values differ from node to node and thus it is not possible to store timing information for all nodes.
The simple solution is to capture this information statistically by computing minimum, average and maximum values. This is added as one line per MPI call entry in the trace file in the form TIME:
Once we have the timing information in the trace, they need to be replayed. Here it is assumed that the replay engine is compiled with the same option (min-avg-max or histogram) that was used to generate the traces. It is trivial to put a indicator flag based on which the replay engine can be notified of the format. The first change in the replay engine is in the trace parser. The parse needs to look for timing information while parsing the trace file (needless to say, the appropriate data structures must be already modified). This timing information is stored in the RSD list. At the time of actual replay, these values are read and usleep is called to simulate computation delay. Replaying min-avg-max trace Here we need to mention the exact time used to sleep. For the min-avg-max traces, only the average value is used at all times. This results in a situation where all the MPI tasks sleep for the exact same time. Due to this, the load imbalance effects are not seen. Replaying Histogram trace When we have a histogram trace, a random value between 0-<#nodes> is generated. This value is used to select the appropriate bucket in the histogram. The sleep time is then simply computed from the base,stride and the bucket index. This value is then used to simulate computation delay.
On the replay engine, the format is determined dynamically. The number of buckets can be supplied as a command line argument. enum { MIN_TIME, AVG_TIME, MAX_TIME, TIME_MAX }; enum { TIMING_INVALID, TIMING_MIN_MAX_AVG, TIMING_HISTOGRAM }; struct timing_histo { int timing_base; int timing_stride; }; struct timing_delta { int time[TIME_MAX]; }; / binary data structure for ops / typedef struct { ............... / timing info / union { struct timing_delta d; struct timing_histo h; }u; ............... } replay_op;
The first step was to compile and run the existing record/replay engines. The existing source consisted of the following :- record.tgz - the new record engine replay.tgz - the new replay engine src.tar.gz- the old record and replay engine. Firstly, the old record engine was compiled and run to generate trace files. In this process, a few minor bugs were discovered and fixed. However, it was later observed that those bugs were already fixed in the new record engine code. So it was decided that the new record engine be used.. In the meantime, the other team informed that the new replay engine did not have implementation of all the MPI calls, so the old replay engine was used.
● First of all, the record makefile needed to be modified in order for the source to be compiled. The main changes were in the source path prefix and the compiler path and flags. Also minor changes were made to fix the way the makefile was written (the default target was 'clean'!). ● After doing this the source was compiled and the record engine are run for small sample programs. It was noticed that the program did not execute to completion. Some debugging indicated that this was due to some code under one of the debug flags. The debug flag was turned off and the program was able to run to completion. ● On doing this, the trace files were produced. It was noticed that the trace files had certain binary characters in the signature field. The stack signature is generated using the Program Counters from the call stack. The location of PC, FP etc are platform dependent, and macros are used to access these values. These macros needed to be tweaked a little. At this point, a working record engine was ready. ● This work was done on an x86 laptop. When the same code was run on the OS cluster, the program failed to run, crashing due to a segmentation failure. On much debugging, it was found that due to compiler optimizations, the stack signature was not being read correctly and the program was trying to read from invalid memory addresses. This was fixed by turning off optimizations while compiling the replay engine. ● Timing delta information: Once a working version of the record engine was created, the code was modified to output timing delta information. The actual capture of timing delta was done in a separate project, so some test code was added to generate random deltas in the range 0-500ms. There are two timing delta formats :- min/avg/max and histogram. The code for generating each type of timing information is under a different compiler switch.
The replay engine was modified only so much so that it could run a few basic test cases. Since the main objective was to implement timing delta replay, effort was spent only so that a few running cases were available. This might change later when fixes from the other team are merged. Thus far, the replay engine timing delta changes have not been merged. So the r esults show values which are randomly generated.
1. MPI call profile capture using mpiP The figure below shows the mpiP profile report for the sample irecv-isend-ok2.c. As can be seen, the sample uses the Isend/Irecv(highlighted) calls. The time consumed by the usleep() calls can be seen under the AppTime column. As can be seen, these calls were made from the lookup_prsd_call() function, which is responsible for replaying the MPI calls. Figure 1: mpiP profile report.
2. Timing delta distribution (min-average-max) The figure below shows the distribution of sleep times between consecutive MPI calls. These values were generated for the irecv-isend-ok2.c test benchmark. This benchmark uses a loop in which messages are sent and received repeatedly. Since the average value is used, the sleep time between calls is constant. Figure 2: Sleep times between MPI calls using average values.
dependencies such as compiler switches, header files, pre-defined values that should ideally be shared in common. The code might need to be re-organized to achieve this.
I thank Aditya for collaboration on the data structure changes I also thank Vivek and Apoorva for the initial record engine information and some of the initial changes on which we worked together.