mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Debug send_cancel
This commit is contained in:
parent
e0dbebe31d
commit
371749159b
1 changed files with 9 additions and 4 deletions
|
@ -9,9 +9,9 @@ class Simulator:
|
||||||
Event types:
|
Event types:
|
||||||
- 0 send (0,timestamp,(src,dst,interface,data,datasize,duration,datasize_remaining,start_timestamp, perform_delivery, receiver_required), 2)
|
- 0 send (0,timestamp,(src,dst,interface,data,datasize,duration,datasize_remaining,start_timestamp, perform_delivery, receiver_required), 2)
|
||||||
- 1 timeout (1,timestamp,node_id,3)
|
- 1 timeout (1,timestamp,node_id,3)
|
||||||
- 2 breakpoint_manual (3,timestamp,0,1)
|
- 2 breakpoint_manual (2,timestamp,0,1)
|
||||||
- 3 breakpoint_auto (4,timestamp,0,1)
|
- 3 breakpoint_auto (3,timestamp,0,1)
|
||||||
- 4 notify (5,timestamp,node_id,0)
|
- 4 notify (4,timestamp,node_id,0)
|
||||||
|
|
||||||
|
|
||||||
Very important notes:
|
Very important notes:
|
||||||
|
@ -231,14 +231,18 @@ class Simulator:
|
||||||
self.sync_node_blocking(sender_node)
|
self.sync_node_blocking(sender_node)
|
||||||
elif node["request"] == "send_cancel":
|
elif node["request"] == "send_cancel":
|
||||||
selector=list()
|
selector=list()
|
||||||
|
sharing_to_update=list()
|
||||||
for event in self.events:
|
for event in self.events:
|
||||||
if event[0]==0 and int(event[2][0]) == node.node_id:
|
if event[0]==0 and int(event[2][0]) == node.node_id:
|
||||||
selector.append(True)
|
selector.append(True)
|
||||||
if self.netmat[event[2][2]]["is_wired"]:
|
if self.netmat[event[2][2]]["is_wired"]:
|
||||||
self.update_sharing(int(event[2][1]),-1,event[2][2])
|
sharing_to_update.append((int(event[2][1]),event[2][2]))
|
||||||
else:
|
else:
|
||||||
selector.append(False)
|
selector.append(False)
|
||||||
self.events=self.events[~np.array(selector)]
|
self.events=self.events[~np.array(selector)]
|
||||||
|
# Now Update receiver of cancel communication sharing (since update_sharing sort event, selector would have been invalidated if done before)
|
||||||
|
for com in sharing_to_update:
|
||||||
|
self.update_sharing(com[0],-1,com[1])
|
||||||
node["state"]="running"
|
node["state"]="running"
|
||||||
node.rqueue.put(("send_cancel",0))
|
node.rqueue.put(("send_cancel",0))
|
||||||
node.sync()
|
node.sync()
|
||||||
|
@ -246,6 +250,7 @@ class Simulator:
|
||||||
def update_sharing(self, dst, amount,interface):
|
def update_sharing(self, dst, amount,interface):
|
||||||
"""
|
"""
|
||||||
Manage bandwidth sharing on wired interfaces
|
Manage bandwidth sharing on wired interfaces
|
||||||
|
THIS FUNCTION SORT EVENTS SO BE CAREFUL SINCE IT CAN INVALIDATE SELECTORS
|
||||||
"""
|
"""
|
||||||
sharing=self.sharing[interface][dst]
|
sharing=self.sharing[interface][dst]
|
||||||
new_sharing=sharing+amount
|
new_sharing=sharing+amount
|
||||||
|
|
Loading…
Add table
Reference in a new issue