Skip to content

Running Simulations

dchasap edited this page Sep 28, 2023 · 1 revision

MUSA is the methodology to integrade Dimemas performing network level simulation and TaskSim for multicore simulation. Both are trace driven simulators. The current methodology works by running an enhanced version of Dimemas which identifies execution burst, and when a burst is identified as a OpenMP/OmpSs burst, the execution time is being replaced by the simulation time obtained from TaskSim assuming a target multicore architecture.

Although MUSA is capable or running the simulation online, it is highly recommended that TaskSim simulator is run in a pre-sims step, where all OpenMP/OmpSs burst are simulated. The precalculated execution time is saved to a data file, which is later obtained by Dimemas during online simulation.

The following section describe both methods:

PRE-SIMULATION Stage

1. Running PRE-SIMUATION

This stage can simulate all OpenMP/OmpSs phases before running the complete simulation with Dimemas. Results will be stored to be later used by Dimemas to replace OpenMP/OmpSs phases with. TaskSim can perform these simulations in parallel. TaskSim is implemented as a Master-Worker application, thus a minimum of two processes will run. One for simulation, and one for writing the data file. Additional workers can be used for parallel execution of the simulation. To run the pre-sim step, launch_musa_presim.bash script should be installed upon sucessfully building MUSA. Before running, the following environmental variables should be set.

export SIM_CORES=12 # number of simulated cores
export SIM_MEM=0 # enables detailed memory mode if set to 1 or 0 for brusty mode.
export SIM_PRV=1 # enables generation of paraver trace from the simulation.
export SIM_LOG=0 # keep temporary log files for each core.  It is recommended to disable if using thousands of cores.

Once setup, run launch_musa_presim.bash, providing the number of parallel workers (NP), the application's trace (TRACE) and the TaskSim configuration file, describing simulation parameters (CONF).

launch_musa_presim.bash $NP $TRACE $CONF

2. Integrating PRE-SIMULATION

Once the presimulation has ended, the partial results simulated for a target architecture can be integrated in Dimemas, which automatically is going to identify the insertion points. To run Dimemas with the presimulated results the following options need to be passed.

export Mode=presim                        # set tasksim to offline mode
export TRACE_FOLDER=/path/to/app/traces   # path to folder containing the application traces
export APP=app                            # application name that was traced
export PRESIM=results.dat                 # data file containing the presimulated results
export PRV_FOLDER=/path/to/prv/traces     # trace folder with the presimulated paraver traces

Once setup, simply run Dimemas.

Dimemas -tasksim $MODE \
        -ts_trace_folder $TRACE_FOLDER \
        -ts_trace_name $APP \
        -ts_presim_file $PRESIM \
        -ts_prv $PRV_FOLDER \
        \
        -S 32K     \
        -pa trace_SIMULATED/MUSA_${APP}_${PRESIM}_${MODE}.prv \
        config_NET.cfg

Simulation with Online Integration

It is also possible to run Dimemas combined with TaskSim with no previous presimulation. This option is significanlty slower, especially for larger simulations. In this mode, TaskSim cannot run simulations in parallel. Dimemas starts the simulation and, when an OpenMP/OmpSs phase is reached, it is replaced by the TaskSim result, as soon as TaskSim returns.

To control TaskSim simulation you need to set the following variables before running Dimemas.

export SIM_MEM=0 # enables detailed memory mode if set to 1 or 0 for brusty mode.
export SIM_PRV=1 # enables generation of paraver trace from the simulation.

Dimemas requires the following options:

export Mode=online                        # set tasksim to offline mode
export TRACE_FOLDER=/path/to/app/traces   # path to folder containing the application traces
export APP=app                            # application name that was traced

Once setup, simply run Dimemas.

Dimemas -tasksim $MODE \
        -ts_trace_folder $TRACE_FOLDER \
        -ts_trace_name $APP \
        \
        -S 32K     \
        -pa trace_SIMULATED/MUSA_${APP}_${PRESIM}_${MODE}.prv \
        config_NET.cfg