Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add missing call in host (available in MSG, used in lua)
authordegomme <augustin.degomme@unibas.ch>
Fri, 22 Jan 2016 14:40:15 +0000 (15:40 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Fri, 22 Jan 2016 14:40:15 +0000 (15:40 +0100)
include/simgrid/host.h
src/simgrid/host.cpp

index 282fa76..5929ec6 100644 (file)
@@ -61,7 +61,8 @@ XBT_PUBLIC(int) sg_host_get_nb_pstates(sg_host_t host);
 XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
 XBT_PUBLIC(void) sg_host_set_pstate(sg_host_t host,int pstate);
 XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host);
-
+XBT_PUBLIC(const char *) sg_host_get_property_value(sg_host_t host,
+                                                     const char *name);
 SG_END_DECL()
 
 #endif /* SIMGRID_HOST_H_ */
index 8e52780..ab6de0e 100644 (file)
@@ -159,3 +159,16 @@ xbt_dict_t sg_host_get_properties(sg_host_t host) {
   return host->properties();
 }
 
+
+/** \ingroup m_host_management
+ * \brief Returns the value of a given host property
+ *
+ * \param host a host
+ * \param name a property name
+ * \return value of a property (or NULL if property not set)
+*/
+const char *sg_host_get_property_value(sg_host_t host, const char *name)
+{
+  return (const char*) xbt_dict_get_or_null(sg_host_get_properties(host), name);
+}
+