#include "simgrid/s4u/Actor.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Exec.hpp"
+#include "simgrid/s4u/VirtualMachine.hpp"
+#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/simix/smx_private.hpp"
#include "src/surf/HostImpl.hpp"
{
if (is_on()) {
simix::simcall([this] {
+ for (VirtualMachine* const& vm : vm::VirtualMachineImpl::allVms_)
+ if (vm->get_pm() == this) {
+ vm->shutdown();
+ vm->turn_off();
+ }
this->pimpl_cpu->turn_off();
this->pimpl_->turn_off();
}
}
+/** @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<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);
+}
+
/** Get the properties assigned to a host */
const std::unordered_map<std::string, std::string>* Host::get_properties() const
{
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)
{