Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lua / Splay: some cleanups
[simgrid.git] / examples / lua / SimSplay / splay_school.lua
1 require("sim_splay")
2
3 function SPLAYschool()
4   log:print("My ip is: "..job.me.ip())
5   for i = 1000,10000 do
6     log:print(i)
7   end
8   
9 --[[
10   events.sleep(5)
11
12   if job.me.ip() == job.nodes[1].ip then
13     log:print("calling")
14     rpc.call(job.nodes[2], {"call_me", job.me.ip()})
15   end
16   log:print("second sleep")
17   events.sleep(5)
18   os.exit()
19 ]]
20 end
21
22 function call_me(from)
23   log:print("I received an RPC from "..from)
24 end
25
26 events.thread("SPLAYschool")
27 start.loop()
28