SimGrid 3.6.2
Scalable simulation of distributed systems
Master/slave Bypass Lua application

Simulation of a master-slave application using lua bindings, Bypassing the XML parser

Code of the application

Master code

as described ine the C native master/Slave exmaple , this function has to be assigned to a m_process_t that will behave as the master.

Lua style arguments (...) in for the master are interpreted as:

Tasks are dumbly sent in a round-robin style.

Slave code

This function has to be assigned to a m_process_t that has to behave as a slave. This function keeps waiting for tasks and executes them as it receives them.

Simulation core

in this section the core of the simulation which start by including the simgrid lib for bindings, then create the resources we need to set up our environment bypassing the XML parser. : require "simgrid"

  1. Hosts : simgrid.Host.new instanciate a new host with an id, and power.
  2. Links : simgrid.Link.new instanictae a new link that will require an id, bandwith and latency values.
  3. Route : simgrid.Route.new define a route between two hosts specifying the links to use.
  4. Simulation settings : simgrid.register_platform(); register own platform without using the XML SURF parser.

we can also bypass the XML deployment file, and associate functions for each of defined hosts.


Back to the main Simgrid Documentation page The version of Simgrid documented here is v3.6.2.
Documentation of other versions can be found in their respective archive files (directory doc/html).
Generated for SimGridAPI by doxygen