OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0001035OMNeT++command line toolspublic2018-05-08 11:052018-06-20 09:13
cavka 
andras 
normalminoralways
feedbackopen 
x86_64GNU/Linux?
5.0 
 
0001035: scavetool rounds numbers in scalar outputs
After finishing longer simulations, processing of scalar results with scavetool produces really round numbers. These numbers were at least 7 digits long, so any higher integers were rounded in the last or in the last two digits.
Simulate network long enough to obtain an at least seven digit number for a counter of e.g. received or sent packets.
No tags attached.
Issue History
2018-05-08 11:05cavkaNew Issue
2018-06-20 09:13andrasNote Added: 0001364
2018-06-20 09:13andrasAssigned To => andras
2018-06-20 09:13andrasStatusnew => feedback

Notes
(0001364)
andras   
2018-06-20 09:13   
Unable to reproduce, please give more specific information.

Scavetool indeed loses some precision because it reads scalars into doubles not int64_t or some other suitably large integer. double only has a 52-bit mantissa, not enough to precisely store integers >2^52. However, precision loss only starts around digit 17 or so, not after 7 digits. The default output precision is currently 14, which could indeed be higher.

Some cursory tests.

Input scalar file:

version 2
run PureAlohaExperiment-20180611-16:04:39-6456

scalar Aloha.server long 1234567
scalar Aloha.server loong 12345678
scalar Aloha.server looong 123456789
scalar Aloha.server loooong 1234567891
scalar Aloha.server looooong 12345678912
scalar Aloha.server loooooong 123456789123
scalar Aloha.server looooooong 1234567891234
scalar Aloha.server loooooooong 12345678912345
scalar Aloha.server looooooooong 123456789123456
scalar Aloha.server loooooooooong 1234567891234567
scalar Aloha.server looooooooooong 12345678912345678
scalar Aloha.server loooooooooooong 123456789123456789
scalar Aloha.server looooooooooooong 1234567891234567891
scalar Aloha.server loooooooooooooong 12345678912345678912

command: scavetool x x.sca -o x.csv

output:
Exported 14 scalars
run,type,module,name,attrname,attrvalue,value
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,long,,,1234567
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loong,,,12345678
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looong,,,123456789
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooong,,,1234567891
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooong,,,12345678912
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooong,,,123456789123
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooong,,,1234567891234
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooong,,,12345678912345
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooooong,,,1.2345678912346e+14
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooooong,,,1.2345678912346e+15
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooooooong,,,1.2345678912346e+16
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooooooong,,,1.2345678912346e+17
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooooooooong,,,1.2345678912346e+18
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooooooooong,,,1.2345678912346e+19

Using increased output precision:
scavetool x x.sca -o x.csv -x precision=16

Output:
run,type,module,name,attrname,attrvalue,value
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,long,,,1234567
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loong,,,12345678
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looong,,,123456789
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooong,,,1234567891
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooong,,,12345678912
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooong,,,123456789123
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooong,,,1234567891234
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooong,,,12345678912345
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooooong,,,123456789123456
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooooong,,,1234567891234567
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooooooong,,,1.234567891234568e+16
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooooooong,,,1.234567891234568e+17
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,looooooooooooong,,,1.234567891234568e+18
PureAlohaExperiment-20180611-16:04:39-6456,scalar,Aloha.server,loooooooooooooong,,,1.234567891234568e+19