-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_workstation, sd,
- "Logging specific to SimDag (workstation)");
-
-/* Creates a storage and registers it in SD.
- */
-SD_storage_t __SD_storage_create(void *surf_storage, void *data)
-{
-
- SD_storage_priv_t storage;
- const char *name;
-
- storage = xbt_new(s_SD_storage_priv_t, 1);
- storage->data = data; /* user data */
- name = surf_resource_name((surf_cpp_resource_t)surf_storage);
- storage->host = (const char*)surf_storage_get_host( (surf_resource_t )surf_storage_resource_by_name(name));
- xbt_lib_set(storage_lib,name, SD_STORAGE_LEVEL, storage);
- return xbt_lib_get_elm_or_null(storage_lib, name);
-}
-
-/* Destroys a storage.
- */
-void __SD_storage_destroy(void *storage)
-{
- SD_storage_priv_t s;
-
- s = (SD_storage_priv_t) storage;
- xbt_free(s);
-}
-
-/**
- * \brief Returns the workstation list
- *
- * Use sg_host_count() to know the array size.
- *
- * \return an array of \ref sg_host_t containing all workstations
- * \remark The workstation order in the returned array is generally different from the workstation creation/declaration order in the XML platform (we use a hash table internally).
- * \see sg_host_count()
- */
-const sg_host_t *sg_host_list(void) {
- xbt_assert(sg_host_count() > 0, "There is no workstation!");
-
- if (sd_global->host_list == NULL) /* this is the first time the function is called */
- sd_global->host_list = (sg_host_t*)xbt_dynar_to_array(sg_hosts_as_dynar());
-
- return sd_global->host_list;
-}
-
-/** @brief Displays debugging informations about a workstation */
-void sg_host_dump(sg_host_t ws)
-{
- xbt_dict_t props;
- xbt_dict_cursor_t cursor=NULL;
- char *key,*data;
-
- XBT_INFO("Displaying workstation %s", sg_host_get_name(ws));
- XBT_INFO(" - speed: %.0f", ws->speed());
- XBT_INFO(" - available speed: %.2f", sg_host_get_available_speed(ws));
- props = sg_host_get_properties(ws);
-
- if (!xbt_dict_is_empty(props)){
- XBT_INFO(" - properties:");
-
- xbt_dict_foreach(props,cursor,key,data) {
- XBT_INFO(" %s->%s",key,data);
- }
- }
-}
-
-/**
- * \brief Returns the route between two workstations