X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2cf13759ba1696d88f5ff86afee5324f30ccdbfc..273c78e00c26cc4cab1460da956e6ccc86b99328:/src/s4u/s4u_Host.cpp diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 16f419a05b..68698e80c1 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -7,6 +7,7 @@ #include "simgrid/s4u/Actor.hpp" #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Exec.hpp" +#include "src/simix/smx_private.hpp" #include "src/surf/HostImpl.hpp" #include @@ -639,6 +640,16 @@ sg_host_t sg_host_self() return (process == nullptr) ? nullptr : process->get_host(); } +/* needs to be public and without simcall for exceptions and logging events */ +const char* sg_host_self_get_name() +{ + sg_host_t host = sg_host_self(); + if (host == nullptr || SIMIX_process_self() == simix_global->maestro_process) + return ""; + + return host->get_cname(); +} + double sg_host_load(sg_host_t host) { return host->get_load();