next_occurring_event not returning expected value
Hello,
We are using Simgrid to compute the timestamps at which network messages are received.
To do so we are using double model_event = time + model->next_occurring_event(time);
, with model
being the current
network model, and time
the current time of the simulation.
We expected this call to return the timestamp at which the next network message is received, but it doesn't seem to work that way as shown in this example:
- We are using the CM02 network model with a latency of 40ms between the sender and the receiver of the packet. We add a message with a send_time of
39.772560
:
[39.772560] ./src/surf/network_cm02.cpp:401: [res_network/DEBUG] Added action (0xaaee50) one latency event at date 39.812560
...
[39.812560] ./src/surf/network_cm02.cpp:157: [res_network/DEBUG] Something happened to action 0xaaee50
[39.812560] ./src/surf/network_cm02.cpp:161: [res_network/DEBUG] Latency paid for action 0xaaee50. Activating
- The computed value of
model_event
is39.812560
, which is the timestamp at which the latency of the message has been paid, but not the date at which it should be delivered.
[nova-0.lyon.grid5000.fr:vm_coordinator:(1) 39.812560] ./src/kernel/resource/Model.cpp:92: [ker_resource/DEBUG] Action(0xaaee50) Start 39.772560. May finish at 39.812562 (got a share of 52428800.000000). Max_duration -1.000000
...
[39.812562] ./src/surf/network_cm02.cpp:157: [res_network/DEBUG] Something happened to action 0xaaee50
[39.812562] ./src/surf/network_cm02.cpp:170: [res_network/DEBUG] Action 0xaaee50 finished
- Then when we advance the simulation time to
39.812560
and computemodel_event
again, we get the actual timestamp at which the packet should be delivered (As shown by the Action finished log), which is39.812562
. The delta between this timestamp and the previous one is impacted by parameters such as the bandwidth, while the delta between the send_time of the message and the first timestamp is always equal to the latency of the simulated network.
Is this the expected behavior of next_occurring_event
? Is there another way to get the next date
at which a network message will be received?