Analysis and Optimisation of Communication Patterns on a Beowulf   Wi Bing Tan and Peter Strazdins

Updated: 26th August 2002

Simulator

The simulator code is made of a number of programs.


Usage

The simulator requires a number of steps to run before producing the timecharts.The first step is to modify the exisiting MPI_Isend and MPI_Irecv calls to use the simulator calls. 'sim-mpi.c' and 'sim-mpi.h' should be compiled together with the mpi code. The MPI_Isend and MPI_Irecv calls should be modified to use SIM_Isend and SIM_Irecv calls respectively. SIM_Isend and SIM_Irecv uses the same inital parameters as MPI_Isend and MPI_Irecv with an additional parameter of time which is a struct tv value. This value is the time in which the function is called. What SIM_Isend and SIM_Irecv does is it produces a list of tags which should be piped into a file and sent to the diagramming tools. Example: 'mpirun -c 8 my-modified-program.exe > tag-output.txt'.

The next step is to use the list of tags to produce simulated diagrams. Both simulus and simulus2 can produce the timecharts. simulus produces the simulated timechart whereas simulus2 produces the measured timecharts. Both programs read in a number of values. They are:

    1. alpha send - The value of startup latency for a send call.
    2. alpha receive - The value of startup latency for a recieve call.
    3. beta send - The communication volume cost for a send call.
    4. beta receive - The communication volume cost for a receive call.
    5. number of nodes - The number of nodes.
    6. tag list - The list of tags file produced in the previous step.

Both simulus programs produce a .fig file output. For simulus, The .fig file consists of debugging code and this has to be removed. Enter the .fig file produced and remove the code before the dotted line. For simulus2, this is not necessary. Both programs generate .sim files from the tag list. This is used for debugging and should be removed if the programs are to run again or to use new data.


File Description

sim-mpi consists of two files. They are:

  • sim-mpi.c - The C code implementation of MPI calls.
  • sim-mpi.h - The header linking sim-mpi.c.

simulus and simulus2 consists of 6 main files. They are:

  • simulus.c - The main program. This program accepts the inputs and calls the respectively programs.
  • sorter.c - Sort the code. Sorts the code into their respective .sim files. Each .sim file represents the tags for a particular node. i.e. 'node8.sim'.
  • scanner.c - Scan the tag list. Scans the tag list for errors and removes any redundant tags or code. After that is done, the scanner translates the tags into tokens holding the value of each send and receive call.
  • calstart.c - Calculates the start of each send and receive and adjusts their placement relative to each other.
  • drawstuff.c - Draws the timechart based on the start values and the calculated send and receive time from alpha and beta values.
  • simulus.h - The header file linking the program. Of importance is the DRAW_FACTOR defnition in this file. This can be modified to a smaller value to fit bigger timecharts.

Back to Main