From Marss86

MARSS provides a unique simulator feature that allows users to create a database of all the simulation statistics in one place and generate various result tables using standard database queries.



For this feature MARSS uses MongoDB to store/retrieve all the statistics. MongoDB uses JSON like document structure to store the database which is very suitable for MARSS. By default MARSS uses the PTLsim's PTLstats feature to store the simulation stats into a binary file that contains a XML like template of the PTLsimStats structure to store the data. As in PTLsim, MARSS auto-generate bson_stats.cpp file from PTLsimStats structure that stores the stats into a BSON object and save it into the Mongo database.

Setup MongoDB

To use this feature, first setup the MongoDB server in any machine that is accessible from the machine on which you run your simulations. MongoDB does not require 'root' access to start the server.

  • First download the MongoDB for your system from here.
  • Create a data directory in your $HOME folder using
 $ mkdir -p $HOME/mongo_db
  • Now goto the directory where you have downloaded and extracted the Mongo binary and start the Mongo server using following command.
 $ ./mongodb-xxxxxxx/bin/mongod --dbpath=$HOME/mongo_db

Your MongoDB has been setup and running. Now lets see how we use MongoDB server in MARSS to store stats into this server.

Using MongoDB in MARSS

Once you have setup the Mongo server, use following simulation configuration options to use Mongo support in MARSS.

  • -enable-mongo : Give this option to enable the Mongo support. If this option is given it will try to write stats to Mongo server specified in '-mongo-server' option. By default this option is disabled.
  • -mongo-server [server-name] : This option specifies the server name or IP address where the Mongo server is running. Default value is '', assuming that Mongo server is running in localhost.
  • -mongo-port [port-num] : This options specifies the Mongo server's port address. Default value is 27017.
  • -bench-name [benchmark-name] : This option specifies the name of the benchmark under which the simulation statistics will be stored. Default value is 'unknown'.
  • -db-tags [commma,separated,tags] : Use this option to apply various tags to the database. For example, the simulation for 2-core and private L2 you can specify tags like '2core,privateL2' etc.

For example if you are running SPEC-2006 GCC benchmark with single core and 1MB L2 cache size configuration and your Mongo server is running on '', give following configuration option to store stats into Mongo database.

 -enable-mongo -mongo-server -bench-name gcc -db-tags 1core,1mbL2

Stats document structure in MongoDB

In MongoDB, MARSS will create a new database (if not present) with name as 'marss'. In 'marss' database, it creates a collection named 'benchmarks'. In this collection it will store all the simulation stats in an array where each array contains following document structure.

 { "_id" : (unique id for this benchmark run),
   "benchmark" : (name of the benchmark),
   "stats_type" : (user|kernel|global),
   "tags" : [ array of tags specified in -db-tags option],
   "stats" : { PTLsimStats object }

In PLTsimStats object, the document structure is same as defined in the stats.h file.

Personal tools