X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/450b524c743d19378a2efa1d3c19672e19fa4b2c..6b3dd9b27c5fe2b1000b169b24e248be102a1d15:/include/simgrid/s4u/Host.hpp?ds=sidebyside diff --git a/include/simgrid/s4u/Host.hpp b/include/simgrid/s4u/Host.hpp index d8b4d43d41..f50f1484b7 100644 --- a/include/simgrid/s4u/Host.hpp +++ b/include/simgrid/s4u/Host.hpp @@ -45,11 +45,8 @@ public: explicit Host(const std::string& name); protected: - virtual ~Host(); - void set_netpoint(kernel::routing::NetPoint* netpoint) { pimpl_netpoint_ = netpoint; } - -private: - bool currently_destroying_ = false; + virtual ~Host(); // Call destroy() instead of manually deleting it. + Host* set_netpoint(kernel::routing::NetPoint* netpoint); #endif public: @@ -103,9 +100,9 @@ public: bool is_on() const; const char* get_property(const std::string& key) const; - void set_property(const std::string& key, const std::string& value); + Host* set_property(const std::string& key, const std::string& value); const std::unordered_map* get_properties() const; - void set_properties(const std::unordered_map& properties); + Host* set_properties(const std::unordered_map& properties); void set_state_profile(kernel::profile::Profile* p); void set_speed_profile(kernel::profile::Profile* p); @@ -131,8 +128,11 @@ public: * This accounts for external load (see @ref simgrid::surf::Cpu::set_speed_profile()). */ double get_available_speed() const; + /** Returns the number of core of the processor. */ int get_core_count() const; + Host* set_core_count(int core_count); + /** Returns the current computation load (in flops per second) * * The external load (coming from an availability trace) is not taken in account. @@ -146,17 +146,10 @@ public: int get_pstate() const; std::vector get_disks() const; + Disk* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth); void add_disk(const Disk* disk); void remove_disk(const std::string& disk_name); - std::vector get_attached_storages() const; - - /** Get an associative list [mount point]->[Storage] of all local mount points. - * - * This is defined in the platform file, and cannot be modified programmatically (yet). - */ - std::unordered_map const& get_mounted_storages(); - void route_to(const Host* dest, std::vector& links, double* latency) const; void route_to(const Host* dest, std::vector& links, double* latency) const; /** Do a blocking communication between two arbitrary hosts. @@ -190,6 +183,7 @@ public: */ void execute(double flops) const; /** Start an asynchronous computation on that host (possibly remote) */ + ExecPtr exec_init(double flops_amounts) const; ExecPtr exec_async(double flops_amounts) const; /** Block the calling actor on an execution located on the called host (with explicit priority) */ @@ -197,7 +191,6 @@ public: private: xbt::string name_{"noname"}; - std::unordered_map* mounts_ = nullptr; // caching kernel::routing::NetPoint* pimpl_netpoint_ = nullptr; public: