1a1a11a / libCacheSim

a high performance library for building cache simulators
GNU General Public License v3.0
159 stars 34 forks source link

Unify result print format to be ignore-obj-size-aware #66

Closed haochengxia closed 4 months ago

haochengxia commented 4 months ago

When print simulation results (except for [info]), unify the format with the logic as follows: if ignore-obj-size=False, cache size is xxB/KiB/MiB ... (align with common.py) else, cache size is a pure number (the number of objects).

# multi sim is ignore-obj-size-aware in the print format, however, single is not
$ ../_build/bin/cachesim ../data/cloudPhysicsIO.vscsi vscsi s3fifo 0.1 --ignore-obj-size 0
../data/cloudPhysicsIO.vscsi S3FIFO-0.1000-2 cache size   194MiB,           113872 req, miss ratio 0.7273, throughput 5.87 MQPS
$ ../_build/bin/cachesim ../data/cloudPhysicsIO.vscsi vscsi s3fifo 0.1 --ignore-obj-size 1
../data/cloudPhysicsIO.vscsi S3FIFO-0.1000-2 cache size     5KiB,           113872 req, miss ratio 0.7525, throughput 5.87 MQPS

besides, when the size is less than 1KiB, no unit will also be confusing so we can add a unit "B" (Byte) for the case --ignore-obj-size 0.

$ ../_build/bin/cachesim ../data/cloudPhysicsIO.vscsi vscsi s3fifo 0.0000001 --ignore-obj-size 0
../data/cloudPhysicsIO.vscsi S3FIFO-0.1000-2 cache size      202,           113872 req, miss ratio 1.0000, throughput 8.51 MQPS

After modification,

$ ../_build/bin/cachesim ../data/cloudPhysicsIO.vscsi vscsi s3fifo 0.1 --ignore-obj-size 1
../data/cloudPhysicsIO.vscsi S3FIFO-0.1000-2 cache size     4897,           113872 req, miss ratio 0.7525, throughput 6.81 MQPS

$ ../_build/bin/cachesim ../data/cloudPhysicsIO.vscsi vscsi s3fifo 0.0000001 --ignore-obj-size 0
../data/cloudPhysicsIO.vscsi S3FIFO-0.1000-2 cache size     202B,           113872 req, miss ratio 1.0000, throughput 11.71 MQPS