return pimpl_netpoint_->get_englobing_zone()->get_iface();
}
-void Host::send_to(Host* dest, double byte_amount)
+void Host::sendto(Host* dest, double byte_amount)
+{
+ sendto_async(dest, byte_amount)->wait();
+}
+
+ActivityPtr Host::sendto_async(Host* dest, double byte_amount)
{
std::vector<Host*> m_host_list = {this, dest};
std::vector<double> flops_amount = {0, 0};
std::vector<double> bytes_amount = {0, byte_amount, 0, 0};
- this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+ return this_actor::exec_init(m_host_list, flops_amount, bytes_amount)->start();
}
/** Get the properties assigned to a host */
std::unordered_map<std::string, Storage*> const& Host::get_mounted_storages()
{
- if (mounts_ == nullptr)
- mounts_ = pimpl_->get_mounted_storages();
-
+ kernel::actor::simcall([this] {
+ if (mounts_ == nullptr)
+ mounts_ = pimpl_->get_mounted_storages();
+ });
return *mounts_;
}
}
sg_host_t* sg_host_list()
{
- xbt_assert(sg_host_count() > 0, "There is no host!");
- std::vector<simgrid::s4u::Host*> hosts = simgrid::s4u::Engine::get_instance()->get_all_hosts();
+ simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
+ size_t host_count = e->get_host_count();
+ xbt_assert(host_count > 0, "There is no host!");
+ std::vector<simgrid::s4u::Host*> hosts = e->get_all_hosts();
sg_host_t* res = xbt_new(sg_host_t, hosts.size());
memcpy(res, hosts.data(), sizeof(sg_host_t) * hosts.size());
return simgrid::s4u::Host::by_name_or_null(name);
}
-xbt_dynar_t sg_hosts_as_dynar()
+xbt_dynar_t sg_hosts_as_dynar() // XBT_ATTRIB_DEPRECATED_v330
{
std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::get_instance()->get_all_hosts();
}
// ========= storage related functions ============
-xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host)
+void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
+{
+ std::vector<sg_disk_t> list = host->get_disks();
+ *disk_count = list.size();
+ *disks = static_cast<sg_disk_t*>(xbt_malloc(sizeof(sg_disk_t) * (*disk_count)));
+ for (size_t i = 0; i < *disk_count; i++)
+ (*disks)[i] = list[i];
+}
+
+xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330
{
xbt_assert((host != nullptr), "Invalid parameters");
xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
return min_bandwidth;
}
-void sg_host_send_to(sg_host_t from, sg_host_t to, double byte_amount)
+void sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount)
{
- from->send_to(to, byte_amount);
+ from->sendto(to, byte_amount);
}
/** @brief Displays debugging information about a host */