Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
* Cleanup the DTD by renaming:
[simgrid.git] / src / msg / host.c
index f8f9cdf..2b933f9 100644 (file)
@@ -41,7 +41,7 @@ m_host_t __MSG_host_create(smx_host_t workstation, void *data)
   host->simdata = simdata;
   host->data = data;
 
-  simdata->s_host = workstation;
+  simdata->smx_host = workstation;
 
   simdata->mbox = xbt_new0(xbt_fifo_t, msg_global->max_channel);
   for (i = 0; i < msg_global->max_channel; i++)
@@ -183,9 +183,35 @@ double MSG_get_host_speed(m_host_t h)
 {
   xbt_assert0((h != NULL), "Invalid parameters");
 
-  return (SIMIX_host_get_speed(h->simdata->s_host));
+  return (SIMIX_host_get_speed(h->simdata->smx_host));
 }
 
+/** \ingroup m_host_management
+ * \brief Returns the value of a certain host property
+ *
+ * \param host a host
+ * \param name a property name
+ * \return value of a property
+ */
+const char* MSG_host_get_property_value(m_host_t host, char* name)
+{
+  return xbt_dict_get_or_null(MSG_host_get_properties(host), name);
+}
+
+/** \ingroup m_host_management
+ * \brief Returns a xbt_dynar_t consisting of the list of properties assigned to this host
+ *
+ * \param host a host
+ * \return a dict containing the properties
+ */
+xbt_dict_t MSG_host_get_properties(m_host_t host)
+{
+  xbt_assert0((host != NULL), "Invalid parameters");
+
+  return (SIMIX_host_get_properties(host->simdata->smx_host));
+}
+
+
 /** \ingroup msg_gos_functions
  * \brief Determine if a host is available.
  *
@@ -194,5 +220,5 @@ double MSG_get_host_speed(m_host_t h)
 int MSG_host_is_avail(m_host_t h)
 {
   xbt_assert0((h != NULL), "Invalid parameters");
-  return (SIMIX_host_get_state(h->simdata->s_host));
+  return (SIMIX_host_get_state(h->simdata->smx_host));
 }