Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between unit of measurement used for message size definition and latency calculation #38

Open
MarkoRimac opened this issue Jan 19, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@MarkoRimac
Copy link

MarkoRimac commented Jan 19, 2021

Constructor of Message class in application.py module is defined like this:

def __init__(self, name, src, dst, instructions=0, bytes=0,broadcasting=False):

Clearly it states that message size is suppose to be defined in bytes.
But then again, looking at the core.py module, calculation of latency goes like this:

size_bits = message.bytes
# size_bits = message.bytes * 8
try:
  #  transmit = size_bits / (self.topology.get_edge(link)[Topology.LINK_BW] * 1000000.0)  # MBITS!
    transmit = size_bits / (self.topology.get_edge(link)[Topology.LINK_BW] * 1000000.0)  # MBITS!
    propagation = self.topology.get_edge(link)[Topology.LINK_PR]
    latency_msg_link = transmit + propagation

Here transmit has a comment at the end of a line that it's defined in MBITS (Mb) but in fact its presented in MBAJTS (MB) because size_bits variable is actually presented in bytes (we can see that in 1st line of code).

For specific use-cases this confused me because I thought latency was calculated using bits and not bytes because of the comment # MBITS! and variable name size_bits

@MarkoRimac MarkoRimac changed the title Inconsistency in unit of measurement used for message size Inconsistency between unit of measurement used for message size and latency calculation Jan 19, 2021
@MarkoRimac MarkoRimac changed the title Inconsistency between unit of measurement used for message size and latency calculation Inconsistency between unit of measurement used for message size definition and latency calculation Jan 19, 2021
@wisaaco
Copy link
Contributor

wisaaco commented Jan 22, 2021

Thanks Marko for your point. That function is a little mesh and the name of the variables does not help.
I will try to fix with the right nomenclature since the idea is to work with Bytes, and MB.

@wisaaco wisaaco added the enhancement New feature or request label Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants