X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/376c276e460465f8c897215240fa7094a635fe7b..2961338407d12e499aba2b9086f22350ac3668ff:/src/s4u/s4u_Host.cpp diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 0b81ba17dc..d84f23e6e8 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -65,7 +65,7 @@ Host::~Host() */ void Host::destroy() { - kernel::actor::simcall([this] { this->pimpl_->destroy(); }); + kernel::actor::simcall_answered([this] { this->pimpl_->destroy(); }); } Host* Host::by_name(const std::string& name) @@ -79,7 +79,7 @@ Host* Host::by_name_or_null(const std::string& name) Host* Host::current() { - kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self(); + const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self(); xbt_assert(self != nullptr, "Cannot call Host::current() from the maestro context"); return self->get_host(); } @@ -97,7 +97,7 @@ const char* Host::get_cname() const void Host::turn_on() { if (not is_on()) { - kernel::actor::simcall([this] { + kernel::actor::simcall_answered([this] { this->pimpl_cpu_->turn_on(); this->pimpl_->turn_on(); on_state_change(*this); @@ -110,7 +110,7 @@ void Host::turn_off() { if (is_on()) { const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self(); - kernel::actor::simcall([this, self] { + kernel::actor::simcall_answered([this, self] { for (VirtualMachine* const& vm : kernel::resource::VirtualMachineImpl::allVms_) if (vm->get_pm() == this) { vm->shutdown(); @@ -201,13 +201,13 @@ const char* Host::get_property(const std::string& key) const Host* Host::set_property(const std::string& key, const std::string& value) { - kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); }); + kernel::actor::simcall_answered([this, &key, &value] { this->pimpl_->set_property(key, value); }); return this; } Host* Host::set_properties(const std::unordered_map& properties) { - kernel::actor::simcall([this, &properties] { this->pimpl_->set_properties(properties); }); + kernel::actor::simcall_answered([this, &properties] { this->pimpl_->set_properties(properties); }); return this; } @@ -215,7 +215,7 @@ Host* Host::set_properties(const std::unordered_map& p * The profile must contain boolean values. */ Host* Host::set_state_profile(kernel::profile::Profile* p) { - kernel::actor::simcall([this, p] { pimpl_cpu_->set_state_profile(p); }); + kernel::actor::simcall_answered([this, p] { pimpl_cpu_->set_state_profile(p); }); return this; } /** Specify a profile modeling the external load according to an exhaustive list or a stochastic law. @@ -226,7 +226,7 @@ Host* Host::set_state_profile(kernel::profile::Profile* p) */ Host* Host::set_speed_profile(kernel::profile::Profile* p) { - kernel::actor::simcall([this, p] { pimpl_cpu_->set_speed_profile(p); }); + kernel::actor::simcall_answered([this, p] { pimpl_cpu_->set_speed_profile(p); }); return this; } @@ -251,7 +251,7 @@ double Host::get_available_speed() const Host* Host::set_sharing_policy(SharingPolicy policy, const s4u::NonLinearResourceCb& cb) { - kernel::actor::simcall([this, policy, &cb] { pimpl_cpu_->set_sharing_policy(policy, cb); }); + kernel::actor::simcall_answered([this, policy, &cb] { pimpl_cpu_->set_sharing_policy(policy, cb); }); return this; } @@ -267,13 +267,13 @@ int Host::get_core_count() const Host* Host::set_core_count(int core_count) { - kernel::actor::simcall([this, core_count] { this->pimpl_cpu_->set_core_count(core_count); }); + kernel::actor::simcall_answered([this, core_count] { this->pimpl_cpu_->set_core_count(core_count); }); return this; } Host* Host::set_pstate_speed(const std::vector& speed_per_state) { - kernel::actor::simcall([this, &speed_per_state] { pimpl_cpu_->set_pstate_speed(speed_per_state); }); + kernel::actor::simcall_answered([this, &speed_per_state] { pimpl_cpu_->set_pstate_speed(speed_per_state); }); return this; } @@ -301,7 +301,7 @@ Host* Host::set_pstate_speed(const std::vector& speed_per_state) /** @brief Set the pstate at which the host should run */ Host* Host::set_pstate(unsigned long pstate_index) { - kernel::actor::simcall([this, pstate_index] { this->pimpl_cpu_->set_pstate(pstate_index); }); + kernel::actor::simcall_answered([this, pstate_index] { this->pimpl_cpu_->set_pstate(pstate_index); }); return this; } @@ -313,14 +313,14 @@ unsigned long Host::get_pstate() const Host* Host::set_factor_cb(const std::function& cb) { - kernel::actor::simcall([this, &cb] { pimpl_cpu_->set_factor_cb(cb); }); + kernel::actor::simcall_answered([this, &cb] { pimpl_cpu_->set_factor_cb(cb); }); return this; } Host* Host::set_coordinates(const std::string& coords) { if (not coords.empty()) - kernel::actor::simcall([this, coords] { this->pimpl_netpoint_->set_coordinates(coords); }); + kernel::actor::simcall_answered([this, coords] { this->pimpl_netpoint_->set_coordinates(coords); }); return this; } std::vector Host::get_disks() const @@ -330,7 +330,7 @@ std::vector Host::get_disks() const Disk* Host::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) { - return kernel::actor::simcall([this, &name, read_bandwidth, write_bandwidth] { + return kernel::actor::simcall_answered([this, &name, read_bandwidth, write_bandwidth] { auto* disk = pimpl_->create_disk(name, read_bandwidth, write_bandwidth); pimpl_->add_disk(disk); return disk; @@ -358,12 +358,12 @@ Disk* Host::create_disk(const std::string& name, const std::string& read_bandwid void Host::add_disk(const Disk* disk) { - kernel::actor::simcall([this, disk] { this->pimpl_->add_disk(disk); }); + kernel::actor::simcall_answered([this, disk] { this->pimpl_->add_disk(disk); }); } void Host::remove_disk(const std::string& disk_name) { - kernel::actor::simcall([this, disk_name] { this->pimpl_->remove_disk(disk_name); }); + kernel::actor::simcall_answered([this, disk_name] { this->pimpl_->remove_disk(disk_name); }); } VirtualMachine* Host::create_vm(const std::string& name, int core_amount) @@ -398,7 +398,7 @@ void Host::execute(double flops, double priority) const Host* Host::seal() { - kernel::actor::simcall([this]() { this->pimpl_->seal(); }); + kernel::actor::simcall_answered([this]() { this->pimpl_->seal(); }); simgrid::s4u::Host::on_creation(*this); // notify the signal return this; } @@ -649,7 +649,7 @@ void sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount) } /** @brief Displays debugging information about a host */ -void sg_host_dump(const_sg_host_t host) +void sg_host_dump(const_sg_host_t host) // XBT_ATTRIB_DEPRECATED_v335 { XBT_INFO("Displaying host %s", host->get_cname()); XBT_INFO(" - speed: %.0f", host->get_speed());