Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
this tentative of storage layer in SD was a bad idea.
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 28 Jan 2016 08:23:18 +0000 (09:23 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 28 Jan 2016 08:23:18 +0000 (09:23 +0100)
SimDag is on top of SURF, the existing functions might be enough.
Exposing storage in the Simdag world still has to be defined properly

include/surf/surf_routing.h
src/simdag/sd_global.cpp
src/simdag/sd_workstation.cpp
src/simdag/simdag_private.h
src/surf/surf_routing.cpp

index bbc3fec..67434ae 100644 (file)
@@ -14,7 +14,6 @@ SG_BEGIN_DECL()
 
 XBT_PUBLIC_DATA(xbt_dict_t) host_list;
 XBT_PUBLIC_DATA(int) SIMIX_STORAGE_LEVEL; //Simix storage level
-XBT_PUBLIC_DATA(int) SD_STORAGE_LEVEL;    //Simdag storage level
 XBT_PUBLIC_DATA(int) COORD_HOST_LEVEL;    //Coordinates level
 
 XBT_PUBLIC_DATA(xbt_lib_t) as_router_lib;
index 3f6851e..697cc13 100644 (file)
@@ -72,9 +72,6 @@ void SD_init(int *argc, char **argv)
   jedule_sd_init();
 #endif
 
-  XBT_DEBUG("ADD SD LEVELS");
-  SD_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,__SD_storage_destroy);
-
   if (_sg_cfg_exit_asap) {
     SD_exit();
     exit(0);
@@ -161,18 +158,8 @@ void SD_application_reinit(void)
  */
 void SD_create_environment(const char *platform_file)
 {
-  xbt_lib_cursor_t cursor = NULL;
-  char *name = NULL;
-  void **surf_storage = NULL;
-
   parse_platform_file(platform_file);
 
-  /* now let's create the SD wrappers for storage elements */
-  xbt_lib_foreach(storage_lib, cursor, name, surf_storage) {
-    if(surf_storage[SURF_STORAGE_LEVEL])
-      __SD_storage_create(surf_storage[SURF_STORAGE_LEVEL], NULL);
-  }
-
   XBT_DEBUG("Workstation number: %zu, link number: %d",
          sg_host_count(), sg_link_count());
 #ifdef HAVE_JEDULE
index 8334329..8f9cef4 100644 (file)
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
 
-/* 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 route between two workstations
  *
  * Use SD_route_get_size() to know the array size.
@@ -128,15 +102,3 @@ double SD_route_get_bandwidth(sg_host_t src, sg_host_t dst)
 
   return min_bandwidth;
 }
-
-
-/**
- * \brief Returns the host name the storage is attached to
- *
- * This functions checks whether a storage is a valid pointer or not and return its name.
- */
-const char *SD_storage_get_host(msg_storage_t storage) {
-  xbt_assert((storage != NULL), "Invalid parameters");
-  SD_storage_priv_t priv = SD_storage_priv(storage);
-  return priv->host;
-}
index 7b81a5f..4a1bdff 100644 (file)
@@ -35,17 +35,6 @@ typedef struct SD_global {
 
 extern XBT_PRIVATE SD_global_t sd_global;
 
-/* Storage */
-typedef s_xbt_dictelm_t s_SD_storage_t;
-typedef struct SD_storage {
-  void *data;                   /* user data */
-  const char *host;
-} s_SD_storage_priv_t, *SD_storage_priv_t;
-
-static inline SD_storage_priv_t SD_storage_priv(SD_storage_t storage){
-  return (SD_storage_priv_t)xbt_lib_get_level(storage, SD_STORAGE_LEVEL);
-}
-
 /* Task */
 typedef struct SD_task {
   e_SD_task_state_t state;
@@ -107,10 +96,6 @@ static XBT_INLINE int __SD_task_is_scheduled_or_runnable(SD_task_t task)
   return task->state == SD_SCHEDULED || task->state == SD_RUNNABLE;
 }
 
-/********** Storage **********/
-XBT_PRIVATE SD_storage_t __SD_storage_create(void *surf_storage, void *data);
-XBT_PRIVATE void __SD_storage_destroy(void *storage);
-
 SG_END_DECL()
 
 #endif
index f5cb8aa..8ff7606 100644 (file)
@@ -41,7 +41,6 @@ int MSG_FILE_LEVEL;             //Msg file level
 
 int SIMIX_STORAGE_LEVEL;        //Simix storage level
 int MSG_STORAGE_LEVEL;          //Msg storage level
-int SD_STORAGE_LEVEL;           //Simdag storage level
 
 xbt_lib_t as_router_lib;
 int ROUTING_ASR_LEVEL;          //Routing level