Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Make host->{on,off}() do the simcall directly
[simgrid.git] / src / msg / msg_host.cpp
index 209e296..06716bb 100644 (file)
@@ -73,7 +73,7 @@ msg_host_t __MSG_host_create(sg_host_t host) // FIXME: don't return our paramete
  */
 msg_host_t MSG_host_by_name(const char *name)
 {
-  return simgrid::Host::find_host(name);
+  return simgrid::Host::by_name_or_null(name);
 }
 
 /** \ingroup m_host_management
@@ -128,7 +128,7 @@ msg_host_t MSG_host_self(void)
  */
 void MSG_host_on(msg_host_t host)
 {
-  simcall_host_on(host);
+  host->on();
 }
 
 /** \ingroup m_host_management
@@ -139,7 +139,7 @@ void MSG_host_on(msg_host_t host)
  */
 void MSG_host_off(msg_host_t host)
 {
-  simcall_host_off(host);
+  host->off();
 }
 
 /*
@@ -210,27 +210,12 @@ xbt_dynar_t MSG_hosts_as_dynar(void) {
   return sg_hosts_as_dynar();
 }
 
-/** \ingroup m_host_management
- * \brief Return the number of MSG tasks currently running on a
- * #msg_host_t. The external load is not taken in account.
- */
-int MSG_get_host_msgload(msg_host_t h)
-{
-  xbt_assert((h != NULL), "Invalid parameters");
-  xbt_die( "Not implemented yet");
-
-  return (0);
-}
-
 /** \ingroup m_host_management
  * \brief Return the speed of the processor (in flop/s), regardless of 
     the current load on the machine.
  */
-double MSG_get_host_speed(msg_host_t h)
-{
-  xbt_assert((h != NULL), "Invalid parameters");
-
-  return sg_host_get_speed(h);
+double MSG_get_host_speed(msg_host_t host) {
+  return host->getSpeed();
 }
 
 
@@ -240,11 +225,8 @@ double MSG_get_host_speed(msg_host_t h)
  * \param host a host
  * \return the number of cores
  */
-int MSG_host_get_core_number(msg_host_t host)
-{
-  xbt_assert((host != NULL), "Invalid parameters");
-
-  return sg_host_get_core(host);
+int MSG_host_get_core_number(msg_host_t host) {
+  return host->getCoreAmount();
 }
 
 /** \ingroup m_host_management