Low overhead parallel-task linux based simulator

Using the simulator

The simulation environment takes a standard C program, translates it to an MPI-C program, then compiles, links, and runs it using MPICH2. MPI, or Message Passing Interface, is a widely used parallel programming model. In using this model, the programmer explicitly defines the parallel tasks or processes as well as the communication among them. MPICH2 is an open-source implementation of the MPI standard.

The script c2mod.py identifies the processes in the C program and determines the number of input and output communication ports associated with each process. The user defines the connections among the processes using the AsAP Mapping Tool and saves this information in an XML file. The script runptsim.py uses this XML file and inserts the necessary MPI subroutine calls to enable communication between processes. The MPI-C program is then compiled, linked, and run using MPICH2.

To use the simulator, make sure you have the scripts c2mod.py and runptsim.py. Also, make sure that you have MPICH2 installed in your machine.

  1. Prepare Modules

    $ mkdir fir
    $ cd fir

    Copy this example application: fir.c
    Copy this input file: fir_input.dat

    $ c2mod.py fir.c
    Module "tap1" created with 1 input(s) and 2 output(s).
    Module "tap2" created with 1 input(s) and 2 output(s).
    Module "tap3" created with 1 input(s) and 2 output(s).
    Module "tap4" created with 1 input(s) and 2 output(s).
    Module "tap5" created with 1 input(s) and 1 output(s).
    Module "add" created with 5 input(s) and 1 output(s).
    Total 6 module(s) created.

    Copy these modules to the AsapMap modules folder

    $ cp *.mod /net/pizza/2/lib/asapmap/modules/
  2. Create Application

    $ asapmap

    Create this simple application



    Save the application to XML file (File -> Save As...)
    Name the output file as fir.xml
  3. Simulate Output

    $ runptsim.py fir.c

    The output can be found in the file chip_output_data.m inside your working folder.