Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename sg_platf_new_AS_{open,close} to {begin,end} since you cannot reopen them to...
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 10 Nov 2011 13:21:35 +0000 (14:21 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 10 Nov 2011 15:08:45 +0000 (16:08 +0100)
include/simgrid/platf.h
include/surf/surf_routing.h
src/bindings/lua/lua_console.c
src/include/simgrid/platf_interface.h
src/instr/instr_routing.c
src/surf/sg_platf.c
src/surf/surf_routing.c
src/surf/surfxml_parse.c
src/surf/surfxml_parseplatf.c

index b57e5b6..c449f3f 100644 (file)
@@ -87,11 +87,11 @@ typedef struct s_sg_platf_linkctn_cbarg {
 } s_sg_platf_linkctn_cbarg_t;
 
 
-XBT_PUBLIC(void) sg_platf_open(void);  // Start a new platform
-XBT_PUBLIC(void) sg_platf_close(void); // Finish the creation of the platform
+XBT_PUBLIC(void) sg_platf_begin(void);  // Start a new platform
+XBT_PUBLIC(void) sg_platf_end(void); // Finish the creation of the platform
 
-XBT_PUBLIC(void) sg_platf_new_AS_open(const char *id, const char *mode); // Begin description of new AS
-XBT_PUBLIC(void) sg_platf_new_AS_close(void);                            // That AS is fully described
+XBT_PUBLIC(void) sg_platf_new_AS_begin(const char *id, const char *mode); // Begin description of new AS
+XBT_PUBLIC(void) sg_platf_new_AS_end(void);                            // That AS is fully described
 
 XBT_PUBLIC(void) sg_platf_new_host  (sg_platf_host_cbarg_t   host);   // Add an host  to the currently described AS
 XBT_PUBLIC(void) sg_platf_new_router(sg_platf_router_cbarg_t router); // Add a router to the currently described AS
index b348c64..3c945cc 100644 (file)
@@ -31,7 +31,7 @@ extern int NS3_ASR_LEVEL;             //host node for ns3
 
 
 /* The callbacks to register for the routing to work */
-void routing_AS_open(const char *AS_id, const char *wanted_routing_type);
-void routing_AS_close(void);
+void routing_AS_begin(const char *AS_id, const char *wanted_routing_type);
+void routing_AS_end(void);
 
 #endif                          /* _SURF_SURF_H */
index c6f01ae..c96a02e 100644 (file)
@@ -15,13 +15,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_console, bindings, "Lua Bindings");
 
 int console_open(lua_State *L) {
   sg_platf_init();
-  sg_platf_open();
+  sg_platf_begin();
   surf_parse_init_callbacks();
   return 0;
 }
 
 int console_close(lua_State *L) {
-  sg_platf_close();
+  sg_platf_end();
   sg_platf_exit();
   return 0;
 }
@@ -279,12 +279,12 @@ int console_AS_open(lua_State *L) {
  mode = lua_tostring(L, -1);
  lua_pop(L, 1);
 
- sg_platf_new_AS_open(id,mode);
+ sg_platf_new_AS_begin(id,mode);
 
  return 0;
 }
 int console_AS_close(lua_State *L) {
-  sg_platf_new_AS_close();
+  sg_platf_new_AS_end();
   return 0;
 }
 
index 07da10d..050a8b7 100644 (file)
@@ -21,15 +21,15 @@ typedef void (*sg_platf_host_cb_t)(sg_platf_host_cbarg_t);
 typedef void (*sg_platf_router_cb_t)(sg_platf_router_cbarg_t);
 typedef void (*sg_platf_link_cb_t)(sg_platf_link_cbarg_t);
 typedef void (*sg_platf_peer_cb_t)(sg_platf_peer_cbarg_t);
-typedef void (*sg_platf_ASopen_cb_t)(const char*id, const char*routing);
+typedef void (*sg_platf_AS_begin_cb_t)(const char*id, const char*routing);
 
 void sg_platf_host_add_cb(sg_platf_host_cb_t);
 void sg_platf_router_add_cb(sg_platf_router_cb_t);
 void sg_platf_link_add_cb(sg_platf_link_cb_t);
 void sg_platf_peer_add_cb(sg_platf_peer_cb_t fct);
 void sg_platf_postparse_add_cb(void_f_void_t fct);
-void sg_platf_ASopen_add_cb(sg_platf_ASopen_cb_t fct);
-void sg_platf_ASclose_add_cb(void_f_void_t fct);
+void sg_platf_AS_begin_add_cb(sg_platf_AS_begin_cb_t fct);
+void sg_platf_AS_end_add_cb(void_f_void_t fct);
 
 
 
index b346c19..df7e05b 100644 (file)
@@ -288,8 +288,8 @@ void instr_routing_define_callbacks ()
   if (!TRACE_is_enabled()) return;
   //always need the call backs to ASes (we need only the root AS),
   //to create the rootContainer and the rootType properly
-  sg_platf_ASopen_add_cb(instr_routing_parse_start_AS);
-  sg_platf_ASclose_add_cb(instr_routing_parse_end_AS);
+  sg_platf_AS_begin_add_cb(instr_routing_parse_start_AS);
+  sg_platf_AS_end_add_cb(instr_routing_parse_end_AS);
   if (!TRACE_needs_platform()) return;
   sg_platf_link_add_cb(instr_routing_parse_start_link);
   sg_platf_host_add_cb(instr_routing_parse_start_host);
index 382dd2e..1f76562 100644 (file)
@@ -15,8 +15,8 @@ xbt_dynar_t sg_platf_host_cb_list = NULL;   // of sg_platf_host_cb_t
 xbt_dynar_t sg_platf_link_cb_list = NULL;   // of sg_platf_link_cb_t
 xbt_dynar_t sg_platf_router_cb_list = NULL; // of sg_platf_router_cb_t
 xbt_dynar_t sg_platf_peer_cb_list = NULL; // of sg_platf_peer_cb_t
-xbt_dynar_t sg_platf_ASopen_cb_list = NULL; //of sg_platf_ASopen_cb_t
-xbt_dynar_t sg_platf_ASclose_cb_list = NULL; //of void_f_void_t
+xbt_dynar_t sg_platf_AS_begin_cb_list = NULL; //of sg_platf_AS_begin_cb_t
+xbt_dynar_t sg_platf_AS_end_cb_list = NULL; //of void_f_void_t
 xbt_dynar_t sg_platf_postparse_cb_list = NULL; // of void_f_void_t
 
 /** Module management function: creates all internal data structures */
@@ -26,8 +26,8 @@ void sg_platf_init(void) {
   sg_platf_link_cb_list = xbt_dynar_new(sizeof(sg_platf_host_cb_t), NULL);
   sg_platf_peer_cb_list = xbt_dynar_new(sizeof(sg_platf_peer_cb_t), NULL);
   sg_platf_postparse_cb_list = xbt_dynar_new(sizeof(sg_platf_link_cb_t),NULL);
-  sg_platf_ASopen_cb_list = xbt_dynar_new(sizeof(sg_platf_ASopen_cb_t),NULL);
-  sg_platf_ASclose_cb_list = xbt_dynar_new(sizeof(void_f_void_t),NULL);
+  sg_platf_AS_begin_cb_list = xbt_dynar_new(sizeof(sg_platf_AS_begin_cb_t),NULL);
+  sg_platf_AS_end_cb_list = xbt_dynar_new(sizeof(void_f_void_t),NULL);
 }
 /** Module management function: frees all internal data structures */
 void sg_platf_exit(void) {
@@ -36,8 +36,8 @@ void sg_platf_exit(void) {
   xbt_dynar_free(&sg_platf_link_cb_list);
   xbt_dynar_free(&sg_platf_postparse_cb_list);
   xbt_dynar_free(&sg_platf_peer_cb_list);
-  xbt_dynar_free(&sg_platf_ASopen_cb_list);
-  xbt_dynar_free(&sg_platf_ASclose_cb_list);
+  xbt_dynar_free(&sg_platf_AS_begin_cb_list);
+  xbt_dynar_free(&sg_platf_AS_end_cb_list);
 }
 
 void sg_platf_new_host(sg_platf_host_cbarg_t h){
@@ -69,9 +69,9 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer){
   }
 }
 
-void sg_platf_open() { /* Do nothing: just for symmetry of user code */ }
+void sg_platf_begin() { /* Do nothing: just for symmetry of user code */ }
 
-void sg_platf_close() {
+void sg_platf_end() {
   unsigned int iterator;
   void_f_void_t fun;
   xbt_dynar_foreach(sg_platf_postparse_cb_list, iterator, fun) {
@@ -79,18 +79,18 @@ void sg_platf_close() {
   }
 }
 
-void sg_platf_new_AS_open(const char *id, const char *routing) {
+void sg_platf_new_AS_begin(const char *id, const char *routing) {
   unsigned int iterator;
-  sg_platf_ASopen_cb_t fun;
-  xbt_dynar_foreach(sg_platf_ASopen_cb_list, iterator, fun) {
+  sg_platf_AS_begin_cb_t fun;
+  xbt_dynar_foreach(sg_platf_AS_begin_cb_list, iterator, fun) {
     (*fun) (id,routing);
   }
 }
 
-void sg_platf_new_AS_close() {
+void sg_platf_new_AS_end() {
   unsigned int iterator;
   void_f_void_t fun;
-  xbt_dynar_foreach(sg_platf_ASclose_cb_list, iterator, fun) {
+  xbt_dynar_foreach(sg_platf_AS_end_cb_list, iterator, fun) {
     (*fun) ();
   }
 }
@@ -111,10 +111,10 @@ void sg_platf_peer_add_cb(sg_platf_peer_cb_t fct) {
 void sg_platf_postparse_add_cb(void_f_void_t fct) {
   xbt_dynar_push(sg_platf_postparse_cb_list, &fct);
 }
-void sg_platf_ASopen_add_cb(sg_platf_ASopen_cb_t fct) {
-  xbt_dynar_push(sg_platf_ASopen_cb_list, &fct);
+void sg_platf_AS_begin_add_cb(sg_platf_AS_begin_cb_t fct) {
+  xbt_dynar_push(sg_platf_AS_begin_cb_list, &fct);
 }
-void sg_platf_ASclose_add_cb(void_f_void_t fct) {
-  xbt_dynar_push(sg_platf_ASclose_cb_list, &fct);
+void sg_platf_AS_end_add_cb(void_f_void_t fct) {
+  xbt_dynar_push(sg_platf_AS_end_cb_list, &fct);
 }
 
index 0ac0e57..d1a77e1 100644 (file)
@@ -292,7 +292,7 @@ static void routing_parse_E_bypassRoute(void)
  * @param AS_id name of this autonomous system. Must be unique in the platform
  * @param wanted_routing_type one of Full, Floyd, Dijkstra or similar. Full list in the variable routing_models, in src/surf/surf_routing.c
  */
-void routing_AS_open(const char *AS_id, const char *wanted_routing_type)
+void routing_AS_begin(const char *AS_id, const char *wanted_routing_type)
 {
   routing_component_t new_routing;
   model_type_t model = NULL;
@@ -367,7 +367,7 @@ void routing_AS_open(const char *AS_id, const char *wanted_routing_type)
  * even if you add stuff to a closed AS
  *
  */
-void routing_AS_close()
+void routing_AS_end()
 {
 
   if (current_routing == NULL) {
@@ -901,7 +901,7 @@ static void routing_parse_cluster(void)
   xbt_dynar_t radical_ends;
 
   XBT_DEBUG("<AS id=\"%s\"\trouting=\"Cluster\">", struct_cluster->id);
-  sg_platf_new_AS_open(struct_cluster->id, "Cluster");
+  sg_platf_new_AS_begin(struct_cluster->id, "Cluster");
 
   //Make all hosts
   radical_elements = xbt_str_split(struct_cluster->radical, ",");
@@ -1085,7 +1085,7 @@ static void routing_parse_cluster(void)
     xbt_dict_free(&patterns);
 
   XBT_DEBUG("</AS>");
-  sg_platf_new_AS_close();
+  sg_platf_new_AS_end();
   XBT_DEBUG(" ");
 }
 
@@ -1133,7 +1133,7 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
   surfxml_bufferstack_push(1);
 
   XBT_DEBUG("<AS id=\"%s\"\trouting=\"Full\">", peer->id);
-  sg_platf_new_AS_open(peer->id, "Full");
+  sg_platf_new_AS_begin(peer->id, "Full");
 
   XBT_DEBUG(" ");
   host_id = HOST_PEER(peer->id);
@@ -1219,7 +1219,7 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
   SURFXML_END_TAG(route);
 
   XBT_DEBUG("</AS>");
-  sg_platf_new_AS_close();
+  sg_platf_new_AS_end();
   XBT_DEBUG(" ");
 
   //xbt_dynar_free(&tab_elements_num);
index 46faca1..10c9ff0 100644 (file)
@@ -254,10 +254,10 @@ void STag_surfxml_platform(void) {
       "This program is installed automatically with SimGrid, or "
       "available in the tools/ directory of the source archive.");
 
-  sg_platf_open();
+  sg_platf_begin();
 }
 void ETag_surfxml_platform(void){
-  sg_platf_close();
+  sg_platf_end();
 }
 
 void STag_surfxml_host(void){
@@ -411,10 +411,10 @@ void STag_surfxml_trace_connect(void){
        surfxml_call_cb_functions(STag_surfxml_trace_connect_cb_list);
 }
 void STag_surfxml_AS(void){
-  sg_platf_new_AS_open(A_surfxml_AS_id,A_surfxml_AS_routing);
+  sg_platf_new_AS_begin(A_surfxml_AS_id,A_surfxml_AS_routing);
 }
 void ETag_surfxml_AS(void){
-  sg_platf_new_AS_close();
+  sg_platf_new_AS_end();
 }
 void STag_surfxml_ASroute(void){
        surfxml_call_cb_functions(STag_surfxml_ASroute_cb_list);
index 9f2e6de..4fa418f 100644 (file)
@@ -156,8 +156,8 @@ static void init_data(void)
              &parse_Stag_trace_connect);
 
   /* we care about the ASes while parsing the platf. Incredible, isnt it? */
-  sg_platf_ASclose_add_cb(routing_AS_close);
-  sg_platf_ASopen_add_cb(routing_AS_open);
+  sg_platf_AS_end_add_cb(routing_AS_end);
+  sg_platf_AS_begin_add_cb(routing_AS_begin);
 }
 
 static void free_data(void)