+
+boost::unordered_map<std::string, Storage*> const& Host::mountedStorages() {
+ if (mounts == nullptr) {
+ mounts = new boost::unordered_map<std::string, Storage*> ();
+
+ xbt_dict_t dict = this->mountedStoragesAsDict();
+
+ xbt_dict_cursor_t cursor;
+ char *mountname;
+ char *storagename;
+ xbt_dict_foreach(dict, cursor, mountname, storagename) {
+ mounts->insert({mountname, &Storage::byName(storagename)});
+ }
+ xbt_dict_free(&dict);
+ }
+
+ return *mounts;
+}
+
+/** Get the properties assigned to a host */
+xbt_dict_t Host::properties() {
+ return simgrid::simix::kernelImmediate([&] { return this->pimpl_->getProperties(); });
+}
+
+/** Retrieve the property value (or nullptr if not set) */
+const char*Host::property(const char*key) {
+ return this->pimpl_->getProperty(key);
+}
+void Host::setProperty(const char*key, const char *value){
+ simgrid::simix::kernelImmediate([&] { this->pimpl_->setProperty(key, value); });
+}
+
+/** Get the processes attached to the host */
+xbt_swag_t Host::processes()
+{
+ return simgrid::simix::kernelImmediate([&]() {
+ return this->extension<simgrid::simix::Host>()->process_list;
+ });
+}
+
+/** Get the peak power of a host */
+double Host::getPstateSpeedCurrent()
+{
+ return simgrid::simix::kernelImmediate([&] {
+ return this->pimpl_cpu->getPstateSpeedCurrent();
+ });
+}
+
+/** Get one power peak (in flops/s) of a host at a given pstate */
+double Host::getPstateSpeed(int pstate_index)
+{
+ return simgrid::simix::kernelImmediate([&] {
+ return this->pimpl_cpu->getPstateSpeed(pstate_index);
+ });
+}
+
+/** @brief Get the speed of the cpu associated to a host */
+double Host::speed() {
+ return pimpl_cpu->getSpeed(1.0);
+}
+/** @brief Returns the number of core of the processor. */
+int Host::coreCount() {
+ return pimpl_cpu->coreCount();
+}
+
+/** @brief Set the pstate at which the host should run */
+void Host::setPstate(int pstate_index)
+{
+ simgrid::simix::kernelImmediate([&](){
+ this->pimpl_cpu->setPState(pstate_index);
+ });
+}
+/** @brief Retrieve the pstate at which the host is currently running */
+int Host::pstate()
+{
+ return this->pimpl_cpu->getPState();
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns the list of storages mounted on an host.
+ * \return a dict containing all storages mounted on the host
+ */
+xbt_dict_t Host::mountedStoragesAsDict()
+{
+ return simgrid::simix::kernelImmediate([&] { return this->pimpl_->getMountedStorageList(); });
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns the list of storages attached to an host.
+ * \return a dict containing all storages attached to the host
+ */
+xbt_dynar_t Host::attachedStorages()
+{
+ return simgrid::simix::kernelImmediate([&] { return this->pimpl_->getAttachedStorageList(); });
+}
+
+} // namespace simgrid
+} // namespace s4u