Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use -DBL_MAX for MIN_KEY_VALUE.
[simgrid.git] / src / msg / msg_host.c
index 92f2cf100971e4c2d4f3670ea1d2c6a60336a9e9..dfa729e1cfe90497fef5cf196568648058256960 100644 (file)
@@ -8,6 +8,7 @@
 #include "msg/msg_mailbox.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
+#include "simgrid/simix.h"
 
 /** @addtogroup m_host_management
  *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Hosts" --> \endhtmlonly
@@ -46,7 +47,6 @@ m_host_t __MSG_host_create(smx_host_t workstation)
   }
 #endif
 
-  simcall_host_set_data(workstation, host);
   xbt_lib_set(host_lib,name,MSG_HOST_LEVEL,host);
 
   return host;
@@ -61,16 +61,9 @@ m_host_t __MSG_host_create(smx_host_t workstation)
  */
 m_host_t MSG_get_host_by_name(const char *name)
 {
-  smx_host_t simix_h = NULL;
-  simix_h = simcall_host_get_by_name(name);
-
-  if (simix_h == NULL)
-    return NULL;
-
-  return (m_host_t) simcall_host_get_data(simix_h);
+  return (m_host_t) xbt_lib_get_or_null(host_lib,name,MSG_HOST_LEVEL);
 }
 
-
 /** \ingroup m_host_management
  *
  * \brief Set the user data of a #m_host_t.
@@ -94,7 +87,6 @@ MSG_error_t MSG_host_set_data(m_host_t host, void *data)
  */
 void *MSG_host_get_data(m_host_t host)
 {
-
   return SIMIX_host_get_data(host->smx_host);
 }