/* 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. */
/* 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. */
{
return pimpl_->get_all_actors();
}
/** @brief Returns how many actors (daemonized or not) have been launched on this host */
{
return pimpl_->get_all_actors();
}
/** @brief Returns how many actors (daemonized or not) have been launched on this host */
* walk through the routing components tree and find a route between hosts
* by calling each "get_route" function in each routing component.
*/
* walk through the routing components tree and find a route between hosts
* by calling each "get_route" function in each routing component.
*/
{
std::vector<kernel::resource::LinkImpl*> linkImpls;
this->route_to(dest, linkImpls, latency);
{
std::vector<kernel::resource::LinkImpl*> linkImpls;
this->route_to(dest, linkImpls, latency);
-void Host::route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency)
+void Host::route_to(const Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency) const
{
kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint_, dest->get_netpoint(), links, latency);
if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
{
kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint_, dest->get_netpoint(), links, latency);
if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
for (auto const& elm : host->get_mounted_storages()) {
const char* mount_name = elm.first.c_str();
xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
for (auto const& elm : host->get_mounted_storages()) {
const char* mount_name = elm.first.c_str();
{
xbt_dynar_t storage_dynar = xbt_dynar_new(sizeof(const char*), nullptr);
std::vector<const char*> storage_vector = host->get_attached_storages();
{
xbt_dynar_t storage_dynar = xbt_dynar_new(sizeof(const char*), nullptr);
std::vector<const char*> storage_vector = host->get_attached_storages();
// =========== user-level functions ===============
// ================================================
/** @brief Returns the total speed of a host */
// =========== user-level functions ===============
// ================================================
/** @brief Returns the total speed of a host */
* @param pstate_index pstate to test
* @return Returns the processor speed associated with pstate_index
*/
* @param pstate_index pstate to test
* @return Returns the processor speed associated with pstate_index
*/
* @param host host to test
* @return Returns true if the host is up and running, and false if it's currently down
*/
* @param host host to test
* @return Returns true if the host is up and running, and false if it's currently down
*/
{
xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
const std::unordered_map<std::string, std::string>* props = host->get_properties();
{
xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
const std::unordered_map<std::string, std::string>* props = host->get_properties();
{
std::vector<simgrid::s4u::Link*> vlinks;
from->route_to(to, vlinks, nullptr);
{
std::vector<simgrid::s4u::Link*> vlinks;
from->route_to(to, vlinks, nullptr);
{
XBT_INFO("Displaying host %s", host->get_cname());
XBT_INFO(" - speed: %.0f", host->get_speed());
{
XBT_INFO("Displaying host %s", host->get_cname());
XBT_INFO(" - speed: %.0f", host->get_speed());
/* needs to be public and without simcall for exceptions and logging events */
const char* sg_host_self_get_name()
{
/* needs to be public and without simcall for exceptions and logging events */
const char* sg_host_self_get_name()
{
- return SIMIX_is_maestro() ? "" : simgrid::kernel::actor::ActorImpl::self()->get_host()->get_cname();
+ const char* res = "";
+ if (not SIMIX_is_maestro()) {
+ const simgrid::s4u::Host* host = simgrid::kernel::actor::ActorImpl::self()->get_host();
+ if (host != nullptr)
+ res = host->get_cname();
+ }
+ return res;