X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c4ee1fee88b1c3c22c9848f0293dc14b13122fdc..ebfe21b41d7a8b25b72d2441f9bee879d974809f:/src/simix/smx_host.c diff --git a/src/simix/smx_host.c b/src/simix/smx_host.c index b655087917..62e11134a5 100644 --- a/src/simix/smx_host.c +++ b/src/simix/smx_host.c @@ -77,6 +77,25 @@ void SIMIX_host_destroy(void *h) return; } +/** + * \brief Returns a dict of all hosts. + * + * \return List of all hosts (as a #xbt_dict_t) + */ +xbt_dict_t SIMIX_host_get_dict(void) +{ + xbt_dict_t host_dict = xbt_dict_new(); + xbt_lib_cursor_t cursor = NULL; + char *name = NULL; + void **host = NULL; + + xbt_lib_foreach(host_lib, cursor, name, host){ + if(host[SIMIX_HOST_LEVEL]) + xbt_dict_set(host_dict,name,host[SIMIX_HOST_LEVEL],NULL); + } + return host_dict; +} + smx_host_t SIMIX_host_get_by_name(const char *name) { xbt_assert0(((simix_global != NULL)