1 -- Copyright (c) 2011, 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 -- This code creates 3 simgrid processes and verifies that the global values
8 -- in each Lua world are correctly cloned from maestro and become different
12 global_string = "A global string set by maestro"
14 -- Assigns to the global string the first argument and prints it
15 function set_global_string(...)
17 global_string = arg[1]
18 simgrid.info("Changing the global string")
22 -- Replaces the function please_dont_change_me() by set_global_string()
26 simgrid.info("Overwriting function please_dont_replace_me()")
27 please_dont_replace_me = set_global_string
28 please_dont_replace_me(...)
31 -- Shows a hello message and prints the global string
32 function please_dont_replace_me(...)
34 simgrid.info("Hello from please_dont_replace_me(). I'm lucky, I still exist in this state.")
38 -- Prints the value of global_string
39 function print_global()
41 simgrid.info("Global string is '" .. global_string .. "'")
46 simgrid.platform("../../platforms/small_platform.xml")
47 simgrid.application("deployment_duplicated_globals.xml")