-/* Copyright (c) 2006-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2023. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <simgrid/forward.h>
#include <xbt/Extendable.hpp>
#include <xbt/signal.hpp>
-#include <xbt/string.hpp>
#include <map>
#include <unordered_map>
static Host* current();
/** Retrieves the name of that host as a C++ string */
- xbt::string const& get_name() const;
+ std::string const& get_name() const;
/** Retrieves the name of that host as a C string */
const char* get_cname() const;
Host* set_state_profile(kernel::profile::Profile* p);
Host* set_speed_profile(kernel::profile::Profile* p);
+ /**
+ * @brief Set the max amount of executions that can take place on this host at the same time
+ *
+ * Use -1 to set no limit.
+ */
+ Host* set_concurrency_limit(int limit);
+ int get_concurrency_limit() const;
+
/** @brief Convert the CPU's speed from string to double */
static std::vector<double> convert_pstate_speed_vector(const std::vector<std::string>& speed_per_state);
/**
* @verbatim embed:rst:inline :cpp:func:`get_pstate_speed() <simgrid::s4u::Host::get_pstate_speed>` @endverbatim
* to retrieve the computing speed you would get at another pstate)
* - If you declared an external load (with
- * @verbatim embed:rst:inline :cpp:func:`set_speed_profile() <simgrid::s4u::Host::set_speed_profile>`
- * @endverbatim ), you must multiply the result of
+ * @verbatim embed:rst:inline :cpp:func:`set_speed_profile() <simgrid::s4u::Host::set_speed_profile>` @endverbatim ),
+ * you must multiply the result of
* @verbatim embed:rst:inline :cpp:func:`get_speed() <simgrid::s4u::Host::get_speed>` @endverbatim by
- * @verbatim embed:rst:inline :cpp:func:`get_available_speed() <simgrid::s4u::Host::get_available_speed>`
- * @endverbatim to retrieve what a new computation would get.
+ * @verbatim embed:rst:inline :cpp:func:`get_available_speed() <simgrid::s4u::Host::get_available_speed>` @endverbatim
+ * to retrieve what a new computation would get.
*
* The remaining speed is then shared between the executions located on this host.
* You can retrieve the amount of tasks currently running on this host with
VirtualMachine* create_vm(const std::string& name, int core_amount);
VirtualMachine* create_vm(const std::string& name, int core_amount, size_t ramsize);
+ /** Retrieve a VM running on this host from its name, or return nullptr */
+ VirtualMachine* vm_by_name_or_null(const std::string& name);
void route_to(const Host* dest, std::vector<Link*>& links, double* latency) const;
void route_to(const Host* dest, std::vector<kernel::resource::StandardLinkImpl*>& links, double* latency) const;
+ std::pair<std::vector<Link*>, double> route_to(const Host* dest) const;
/**
* @brief Seal this host
*/
Host* seal();
-#ifndef DOXYGEN
- XBT_ATTRIB_DEPRECATED_v331("Please use Comm::sendto()") void sendto(Host* dest, double byte_amount);
- XBT_ATTRIB_DEPRECATED_v331("Please use Comm::sendto_async()") CommPtr sendto_async(Host* dest, double byte_amount);
-#endif
-
NetZone* get_englobing_zone() const;
/** Block the calling actor on an execution located on the called host
*