Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Frederic's patch to get the sharing policy in SimDAG.
[simgrid.git] / src / simdag / sd_link.c
index 4712b06..4b48633 100644 (file)
@@ -120,11 +120,11 @@ double SD_link_get_current_bandwidth(SD_link_t link) {
 /**
  * \brief Returns the value of a given link property
  *
- * \param workstation a workstation
+ * \param link the inspected link
  * \param name a property name
  * \return value of a property (or NULL if property not set)
  */
-const char* SD_link_get_property_value(SD_link_t link, char* name)
+const char* SD_link_get_property_value(SD_link_t link, const char* name)
 {
   return xbt_dict_get_or_null(SD_link_get_properties(link), name);
 }
@@ -156,6 +156,21 @@ double SD_link_get_current_latency(SD_link_t link) {
   return surf_workstation_model->extension_public->get_link_latency(link->surf_link);
 }
 
+/**
+ * \brief Returns the sharing policy of this workstation.
+ *
+ * \param link a link
+ * \return the sharing policyfor the flows going through this link:
+ * SD_LINK_SHARED or SD_LINK_FATPIPE
+ *
+ */
+e_SD_link_sharing_policy_t SD_link_get_sharing_policy (SD_link_t link) {
+  SD_CHECK_INIT_DONE();
+  xbt_assert0(link != NULL, "Invalid parameter");
+  return link->sharing_policy;
+}
+
 /* Destroys a link.
  */
 void __SD_link_destroy(void *link) {