double (*get_link_bandwidth) (const void *link); /**< Return the current bandwidth of a network link */
double (*get_link_latency) (const void *link); /**< Return the current latency of a network link */
int (*link_shared) (const void *link);
+ xbt_dict_t (*get_properties)(const void*resource);
} s_surf_model_extension_workstation_t;
/** \brief Model datatype
} s_surf_resource_t, *surf_resource_t;
XBT_PUBLIC(const char*) surf_resource_name(const void *resource);
- XBT_PUBLIC(xbt_dict_t) surf_resource_properties(const void *resource);
XBT_PUBLIC(void) surf_resource_free(void* resource);
/**************************************/
/* Implementations of model object */
SD_CHECK_INIT_DONE();
xbt_assert0((workstation != NULL), "Invalid parameters");
- return surf_resource_properties(workstation->surf_workstation);
+ return surf_workstation_model->extension.workstation.get_properties(workstation->surf_workstation);
}
{
xbt_assert0((host != NULL), "Invalid parameters");
- return surf_resource_properties(host->simdata->host);
+ return surf_workstation_model->extension.workstation.get_properties(host->simdata->host);
}
"Host '%s' declared several times in the platform file", name);
cpu->generic_resource.model = surf_cpu_model;
cpu->generic_resource.name = name;
- current_property_set = cpu->generic_resource.properties = cpu_properties;
+ cpu->generic_resource.properties = cpu_properties;
cpu->power_scale = power_scale;
xbt_assert0(cpu->power_scale > 0, "Power has to be >0");
cpu->power_current = power_initial;
};
XBT_PUBLIC(void) routing_model_create(size_t size_of_link,void *loopback);
+
+/*
+ * Resource protected methods
+ */
+XBT_PUBLIC(xbt_dict_t) surf_resource_properties(const void *resource);
+
#endif /* _SURF_SURF_PRIVATE_H */
surf_model_exit(surf_workstation_model);
surf_workstation_model = NULL;
}
+static xbt_dict_t get_properties(const void*ws){
+ return surf_resource_properties(((workstation_CLM03_t)ws)->cpu);
+}
static void surf_workstation_model_init_internal(void)
{
surf_workstation_model->extension.workstation.get_link_latency =
get_link_latency;
surf_workstation_model->extension.workstation.link_shared = link_shared;
+ surf_workstation_model->extension.workstation.get_properties = get_properties;
}
/********************************************************************/
surf_workstation_model->extension.workstation.get_link_latency =
get_link_latency;
surf_workstation_model->extension.workstation.link_shared = link_shared;
+ surf_workstation_model->extension.workstation.get_properties = surf_resource_properties;
+
if (!ptask_maxmin_system)
ptask_maxmin_system = lmm_system_new();