1 -- Copyright (c) 2011, 2013-2014. The SimGrid Team.
2 -- All rights reserved.
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.
7 -- Slave Function ---------------------------------------------------------
11 error("Wrong number of arguments (got " .. #arg .. ", expected 1: slave_id)")
14 local my_mailbox = "slave " .. arg[1]
15 simgrid.info("Hello from lua, I'm a poor slave with mbox: " .. my_mailbox)
19 local task = simgrid.task.recv(my_mailbox);
21 local task_name = task:get_name()
22 if (task:get_name() == "finalize") then
23 simgrid.info("Slave '" .. my_mailbox .. "' got finalize msg");
26 --local tk_name = simgrid.task.get_name(tk)
27 simgrid.info("Slave '" .. my_mailbox .. "' processing " .. task:get_name())
28 simgrid.task.execute(task)
29 simgrid.info("Slave '" .. my_mailbox .. "': task " .. task:get_name() .. " done")
32 simgrid.info("Slave '" .. my_mailbox .. "': I'm Done . See You !!");