====== TerraME-HPC ====== ===== Meta modelo ===== TerraME precisa de um metamodelo, que faz múltiplas simulações de um modelo, ou simulações de um mesmo modelo usando diferentes parâmetros. Para tanto, este pequeno programa teria que fazer todas as combinações de parâmetros possíveis. Os valores possíveis destes parâmetros poderiam estar descritos em Lua, num segundo script. Este programa deveria então pegar estas configurações, gerar as simulações e armazenar os resultados de uma forma legível para o modelador. Isto pode ser a primeira fase para a paralelização de modelos no TerraME. ===== ALua ===== http://alua.inf.puc-rio.br/ Computer Languages, Systems & Structures 28 (2002) 155–180 \\ ALua: Fexibility for parallel programming \\ Ururahy, Rodriguez, Ierusalimschy ===== HPC e Agentes ===== [[http://w3.impa.br/~rbs/|Beauclair]]. Pesquisdor do IMPA . http://www.dpi.inpe.br/Miguel/CST/TerraME_Galileu_CLUSTER_HPC/Material_Academico/ Behavioral Modeling for Agents in Real Environments ===== Tutorial no ESSA 2009 ===== Free tutorial for registered ESSA 2009 participants: Social Simulation on the Grid. 14 September 2009, 09:30-12:50, Griffith Theatre, University of Surrey, Guildford, UK. Grid technology allows access to computing resource, often for free; so there's no excuse for not exploring that extra region of parameter space with your model. This tutorial will be useful for anyone wanting to find out more about the Grid/e-Infrastructure, and how to run social simulations on it. Final programme: 09:30 Welcome (Gary Polhill, Research Scientist, Macaulay Land Use Research Institute.) 09:40 Integration of e-Research Software with Social Simulation Software (Neil Chue Hong, Director, OMII-UK.) 10:15 Grid Computing: EGEE and NGS Projects (Hamza Mehammed, Senior Trainer, National e-Science Centre.) 10:45 Coffee break 11:15 Experience: Social Simulation on the Grid with FEARLUS (Gary Polhill) This session will feature a live demo of using simulationBox to run a simulation, and a video of using simulationBox on a cluster. 12:15 Discussion and Q&A 12:50 Close For more information, see: ESSA 2009 Tutorials: http://cress.soc.surrey.ac.uk/essa2009/tutorials.php SimulationBox: http://www.simulationbox.net/ National Grid Service (NGS): http://www.grid-support.ac.uk/ Enabling Grids for E-scienceE (EGEE): http://www.eu-egee.org/ OMII-UK: http://www.omii.ac.uk/ National e-Science Centre (NeSC): http://www.nesc.ac.uk/ European Social Simulation Association: http://www.essa.eu.org/ Macaulay Land Use Research Institute: http://www.macaulay.ac.uk/ Computing Science, University of Aberdeen: http://www.csd.abdn.ac.uk/ =====2.10 - Coroutines ===== Extraido do [[http://www.lua.org/manual/5.0/manual.html|Lua 5.0 Reference Manual]] Lua supports coroutines, also called semi-coroutines or collaborative multithreading. A coroutine in Lua represents an independent thread of execution. Unlike threads in multithread systems, however, a coroutine only suspends its execution by explicitly calling a yield function. You create a coroutine with a call to coroutine.create. Its sole argument is a function that is the main function of the coroutine. The create function only creates a new coroutine and returns a handle to it (an object of type thread); it does not start the coroutine execution. When you first call coroutine.resume, passing as its first argument the thread returned by coroutine.create, the coroutine starts its execution, at the first line of its main function. Extra arguments passed to coroutine.resume are given as parameters for the coroutine main function. After the coroutine starts running, it runs until it terminates or yields. A coroutine can terminate its execution in two ways: Normally, when its main function returns (explicitly or implicitly, after the last instruction); and abnormally, if there is an unprotected error. In the first case, coroutine.resume returns true, plus any values returned by the coroutine main function. In case of errors, coroutine.resume returns false plus an error message. A coroutine yields by calling coroutine.yield. When a coroutine yields, the corresponding coroutine.resume returns immediately, even if the yield happens inside nested function calls (that is, not in the main function, but in a function directly or indirectly called by the main function). In the case of a yield, coroutine.resume also returns true, plus any values passed to coroutine.yield. The next time you resume the same coroutine, it continues its execution from the point where it yielded, with the call to coroutine.yield returning any extra arguments passed to coroutine.resume. The coroutine.wrap function creates a coroutine like coroutine.create, but instead of returning the coroutine itself, it returns a function that, when called, resumes the coroutine. Any arguments passed to that function go as extra arguments to resume. The function returns all the values returned by resume, except the first one (the boolean error code). Unlike coroutine.resume, this function does not catch errors; any error is propagated to the caller. As an example, consider the next code: function foo1 (a) print("foo", a) return coroutine.yield(2*a) end co = coroutine.create(function (a,b) print("co-body", a, b) local r = foo1(a+1) print("co-body", r) local r, s = coroutine.yield(a+b, a-b) print("co-body", r, s) return b, "end" end) a, b = coroutine.resume(co, 1, 10) print("main", a, b) a, b, c = coroutine.resume(co, "r") print("main", a, b, c) a, b, c = coroutine.resume(co, "x", "y") print("main", a, b, c) a, b = coroutine.resume(co, "x", "y") print("main", a, b) When you run it, it produces the following output: co-body 1 10 foo 2 main true 4 co-body r main true 11 -9 co-body x y main true 10 end main false cannot resume dead coroutine