Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
51cd58c40ac18930417c08c10e83b2db3d243f3f
[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   events.sleep(5)
10
11   if job.me.ip() == job.nodes[1].ip then
12     rpc.call(job.nodes[2], {"call_me", job.me.ip()})
13   end
14   events.sleep(5)
15   os.exit()
16 end
17
18 function call_me(from)
19   log:print("I received an RPC from "..from)
20 end
21
22 events.thread("SPLAYschool")
23 start.loop()
24