Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / src / s4u / s4u_Host.cpp
1 /* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include <simgrid/Exception.hpp>
7 #include <simgrid/host.h>
8 #include <simgrid/kernel/routing/NetPoint.hpp>
9 #include <simgrid/s4u/Comm.hpp>
10 #include <simgrid/s4u/Engine.hpp>
11 #include <simgrid/s4u/Exec.hpp>
12 #include <simgrid/s4u/Host.hpp>
13 #include <simgrid/s4u/VirtualMachine.hpp>
14 #include <xbt/parse_units.hpp>
15
16 #include "simgrid/simix.hpp"
17 #include "src/kernel/resource/HostImpl.hpp"
18 #include "src/kernel/resource/StandardLinkImpl.hpp"
19 #include "src/kernel/resource/VirtualMachineImpl.hpp"
20
21 #include <string>
22
23 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_host, s4u, "Logging specific to the S4U hosts");
24 XBT_LOG_EXTERNAL_CATEGORY(ker_platform);
25
26 namespace simgrid {
27
28 template class xbt::Extendable<s4u::Host>;
29
30 namespace s4u {
31
32 #ifndef DOXYGEN
33 xbt::signal<void(Host&)> Host::on_creation;
34 xbt::signal<void(Host const&)> Host::on_destruction;
35 xbt::signal<void(Host const&)> Host::on_onoff;
36 xbt::signal<void(Host const&)> Host::on_speed_change;
37 xbt::signal<void(kernel::resource::CpuAction&, kernel::resource::Action::State)> Host::on_exec_state_change;
38 #endif
39
40 Host* Host::set_cpu(kernel::resource::CpuImpl* cpu)
41 {
42   pimpl_cpu_ = cpu;
43   return this;
44 }
45
46 #ifndef DOXYGEN
47 Host* Host::set_netpoint(kernel::routing::NetPoint* netpoint)
48 {
49   pimpl_netpoint_ = netpoint;
50   return this;
51 }
52
53 Host::~Host()
54 {
55   if (pimpl_netpoint_ != nullptr) // not removed yet by a children class
56     Engine::get_instance()->netpoint_unregister(pimpl_netpoint_);
57   delete pimpl_cpu_;
58 }
59 #endif
60
61 /** @brief Fire the required callbacks and destroy the object
62  *
63  * Don't delete directly a host, call h->destroy() instead.
64  *
65  * This is cumbersome but this is the simplest solution to ensure that the on_destruction() callback receives a valid
66  * object (because of the destructor order in a class hierarchy).
67  */
68 void Host::destroy()
69 {
70   kernel::actor::simcall_answered([this] { this->pimpl_->destroy(); });
71 }
72
73 Host* Host::by_name(const std::string& name)
74 {
75   return Engine::get_instance()->host_by_name(name);
76 }
77 Host* Host::by_name_or_null(const std::string& name)
78 {
79   return Engine::get_instance()->host_by_name_or_null(name);
80 }
81
82 Host* Host::current()
83 {
84   const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
85   xbt_assert(self != nullptr, "Cannot call Host::current() from the maestro context");
86   return self->get_host();
87 }
88
89 std::string const& Host::get_name() const
90 {
91   return this->pimpl_->get_name();
92 }
93
94 const char* Host::get_cname() const
95 {
96   return this->pimpl_->get_cname();
97 }
98
99 void Host::turn_on()
100 {
101   if (not is_on()) {
102     kernel::actor::simcall_answered([this] {
103       this->pimpl_cpu_->turn_on();
104       this->pimpl_->turn_on();
105       on_onoff(*this);
106       on_this_onoff(*this);
107     });
108   }
109 }
110
111 /** @brief Stop the host if it is on */
112 void Host::turn_off()
113 {
114   if (is_on()) {
115     const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
116     kernel::actor::simcall_answered([this, self] {
117       this->pimpl_cpu_->turn_off();
118       this->pimpl_->turn_off(self);
119
120       on_onoff(*this);
121       on_this_onoff(*this);
122     });
123   }
124 }
125
126 bool Host::is_on() const
127 {
128   return this->pimpl_cpu_->is_on();
129 }
130
131 unsigned long Host::get_pstate_count() const
132 {
133   return this->pimpl_cpu_->get_pstate_count();
134 }
135
136 /**
137  * @brief Return a copy of the list of actors that are executing on this host.
138  *
139  * Daemons and regular actors are all mixed in this list.
140  */
141 std::vector<ActorPtr> Host::get_all_actors() const
142 {
143   return pimpl_->get_all_actors();
144 }
145
146 /** @brief Returns how many actors (daemonized or not) have been launched on this host */
147 size_t Host::get_actor_count() const
148 {
149   return pimpl_->get_actor_count();
150 }
151
152 /**
153  * @brief Find a route toward another host
154  *
155  * @param dest [IN] where to
156  * @param links [OUT] where to store the list of links (must exist, cannot be nullptr).
157  * @param latency [OUT] where to store the latency experienced on the path (or nullptr if not interested)
158  *                It is the caller responsibility to initialize latency to 0 (we add to provided route)
159  *
160  * walk through the routing components tree and find a route between hosts
161  * by calling each "get_route" function in each routing component.
162  */
163 void Host::route_to(const Host* dest, std::vector<Link*>& links, double* latency) const
164 {
165   std::vector<kernel::resource::StandardLinkImpl*> linkImpls;
166   this->route_to(dest, linkImpls, latency);
167   for (auto* l : linkImpls)
168     links.push_back(l->get_iface());
169 }
170 std::pair<std::vector<Link*>, double> Host::route_to(const Host* dest) const
171 {
172   std::vector<kernel::resource::StandardLinkImpl*> linkImpls;
173   std::vector<Link*> links;
174   double latency = 0;
175   this->route_to(dest, linkImpls, &latency);
176   for (auto* l : linkImpls)
177     links.push_back(l->get_iface());
178   return std::make_pair(links, latency);
179 }
180
181 /** @brief Just like Host::routeTo, but filling an array of link implementations */
182 void Host::route_to(const Host* dest, std::vector<kernel::resource::StandardLinkImpl*>& links, double* latency) const
183 {
184   kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint_, dest->get_netpoint(), links, latency);
185   if (XBT_LOG_ISENABLED(ker_platform, xbt_log_priority_debug)) {
186     XBT_CDEBUG(ker_platform, "Route from '%s' to '%s' (latency: %f):", get_cname(), dest->get_cname(),
187                (latency == nullptr ? -1 : *latency));
188     for (auto const* link : links)
189       XBT_CDEBUG(ker_platform, "  Link '%s'", link->get_cname());
190   }
191 }
192
193 /** @brief Returns the networking zone englobing that host */
194 NetZone* Host::get_englobing_zone() const
195 {
196   return pimpl_netpoint_->get_englobing_zone()->get_iface();
197 }
198
199 /** Get the properties assigned to a host */
200 const std::unordered_map<std::string, std::string>* Host::get_properties() const
201 {
202   return this->pimpl_->get_properties();
203 }
204
205 /** Retrieve the property value (or nullptr if not set) */
206 const char* Host::get_property(const std::string& key) const
207 {
208   return this->pimpl_->get_property(key);
209 }
210
211 Host* Host::set_property(const std::string& key, const std::string& value)
212 {
213   kernel::actor::simcall_object_access(pimpl_, [this, &key, &value] { this->pimpl_->set_property(key, value); });
214   return this;
215 }
216
217 Host* Host::set_properties(const std::unordered_map<std::string, std::string>& properties)
218 {
219   kernel::actor::simcall_object_access(pimpl_, [this, &properties] { this->pimpl_->set_properties(properties); });
220   return this;
221 }
222
223 int Host::get_concurrency_limit() const
224 {
225   return pimpl_cpu_->get_concurrency_limit();
226 }
227
228 Host* Host::set_concurrency_limit(int limit)
229 {
230   kernel::actor::simcall_object_access(pimpl_cpu_, [this, limit] { pimpl_cpu_->set_concurrency_limit(limit); });
231   return this;
232 }
233
234 /** Specify a profile turning the host on and off according to an exhaustive list or a stochastic law.
235  * The profile must contain boolean values. */
236 Host* Host::set_state_profile(kernel::profile::Profile* p)
237 {
238   kernel::actor::simcall_object_access(pimpl_, [this, p] { pimpl_cpu_->set_state_profile(p); });
239   return this;
240 }
241 /** Specify a profile modeling the external load according to an exhaustive list or a stochastic law.
242  *
243  * Each event of the profile represent a peak speed change that is due to external load. The values are given as a rate
244  * of the initial value. This means that the actual value is obtained by multiplying the initial value (the peek speed
245  * at this pstate level) by the rate coming from the profile.
246  */
247 Host* Host::set_speed_profile(kernel::profile::Profile* p)
248 {
249   kernel::actor::simcall_object_access(pimpl_, [this, p] { pimpl_cpu_->set_speed_profile(p); });
250   return this;
251 }
252
253 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
254 double Host::get_pstate_speed(unsigned long pstate_index) const
255 {
256   return this->pimpl_cpu_->get_pstate_peak_speed(pstate_index);
257 }
258
259 double Host::get_speed() const
260 {
261   return this->pimpl_cpu_->get_speed(1.0);
262 }
263 double Host::get_load() const
264 {
265   return this->pimpl_cpu_->get_load();
266 }
267 double Host::get_available_speed() const
268 {
269   return this->pimpl_cpu_->get_speed_ratio();
270 }
271
272 Host* Host::set_sharing_policy(SharingPolicy policy, const s4u::NonLinearResourceCb& cb)
273 {
274   kernel::actor::simcall_object_access(pimpl_, [this, policy, &cb] { pimpl_cpu_->set_sharing_policy(policy, cb); });
275   return this;
276 }
277
278 Host::SharingPolicy Host::get_sharing_policy() const
279 {
280   return this->pimpl_cpu_->get_sharing_policy();
281 }
282
283 int Host::get_core_count() const
284 {
285   return this->pimpl_cpu_->get_core_count();
286 }
287
288 Host* Host::set_core_count(int core_count)
289 {
290   kernel::actor::simcall_object_access(pimpl_, [this, core_count] { this->pimpl_cpu_->set_core_count(core_count); });
291   return this;
292 }
293
294 Host* Host::set_pstate_speed(const std::vector<double>& speed_per_state)
295 {
296   kernel::actor::simcall_object_access(pimpl_,
297                                        [this, &speed_per_state] { pimpl_cpu_->set_pstate_speed(speed_per_state); });
298   return this;
299 }
300
301 std::vector<double> Host::convert_pstate_speed_vector(const std::vector<std::string>& speed_per_state)
302 {
303   std::vector<double> speed_list;
304   speed_list.reserve(speed_per_state.size());
305   for (const auto& speed_str : speed_per_state) {
306     try {
307       double speed = xbt_parse_get_speed("", 0, speed_str, "");
308       speed_list.push_back(speed);
309     } catch (const simgrid::ParseError&) {
310       throw std::invalid_argument("Invalid speed value: " + speed_str);
311     }
312   }
313   return speed_list;
314 }
315
316 Host* Host::set_pstate_speed(const std::vector<std::string>& speed_per_state)
317 {
318   set_pstate_speed(Host::convert_pstate_speed_vector(speed_per_state));
319   return this;
320 }
321
322 /** @brief Set the pstate at which the host should run */
323 Host* Host::set_pstate(unsigned long pstate_index)
324 {
325   kernel::actor::simcall_object_access(pimpl_, [this, pstate_index] { this->pimpl_cpu_->set_pstate(pstate_index); });
326   return this;
327 }
328
329 /** @brief Retrieve the pstate at which the host is currently running */
330 unsigned long Host::get_pstate() const
331 {
332   return this->pimpl_cpu_->get_pstate();
333 }
334
335 Host* Host::set_factor_cb(const std::function<CpuFactorCb>& cb)
336 {
337   kernel::actor::simcall_object_access(pimpl_, [this, &cb] { pimpl_cpu_->set_factor_cb(cb); });
338   return this;
339 }
340
341 Host* Host::set_coordinates(const std::string& coords)
342 {
343   if (not coords.empty())
344     kernel::actor::simcall_object_access(pimpl_, [this, coords] { this->pimpl_netpoint_->set_coordinates(coords); });
345   return this;
346 }
347 std::vector<Disk*> Host::get_disks() const
348 {
349   return this->pimpl_->get_disks();
350 }
351
352 Disk* Host::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
353 {
354   return kernel::actor::simcall_answered([this, &name, read_bandwidth, write_bandwidth] {
355     auto* disk = pimpl_->create_disk(name, read_bandwidth, write_bandwidth);
356     pimpl_->add_disk(disk);
357     return disk;
358   });
359 }
360
361 Disk* Host::create_disk(const std::string& name, const std::string& read_bandwidth, const std::string& write_bandwidth)
362 {
363   double d_read;
364   try {
365     d_read = xbt_parse_get_bandwidth("", 0, read_bandwidth, "");
366   } catch (const simgrid::ParseError&) {
367     throw std::invalid_argument("Impossible to create disk: " + name + ". Invalid read bandwidth: " + read_bandwidth);
368   }
369   double d_write;
370   try {
371     d_write = xbt_parse_get_bandwidth("", 0, write_bandwidth, "");
372   } catch (const simgrid::ParseError&) {
373     throw std::invalid_argument("Impossible to create disk: " + name + ". Invalid write bandwidth: " + write_bandwidth);
374   }
375   return create_disk(name, d_read, d_write);
376 }
377
378 void Host::add_disk(const Disk* disk)
379 {
380   kernel::actor::simcall_answered([this, disk] { this->pimpl_->add_disk(disk); });
381 }
382
383 void Host::remove_disk(const std::string& disk_name)
384 {
385   kernel::actor::simcall_answered([this, disk_name] { this->pimpl_->remove_disk(disk_name); });
386 }
387
388 VirtualMachine* Host::create_vm(const std::string& name, int core_amount)
389 {
390   return kernel::actor::simcall_answered(
391       [this, &name, core_amount] { return this->pimpl_->create_vm(name, core_amount); });
392 }
393
394 VirtualMachine* Host::create_vm(const std::string& name, int core_amount, size_t ramsize)
395 {
396   return kernel::actor::simcall_answered(
397       [this, &name, core_amount, ramsize] { return this->pimpl_->create_vm(name, core_amount, ramsize); });
398 }
399
400 VirtualMachine* Host::vm_by_name_or_null(const std::string& name)
401 {
402   simgrid::kernel::resource::VirtualMachineImpl* vm = this->pimpl_->get_vm_by_name_or_null(name);
403   return vm ? vm->get_iface() : nullptr;
404 }
405
406 ExecPtr Host::exec_init(double flops) const
407 {
408   return this_actor::exec_init(flops);
409 }
410
411 ExecPtr Host::exec_async(double flops) const
412 {
413   return this_actor::exec_async(flops);
414 }
415
416 void Host::execute(double flops) const
417 {
418   execute(flops, 1.0 /* priority */);
419 }
420
421 void Host::execute(double flops, double priority) const
422 {
423   Exec::init()->set_flops_amount(flops)->set_host(const_cast<Host*>(this))->set_priority(1 / priority)->wait();
424 }
425
426 Host* Host::seal()
427 {
428   kernel::actor::simcall_answered([this]() { this->pimpl_->seal(); });
429   simgrid::s4u::Host::on_creation(*this); // notify the signal
430   return this;
431 }
432
433 } // namespace s4u
434 } // namespace simgrid
435
436 /* **************************** Public C interface *************************** */
437 size_t sg_host_count()
438 {
439   return simgrid::s4u::Engine::get_instance()->get_host_count();
440 }
441 sg_host_t* sg_host_list()
442 {
443   const simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
444   size_t host_count             = e->get_host_count();
445
446   xbt_assert(host_count > 0, "There is no host!");
447   std::vector<simgrid::s4u::Host*> hosts = e->get_all_hosts();
448
449   auto* res = xbt_new(sg_host_t, hosts.size());
450   std::copy(begin(hosts), end(hosts), res);
451
452   return res;
453 }
454
455 const char* sg_host_get_name(const_sg_host_t host)
456 {
457   return host->get_cname();
458 }
459
460 void* sg_host_extension_get(const_sg_host_t host, size_t ext)
461 {
462   return host->extension(ext);
463 }
464
465 size_t sg_host_extension_create(void (*deleter)(void*))
466 {
467   return simgrid::s4u::Host::extension_create(deleter);
468 }
469
470 sg_host_t sg_host_by_name(const char* name)
471 {
472   return simgrid::s4u::Host::by_name_or_null(name);
473 }
474
475 /** @brief Retrieve a VM running on a given host from its name, or return NULL if no VM matches*/
476 sg_vm_t sg_vm_by_name(sg_host_t host, const char* name)
477 {
478   return host->vm_by_name_or_null(name);
479 }
480
481 // ========= Layering madness ==============*
482
483 // ========== User data Layer ==========
484 void* sg_host_get_data(const_sg_host_t host)
485 {
486   return host->get_data<void>();
487 }
488 void sg_host_set_data(sg_host_t host, void* userdata)
489 {
490   host->set_data(userdata);
491 }
492
493 // ========= Disk related functions ============
494 void sg_host_get_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
495 {
496   std::vector<sg_disk_t> list = host->get_disks();
497   *disk_count                 = list.size();
498   *disks                      = xbt_new(sg_disk_t, list.size());
499   std::copy(begin(list), end(list), *disks);
500 }
501
502 // =========== user-level functions ===============
503 // ================================================
504 /** @brief Returns the total speed of a host */
505 double sg_host_get_speed(const_sg_host_t host)
506 {
507   return host->get_speed();
508 }
509
510 /** @brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_host_energy.
511  *
512  * @param  host host to test
513  * @param pstate_index pstate to test
514  * @return Returns the processor speed associated with pstate_index
515  */
516 double sg_host_get_pstate_speed(const_sg_host_t host, unsigned long pstate_index)
517 {
518   return host->get_pstate_speed(pstate_index);
519 }
520
521 /** @ingroup m_host_management
522  * @brief Return the number of cores.
523  *
524  * @param host a host
525  * @return the number of cores
526  */
527 int sg_host_core_count(const_sg_host_t host)
528 {
529   return host->get_core_count();
530 }
531
532 double sg_host_get_available_speed(const_sg_host_t host)
533 {
534   return host->get_available_speed();
535 }
536
537 /** @brief Returns the number of power states for a host.
538  *
539  *  See also @ref plugin_host_energy.
540  */
541 unsigned long sg_host_get_nb_pstates(const_sg_host_t host)
542 {
543   return host->get_pstate_count();
544 }
545
546 /** @brief Gets the pstate at which that host currently runs.
547  *
548  *  See also @ref plugin_host_energy.
549  */
550 unsigned long sg_host_get_pstate(const_sg_host_t host)
551 {
552   return host->get_pstate();
553 }
554 /** @brief Sets the pstate at which that host should run.
555  *
556  *  See also @ref plugin_host_energy.
557  */
558 void sg_host_set_pstate(sg_host_t host, unsigned long pstate)
559 {
560   host->set_pstate(pstate);
561 }
562
563 /** @ingroup m_host_management
564  *
565  * @brief Start the host if it is off
566  *
567  * See also #sg_host_is_on() to test the current state of the host and @ref plugin_host_energy
568  * for more info on DVFS.
569  */
570 void sg_host_turn_on(sg_host_t host)
571 {
572   host->turn_on();
573 }
574
575 /** @ingroup m_host_management
576  *
577  * @brief Stop the host if it is on
578  *
579  * See also #sg_host_is_on() to test the current state of the host and @ref plugin_host_energy
580  * for more info on DVFS.
581  */
582 void sg_host_turn_off(sg_host_t host)
583 {
584   host->turn_off();
585 }
586
587 /** @ingroup m_host_management
588  * @brief Determine if a host is up and running.
589  *
590  * See also #sg_host_turn_on() and #sg_host_turn_off() to switch the host ON and OFF and @ref plugin_host_energy for
591  * more info on DVFS.
592  *
593  * @param host host to test
594  * @return Returns true if the host is up and running, and false if it's currently down
595  */
596 int sg_host_is_on(const_sg_host_t host)
597 {
598   return host->is_on();
599 }
600
601 /** @brief Get the properties of a host */
602 xbt_dict_t sg_host_get_properties(const_sg_host_t host)
603 {
604   const std::unordered_map<std::string, std::string>* props = host->get_properties();
605   xbt_dict_t as_dict                                        = xbt_dict_new_homogeneous(xbt_free_f);
606
607   if (props == nullptr)
608     return nullptr;
609   for (auto const& [key, value] : *props) {
610     xbt_dict_set(as_dict, key.c_str(), xbt_strdup(value.c_str()));
611   }
612   return as_dict;
613 }
614
615 /** @ingroup m_host_management
616  * @brief Returns the value of a given host property
617  *
618  * @param host a host
619  * @param name a property name
620  * @return value of a property (or nullptr if property not set)
621  */
622 const char* sg_host_get_property_value(const_sg_host_t host, const char* name)
623 {
624   return host->get_property(name);
625 }
626
627 void sg_host_set_property_value(sg_host_t host, const char* name, const char* value)
628 {
629   host->set_property(name, value);
630 }
631
632 /**
633  * @brief Find a route between two hosts
634  *
635  * @param from where from
636  * @param to where to
637  * @param links [OUT] where to store the list of links (must exist, cannot be nullptr).
638  */
639 void sg_host_get_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links)
640 {
641   std::vector<simgrid::s4u::Link*> vlinks;
642   from->route_to(to, vlinks, nullptr);
643   for (auto const& link : vlinks)
644     xbt_dynar_push(links, &link);
645 }
646 /**
647  * @brief Find the latency of the route between two hosts
648  *
649  * @param from where from
650  * @param to where to
651  */
652 double sg_host_get_route_latency(const_sg_host_t from, const_sg_host_t to)
653 {
654   std::vector<simgrid::s4u::Link*> vlinks;
655   double res = 0;
656   from->route_to(to, vlinks, &res);
657   return res;
658 }
659 /**
660  * @brief Find the bandwidth of the route between two hosts
661  *
662  * @param from where from
663  * @param to where to
664  */
665 double sg_host_get_route_bandwidth(const_sg_host_t from, const_sg_host_t to)
666 {
667   double min_bandwidth = -1.0;
668
669   std::vector<simgrid::s4u::Link*> vlinks;
670   from->route_to(to, vlinks, nullptr);
671   for (auto const& link : vlinks) {
672     double bandwidth = link->get_bandwidth();
673     if (bandwidth < min_bandwidth || min_bandwidth < 0.0)
674       min_bandwidth = bandwidth;
675   }
676   return min_bandwidth;
677 }
678
679 void sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount)
680 {
681   simgrid::s4u::Comm::sendto(from, to, byte_amount);
682 }
683
684 /** @brief Return the list of actors attached to a host.
685  *
686  * @param host a host
687  * @param whereto a dynar in which we should push actors living on that host
688  */
689 void sg_host_get_actor_list(const_sg_host_t host, xbt_dynar_t whereto)
690 {
691   auto const actors = host->get_all_actors();
692   for (auto const& actor : actors)
693     xbt_dynar_push(whereto, &actor);
694 }
695
696 sg_host_t sg_host_self()
697 {
698   return simgrid::s4u::Actor::is_maestro() ? nullptr : simgrid::kernel::actor::ActorImpl::self()->get_host();
699 }
700
701 /* needs to be public and without simcall for exceptions and logging events */
702 const char* sg_host_self_get_name()
703 {
704   const char* res = "";
705   if (not simgrid::s4u::Actor::is_maestro()) {
706     const simgrid::s4u::Host* host = simgrid::kernel::actor::ActorImpl::self()->get_host();
707     if (host != nullptr)
708       res = host->get_cname();
709   }
710   return res;
711 }
712
713 double sg_host_get_load(const_sg_host_t host)
714 {
715   return host->get_load();
716 }