X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fe304706848f0a64477d4687b3ea97d5b9a0c35c..4dac6adc7601ff45e1bb458032c95fab5c73721d:/src/s4u/s4u_Host.cpp diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index a99e6a8680..db85aa3ec9 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -171,6 +171,20 @@ void Host::route_to(Host* dest, std::vector& links, } } +/** @brief Returns the networking zone englobing that host */ +NetZone* Host::get_englobing_zone() +{ + return pimpl_netpoint->get_englobing_zone()->get_iface(); +} + +void Host::send_to(Host* dest, double byte_amount) +{ + std::vector m_host_list = {this, dest}; + std::vector flops_amount = {0, 0}; + std::vector bytes_amount = {0, byte_amount, 0, 0}; + this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount); +} + /** Get the properties assigned to a host */ const std::unordered_map* Host::get_properties() const { @@ -591,6 +605,11 @@ double sg_host_route_bandwidth(sg_host_t from, sg_host_t to) return min_bandwidth; } +void sg_host_send_to(sg_host_t from, sg_host_t to, double byte_amount) +{ + from->send_to(to, byte_amount); +} + /** @brief Displays debugging information about a host */ void sg_host_dump(sg_host_t host) {