Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill the numerical SURF_HOST_LEVEL
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 27 Dec 2015 20:35:49 +0000 (21:35 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 27 Dec 2015 20:35:53 +0000 (21:35 +0100)
Use the typesafe interface instead

include/surf/surf_routing.h
src/include/surf/surf.h
src/surf/host_interface.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_routing.cpp

index 5b713ba..bbc3fec 100644 (file)
@@ -13,7 +13,6 @@
 SG_BEGIN_DECL()
 
 XBT_PUBLIC_DATA(xbt_dict_t) host_list;
-XBT_PUBLIC_DATA(int) SURF_HOST_LEVEL;     //Surf workstation level
 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
index 784d1aa..09f0db0 100644 (file)
@@ -198,10 +198,8 @@ typedef enum {
 
 XBT_PUBLIC_DATA(routing_platf_t) routing_platf;
 
-static inline surf_host_t surf_host_resource_priv(sg_host_t host)
-{
-  return (surf_host_t) sg_host_extension_get(host, SURF_HOST_LEVEL);
-}
+XBT_PUBLIC(surf_host_t) surf_host_resource_priv(sg_host_t host);
+
 static inline void *surf_storage_resource_priv(const void *storage){
   return (void*)xbt_lib_get_level((xbt_dictelm_t)storage, SURF_STORAGE_LEVEL);
 }
index 1a67830..6a67a72 100644 (file)
@@ -92,7 +92,6 @@ void Host::classInit()
     EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Host>([](void *h) {
        static_cast<simgrid::surf::Host*>(h)->destroy();
     });
-    SURF_HOST_LEVEL = EXTENSION_ID.id(); // FIXME: KILLME
   }
 }
 
index f9d25d9..b4a2a6c 100644 (file)
@@ -533,3 +533,7 @@ double surf_network_action_get_latency_limited(surf_action_t action) {
 surf_file_t surf_storage_action_get_file(surf_action_t action){
   return static_cast<simgrid::surf::StorageAction*>(action)->p_file;
 }
+
+surf_host_t surf_host_resource_priv(sg_host_t host) {
+  return host->extension(simgrid::surf::Host::EXTENSION_ID);
+}
index 8b2a02b..719d130 100644 (file)
@@ -35,7 +35,6 @@ simgrid::surf::signal<void(simgrid::surf::As*)> asCreatedCallbacks;
  */
 xbt_dict_t host_list;
 
-int SURF_HOST_LEVEL;            //Surf host level
 int COORD_HOST_LEVEL=0;         //Coordinates level
 
 int MSG_FILE_LEVEL;             //Msg file level