Obtaining Multi2Sim's source code

Multi2Sim is composed of a set of open-source code repositories hosted on a Github organization of the same name (https://github.com/Multi2Sim). This organization contains the following repositories:

  • Main Multi2Sim repository - https://github.com/Multi2Sim/multi2sim. This repository contains the full source code of the simulator, as well as some sample programs used to run simple simulations, as referred to on the Multi2Sim guide. If you are a member of the Multi2Sim developer team with write access to the repository, you can clone it with the following command:

    ~$ git clone git@github.com:Multi2Sim/multi2sim.git

    If you do not have write access to the repository —or if you do have write access, but prefer to use your Github credentials instead of setting up SSH keys—, you can clone it with the following command:

    ~$ git clone https://github.com/Multi2Sim/multi2sim
  • Multi2Sim client kit - https://github.com/Multi2Sim/m2s-client-kit. This repository contains shell scripts used to launch massive simulations on clusters of computers managed by Condor. It also contains a set of unit tests launched automatically by Top of Trees when new code is pushed into the main Multi2Sim repository.
  • Multi2Sim server kit - https://github.com/Multi2Sim/m2s-server-kit. This repository contains shell scripts run by a cluster of computers managed by Condor when it receives simulation tasks launched with the client kit.
  • Benchmark kits. Multi2Sim supports a wide set of benchmarks whose source code, binaries, and data files are provided on Github, too. Each benchmark kit is composed of two repositories: one containing the benchmark source code (e.g., m2s-bench-splash2-src, and another containing benchmark binaries and data files (e.g., m2s-bench-splash2.

Building Multi2Sim

Multi2Sim uses the GNU Autotools as its build system. You can build the simulator by running the sequence of commands shown below under the directory in which the main Multi2Sim repository was cloned. Assuming that the current working directory is called multi2sim, the final executable will be generated in multi2sim/bin/m2s after successful compilation.

~/multi2sim$ libtoolize
~/multi2sim$ aclocal
~/multi2sim$ autoconf
~/multi2sim$ automake --add-missing
~/multi2sim$ ./configure --enable-debug
~/multi2sim$ make

Notice the importance of argument --enable-debug in command ./configure. This flag forces gcc to show all compilation warnings and consider them as errors. If you omit the flag, your code modifications could cause just warnings for you that would be errors for the rest of the users, making compilation fail for others.

Multi2Sim is composed of numerous C++ source files, which can take a few minutes to compile. If you have a multi-processor machine, you may benefit from adding option -j N in command make. For example, on a machine featuring a 4-core processor you can run command make -j 4 to compile four source files at a time.

Contributing to Multi2Sim

If you would like to contribute code patches or new features to Multi2Sim, we will be happy to help you through the process. We encourage you to first follow these steps carefully:

  • Download the latest version of the C++ Coding Guidelines for Multi2Sim. Since Multi2Sim 5.0, all C++ code is based on an object-oriented unified model with strict formatting rules. All new code is required to comply with a unified format for readability and extendibility.
  • If you are a member of the Multi2Sim developer team, create a new branch on the main Multi2Sim repository. If you are not a member, fork the main Multi2Sim repository. Apply your changes on your local branch/fork.
  • Pull in changes from the master branch in the main Multi2Sim repository often, to make sure that you local version stays up to date, and to minimize the chances of conflicts when your code is ready to be merged.
  • Once you're ready to submit your patch, send a pull request for your local branch. Your changes will be reviewed for correctness and coding style. If your contribution is accepted by the Multi2Sim developer team, your code will be merged with the master branch on the main Multi2Sim repository.