summaryrefslogtreecommitdiff
path: root/esds/simulator.py
diff options
context:
space:
mode:
Diffstat (limited to 'esds/simulator.py')
-rw-r--r--esds/simulator.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/esds/simulator.py b/esds/simulator.py
index a9866b8..b65e5cf 100644
--- a/esds/simulator.py
+++ b/esds/simulator.py
@@ -128,7 +128,7 @@ class Simulator:
Process all call request and wait for Node.sync() to return
"""
node.sync()
- while node["state"] == "call":
+ while node["state"] == "call_non_blocking":
if node["request"] == "log":
self.log(node.rargs,node=node.node_id)
node["state"]="running"
@@ -267,7 +267,7 @@ class Simulator:
"""
Collect events from the nodes
"""
- if node["state"] == "request":
+ if node["state"] == "call_blocking":
if node["request"] == "send":
node["state"]="pending"
interface, data, datasize, dst=node.rargs
@@ -303,7 +303,7 @@ class Simulator:
duration=datasize*8/(self.netmat[interface]["bandwidth"][src,dst]/self.sharing[interface][dst])+self.netmat[interface]["latency"][src,dst]
self.add_event(0,duration+self.time,(src,dst,interface,data,datasize,duration,datasize,self.time))
else:
- nsrc["state"]="request" # Try later when node is on
+ nsrc["state"]="call_blocking" # Try later when node is on
else:
self.log("Send "+str(datasize)+" bytes on "+interface,node=src)
for dst in self.list_receivers(nsrc,interface):
@@ -392,7 +392,7 @@ class Simulator:
self.update_sharing(dst.node_id,-1,interface)
self.log("Receive "+str(datasize)+" bytes on "+interface,node=int(dst_id))
# If node is receiving makes it consume (this way if there is a timeout, it will be removed!)
- if dst["state"] == "request" and dst["request"] == "receive":
+ if dst["state"] == "call_blocking" and dst["request"] == "receive":
dst["interfaces_queue_size"][interface]-=1
dst["state"]="running"
dst.rqueue.put(("receive",0))
@@ -405,7 +405,7 @@ class Simulator:
dst["interfaces_queue_size"][interface]+=1
self.log("Receive "+str(datasize)+" bytes on "+interface,node=int(dst_id))
# If node is receiving makes it consume (this way if there is a timeout, it will be removed!)
- if dst["state"] == "request" and dst["request"] == "receive":
+ if dst["state"] == "call_blocking" and dst["request"] == "receive":
dst["interfaces_queue_size"][interface]-=1
dst["state"]="running"
dst.rqueue.put(("receive",0))