Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to activate coverity for simgrid
[simgrid.git] / examples / lua / SimSplay / splay_school.lua
1 -- Copyright (c) 2011, 2014. The SimGrid Team.
2 -- All rights reserved.
3
4 -- This program is free software; you can redistribute it and/or modify it
5 -- under the terms of the license (GNU LGPL) which comes with this package.
6
7 require("sim_splay")
8
9 function SPLAYschool()
10   log:print("My ip is: "..job.me.ip())
11   for i = 1,200 do
12     log:print(i)
13   end
14 --[[
15   events.sleep(5)
16
17   if job.me.ip() == job.nodes[1].ip then
18     rpc.call(job.nodes[2], {"call_me", job.me.ip()})
19   end
20   events.sleep(5)
21   os.exit()
22   --]]
23 end
24
25 function call_me(from)
26   log:print("I received an RPC from "..from)
27 end
28
29 events.thread("SPLAYschool")
30 start.loop()
31 log:print("Simulation finished")
32