Raw text simulation outputs for sniper 4.2

261 views
Skip to first unread message

Alexandru Iordan

unread,
Mar 23, 2013, 5:46:31 AM3/23/13
to snip...@googlegroups.com
Hello

Up until now I used the Sniper 3.06 and it served me well. When I upgraded to the 4.2 version I had the surprise to see that the stats were reported in a Sqlite format rather than the raw text that I was used to. This is a problem for me because I do some experiments using a lot of markers and I run parsing scripts on them to extract the data that I need. I really want to take advantage of all improvements in the 4.2 version but I can't afford (at least not right now) to adjust to the new stats format. Is there a way to force Sniper to output the raw text stats so I can still use my parsing scripts? Also, are there any documentation about the table format that is used in the Sqlite files? The Sniper manual does not seem to cover that.

Regards,
Alexandru Iordan

Wim Heirman

unread,
Mar 23, 2013, 6:11:46 AM3/23/13
to snip...@googlegroups.com
Alexandru,

The new database format was designed explicitly to support lots of
markers, and to be much more scalable that the old text-based format
(in addition to being much faster to process). Please do not try to
read the database format directly as it may change again in the future
- the only supported way is to use the sniper_lib.get_results() Python
interface which provides a portable way to get statistics across
Sniper versions.

Unless you start mixing code from 3.06 and 4.2, you cannot make Sniper
write in the old format. The closest you'll get is to run
./tools/dumpstats.py on the database-based statistics and parse its
output. By slightly changing dumpstats, I'm sure you can generate
something that your old scripts can parse if you don't want to migrate
them to get_results() just yet.

Regards,
Wim
> --
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Sniper simulator" group.
> To post to this group, send email to snip...@googlegroups.com
> To unsubscribe from this group, send email to
> snipersim+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/snipersim?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Sniper simulator" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to snipersim+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Alexandru Iordan

unread,
Mar 25, 2013, 5:27:09 AM3/25/13
to snip...@googlegroups.com

Is there any documentation about the tables and information stored in the Sqlite stats database? Throwing SELECT commands at it seems to me a bit inefficient. From what I can gather there are 5 tables: names, prefixes, values, topology and marker. But what information does each of these tables hold?

Regards,
Alexandru Iordan

Wim Heirman

unread,
Mar 25, 2013, 6:52:56 AM3/25/13
to snip...@googlegroups.com
Alexandru,

The file sniper/tools/sniper_stats_sqlite.py is the one reading the
database format, you should be able to derive the meaning of the
various tables from it. But again, please don't re-implement this
functionality -- just use the existing interface through sniper_lib or
sniper_stats as we may change the data format again in the future. If
there is anything you would like to do in the way of statistics
processing that is not currently supported through this interface, let
us know and we'll gladly work with you to extend it in a portable way.

Regards,
Wim

Alexandru Iordan

unread,
Mar 25, 2013, 7:24:40 AM3/25/13
to snip...@googlegroups.com

Thanks for your reply Wim.

I will not re-implement any functionality of Sniper, but rather implement a new one. I use markers to trace several functions in an applications in an attempt to create an "energy-footprint" for each of these functions. The problem is that these functions are called many times during the execution resulting in a large number of START_someID - END_someID labels in the stats. In order to create an "energy-footprint" for any of my functions of interest I need to provide McPAT with an input file containing the sum up stats for all its calls. This is why I need to go through the SQLite database and sum up all the stats for a given marker. I don't see how I can do that with the current interface so I need to write it myself.

Thanks again for your answers!

Wim Heirman

unread,
Mar 25, 2013, 12:07:54 PM3/25/13
to snip...@googlegroups.com
Hi Alexandru,

You can use the partial flag to get_results() to get statistics
between two markers:

$ sniper_lib.get_results(resultsdir = "RESULTSDIR", partial =
("START_someID", "END_someID"))

A more efficient version of this keeps the database open and allows
you to read the raw snapshots:

$ stats = sniper_stats.SniperStats("RESULTSDIR")
$ stats.get_snapshots()
$ stats.read_snapshot(MARKERNAME)

This last version is somewhat lower-level than get_results() itself,
but we use it in some of our internal scripts as well so I'm pretty
sure we'll keep this interface around.

Regards,
Wim

Alberto Martinez

unread,
Jan 4, 2014, 12:37:46 PM1/4/14
to snip...@googlegroups.com
Hello all,
I am getting started with sniper and this question may sounds naive but I don't know how to use the get_result() functionality. (I'm not used to phyton)

I have just read it is in the sniper_lib.pyc file, but how can I parse and process my simulation results with it? Need I call that function through a program or can I do it from command line?

Thanks a lot,

Alberto

Wim Heirman

unread,
Jan 5, 2014, 10:37:03 AM1/5/14
to snip...@googlegroups.com
Alberto,

If you just want to look at the results from the command line, you can use the tools/dumpstats.py utility. To read these results programmatically from Python, you can take a look at our Sniper tutorial [1] which has some examples on how to use get_results (see slide 97).

If you want to learn more about Python, their tutorial at [2] is a good place to start.

Regards,
Wim



--

Alberto Martinez

unread,
Jan 7, 2014, 6:07:11 AM1/7/14
to snip...@googlegroups.com

Thanks a lot Wim! I haven't realized there were some examples in the tutorial! :D

Regards,

Alberto

El sábado, 23 de marzo de 2013 10:46:31 UTC+1, Alexandru Iordan escribió:
Reply all
Reply to author
Forward
0 new messages