Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Incorporate simgrid-java in simgrid-java/.
[simgrid.git] / examples / lua / SimSplay / splay_school.lua
index 6be8f72..358c36f 100644 (file)
@@ -1,19 +1,26 @@
-dofile 'sim_splay.lua'
+require("sim_splay")
 
 function SPLAYschool()
-    log:print("My ip is :" ..job.me.ip())
-    events.sleep(5)
-    rpc.call(job.nodes[3],{"call_me","Arg_test"})
-    events.sleep(5)
-    os.exit()
+  log:print("My ip is: "..job.me.ip())
+  for i = 1,200 do
+    log:print(i)
+  end
+--[[
+  events.sleep(5)
+
+  if job.me.ip() == job.nodes[1].ip then
+    rpc.call(job.nodes[2], {"call_me", job.me.ip()})
+  end
+  events.sleep(5)
+  os.exit()
+  --]]
 end
 
-function call_me(position)
-    log:print("I received an RPC from node "..position);
+function call_me(from)
+  log:print("I received an RPC from "..from)
 end
 
 events.thread("SPLAYschool")
 start.loop()
-
-
+log:print("Simulation finished")