X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/63dae9fee48b67ed8302130aa84c8a54cd42241b..9ec7c8ee1c9578ccc16b328c5d4992f641a4ead3:/include/simgrid/s4u/Engine.hpp diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index 074a242bc5..778bc84969 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -41,25 +41,23 @@ public: #endif /** Finalize the default engine and all its dependencies */ - static void shutdown(); + void shutdown(); - /** Run the simulation after initialization */ + /** Run the simulation until its end */ void run() const; + /** Run the simulation until the specified date */ + void run_until(double max_date) const; + /** @brief Retrieve the simulation time (in seconds) */ static double get_clock(); /** @brief Retrieve the engine singleton */ static s4u::Engine* get_instance(); + static s4u::Engine* get_instance(int* argc, char** argv); + static bool has_instance() { return instance_ != nullptr; } void load_platform(const std::string& platf) const; -#ifndef DOXYGEN - XBT_ATTRIB_DEPRECATED_v330("Please change the return code of your actors to void") void register_function( - const std::string& name, int (*code)(int, char**)); - XBT_ATTRIB_DEPRECATED_v330("Please change the return code of your actors to void") void register_default( - int (*code)(int, char**)); -#endif - void register_function(const std::string& name, const std::function& code); void register_function(const std::string& name, const std::function)>& code); void register_function(const std::string& name, const kernel::actor::ActorCodeFactory& factory); @@ -89,12 +87,12 @@ public: protected: #ifndef DOXYGEN - friend surf::HostImpl; friend Host; friend Link; friend Disk; friend kernel::routing::NetPoint; friend kernel::routing::NetZoneImpl; + friend kernel::resource::HostImpl; friend kernel::resource::LinkImpl; void host_register(const std::string& name, Host* host); void host_unregister(const std::string& name); @@ -171,6 +169,8 @@ public: return res; } + kernel::EngineImpl* get_impl() const { return pimpl; } + /** Returns whether SimGrid was initialized yet -- mostly for internal use */ static bool is_initialized(); /** @brief set a configuration variable @@ -189,6 +189,7 @@ public: static void set_config(const std::string& name, double value); static void set_config(const std::string& name, const std::string& value); + Engine* set_default_comm_data_copy_callback(void (*callback)(kernel::activity::CommImpl*, void*, size_t)); /** Callback fired when the platform is created (ie, the xml file parsed), * right before the actual simulation starts. */ static xbt::signal on_platform_created;