X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/53f36dc53dfef67528460488c6d8ee3913153968..16f1630ae434e729cbe0b24fe2f19c8f67f774cd:/src/s4u/s4u_Engine.cpp diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index 5339a77f3e..ba96fac442 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -8,6 +8,7 @@ #include "mc/mc.h" #include "simgrid/kernel/routing/NetPoint.hpp" #include "simgrid/kernel/routing/NetZoneImpl.hpp" +#include "simgrid/s4u/Disk.hpp" #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Host.hpp" #include "simgrid/s4u/Mailbox.hpp" @@ -73,16 +74,11 @@ double Engine::get_clock() } /** - * @brief A platform loader. + * Creates a new platform, including hosts, links, and the routing table. * - * Creates a new platform, including hosts, links, and the routing_table. - * @param platf a filename of the XML description of a platform. This file follows this DTD : - * - * @include src/surf/xml/simgrid.dtd - * - * Here is a small example of such a platform - * - * @include examples/platforms/small_platform.xml + * \rst + * See also: :ref:`platform`. + * \endrst */ void Engine::load_platform(const std::string& platf) { @@ -97,23 +93,36 @@ void Engine::load_platform(const std::string& platf) XBT_DEBUG("PARSE TIME: %g", (end - start)); } +/** Registers the main function of an actor that will be launched from the deployment file */ void Engine::register_function(const std::string& name, int (*code)(int, char**)) { SIMIX_function_register(name, code); } +/** Registers the main function of an actor that will be launched from the deployment file */ void Engine::register_function(const std::string& name, void (*code)(std::vector)) { SIMIX_function_register(name, code); } +/** Registers a function as the default main function of actors + * + * It will be used as fallback when the function requested from the deployment file was not registered. + * It is used for trace-based simulations (see examples/s4u/replay-comms and similar). + */ void Engine::register_default(int (*code)(int, char**)) { SIMIX_function_register_default(code); } +/** Load a deployment file and launch the actors that it contains + * + * \rst + * See also: :ref:`deploy`. + * \endrst + */ void Engine::load_deployment(const std::string& deploy) { SIMIX_launch_application(deploy); } -/** @brief Returns the amount of hosts in the platform */ +/** Returns the amount of hosts in the platform */ size_t Engine::get_host_count() { return pimpl->hosts_.size(); @@ -406,3 +415,7 @@ double simgrid_get_clock() { return simgrid::s4u::Engine::get_clock(); } +int simgrid_get_actor_count() +{ + return simgrid::s4u::Engine::get_instance()->get_actor_count(); +}