Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New: Engine::run_until(date) to split the simulation
[simgrid.git] / include / simgrid / s4u / Engine.hpp
index 074a242..778bc84 100644 (file)
@@ -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<void(int, char**)>& code);
   void register_function(const std::string& name, const std::function<void(std::vector<std::string>)>& 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<void()> on_platform_created;