Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
useless global variable, hindering MC equality
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 21 Apr 2016 15:33:21 +0000 (17:33 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 21 Apr 2016 16:11:48 +0000 (18:11 +0200)
examples/msg/dht-chord/dht-chord.c
examples/msg/dht-chord/dht-chord.tesh
examples/msg/dht-kademlia/dht-kademlia.c
examples/msg/dht-kademlia/dht-kademlia.tesh
examples/msg/dht-pastry/dht-pastry.c
examples/msg/dht-pastry/dht-pastry.tesh
src/mc/ModelChecker.cpp
src/simix/smx_network.cpp

index 976fa83..420d502 100644 (file)
@@ -34,8 +34,6 @@ static int periodic_lookup_delay = 10;
 
 static const double sleep_delay = 4.9999;
 
 
 static const double sleep_delay = 4.9999;
 
-extern long int smx_total_comms;
-
 /* Finger element. */
 typedef struct s_finger {
   int id;
 /* Finger element. */
 typedef struct s_finger {
   int id;
@@ -1043,7 +1041,6 @@ int main(int argc, char *argv[])
   MSG_launch_application(application_file);
 
   msg_error_t res = MSG_main();
   MSG_launch_application(application_file);
 
   msg_error_t res = MSG_main();
-  XBT_CRITICAL("Messages created: %ld", smx_total_comms);
   XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   chord_exit();
   XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   chord_exit();
index 166a9a2..d3a4cb8 100644 (file)
@@ -184,7 +184,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/dht-chord$EXEEXT -nb_bits=6 ${srcdir:=.}/cluster.x
 > [115.044536] (2:node@node-1.acme.org)   40  | 366680
 > [115.044536] (2:node@node-1.acme.org)   56  | 366680
 > [115.044536] (2:node@node-1.acme.org) Predecessor: 1319738
 > [115.044536] (2:node@node-1.acme.org)   40  | 366680
 > [115.044536] (2:node@node-1.acme.org)   56  | 366680
 > [115.044536] (2:node@node-1.acme.org) Predecessor: 1319738
-> [1151.814423] (0:maestro@) Messages created: 2452
 > [1151.814423] (0:maestro@) Simulated time: 1151.81
 > [130.161328] (3:node@node-2.acme.org) My finger table:
 > [130.161328] (3:node@node-2.acme.org) Start | Succ
 > [1151.814423] (0:maestro@) Simulated time: 1151.81
 > [130.161328] (3:node@node-2.acme.org) My finger table:
 > [130.161328] (3:node@node-2.acme.org) Start | Succ
@@ -3223,5 +3222,4 @@ $ $SG_TEST_EXENV ${bindir:=.}/dht-chord$EXEEXT ${srcdir:=.}/routing_none.xml ${s
 > [ 990.991700] (8:node@node-7.acme.org)  14199064  | 10004760
 > [ 990.991700] (8:node@node-7.acme.org)  1616152  | 10004760
 > [ 990.991700] (8:node@node-7.acme.org) Predecessor: 6518808
 > [ 990.991700] (8:node@node-7.acme.org)  14199064  | 10004760
 > [ 990.991700] (8:node@node-7.acme.org)  1616152  | 10004760
 > [ 990.991700] (8:node@node-7.acme.org) Predecessor: 6518808
-> [1201.991400] (0:maestro@) Messages created: 2208
 > [1201.991400] (0:maestro@) Simulated time: 1201.99
 > [1201.991400] (0:maestro@) Simulated time: 1201.99
index 1177377..186c620 100644 (file)
@@ -15,8 +15,6 @@
   */
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_kademlia, "Messages specific for this msg example");
 
   */
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_kademlia, "Messages specific for this msg example");
 
-extern long unsigned int smx_total_comms;
-
 /* Main loop for the process */
 static void main_loop(node_t node, double deadline)
 {
 /* Main loop for the process */
 static void main_loop(node_t node, double deadline)
 {
@@ -441,7 +439,6 @@ int main(int argc, char *argv[])
 
   msg_error_t res = MSG_main();
 
 
   msg_error_t res = MSG_main();
 
-  XBT_CRITICAL("Messages created: %ld", smx_total_comms);
   XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   return res != MSG_OK;
   XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   return res != MSG_OK;
index 22ecfa1..61f4fd8 100644 (file)
@@ -30,5 +30,4 @@ $ $SG_TEST_EXENV ${bindir:=.}/dht-kademlia ${srcdir:=.}/cluster.xml ${srcdir:=.}
 > [780.000000] (10:node@node-9.acme.org) 5/5 FIND_NODE have succeeded
 > [780.000000] (12:node@node-11.acme.org) 6/6 FIND_NODE have succeeded
 > [780.000000] ( 4:node@node-3.acme.org) 5/5 FIND_NODE have succeeded
 > [780.000000] (10:node@node-9.acme.org) 5/5 FIND_NODE have succeeded
 > [780.000000] (12:node@node-11.acme.org) 6/6 FIND_NODE have succeeded
 > [780.000000] ( 4:node@node-3.acme.org) 5/5 FIND_NODE have succeeded
-> [780.000000] ( 0:maestro@) Messages created: 1179
 > [780.000000] ( 0:maestro@) Simulated time: 780
 > [780.000000] ( 0:maestro@) Simulated time: 780
index df37565..d0afa78 100644 (file)
@@ -29,8 +29,6 @@ static int nb_bits = 16;
 static int timeout = 50;
 static int max_simulation_time = 1000;
 
 static int timeout = 50;
 static int max_simulation_time = 1000;
 
-extern long int smx_total_comms;
-
 typedef struct s_node {
   int id;                                 //128bits generated random(2^128 -1)
   int known_id;
 typedef struct s_node {
   int id;                                 //128bits generated random(2^128 -1)
   int known_id;
@@ -571,7 +569,6 @@ int main(int argc, char *argv[])
   MSG_launch_application(options[1]);
 
   msg_error_t res = MSG_main();
   MSG_launch_application(options[1]);
 
   msg_error_t res = MSG_main();
-  XBT_CRITICAL("Messages created: %ld", smx_total_comms);
   XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   return res != MSG_OK;
   XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   return res != MSG_OK;
index ee9138d..8a52ccb 100644 (file)
@@ -2,5 +2,4 @@
 
 p Testing the Chord implementation with MSG
 
 
 p Testing the Chord implementation with MSG
 
-! output sort 19
 $ $SG_TEST_EXENV ${bindir:=.}/dht-pastry$EXEEXT -nb_bits=6 ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/dht-pastry_d.xml --cfg=network/crosstraffic:0 --log=msg_pastry.thres:verbose "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 $ $SG_TEST_EXENV ${bindir:=.}/dht-pastry$EXEEXT -nb_bits=6 ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/dht-pastry_d.xml --cfg=network/crosstraffic:0 --log=msg_pastry.thres:verbose "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
index 956f5f1..ea14a19 100644 (file)
@@ -149,9 +149,6 @@ void ModelChecker::setup_ignore()
 
   /* Static variable used for tracing */
   process.ignore_global_variable("counter");
 
   /* Static variable used for tracing */
   process.ignore_global_variable("counter");
-
-  /* SIMIX */
-  process.ignore_global_variable("smx_total_comms");
 }
 
 void ModelChecker::shutdown()
 }
 
 void ModelChecker::shutdown()
index dd209ff..977fe43 100644 (file)
@@ -14,7 +14,6 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization");
 
 static xbt_dict_t mailboxes = NULL;
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization");
 
 static xbt_dict_t mailboxes = NULL;
-XBT_EXPORT_NO_IMPORT(unsigned long int) smx_total_comms = 0;
 
 static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
 static void SIMIX_comm_copy_data(smx_synchro_t comm);
 
 static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
 static void SIMIX_comm_copy_data(smx_synchro_t comm);
@@ -250,7 +249,6 @@ smx_synchro_t SIMIX_comm_new(e_smx_comm_type_t type)
   synchro->category = NULL;
 
   XBT_DEBUG("Create communicate synchro %p", synchro);
   synchro->category = NULL;
 
   XBT_DEBUG("Create communicate synchro %p", synchro);
-  ++smx_total_comms;
 
   return synchro;
 }
 
   return synchro;
 }
@@ -361,7 +359,6 @@ smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sr
     XBT_DEBUG("Receive already pushed");
 
     SIMIX_comm_destroy(this_synchro);
     XBT_DEBUG("Receive already pushed");
 
     SIMIX_comm_destroy(this_synchro);
-    --smx_total_comms; // this creation was a pure waste
 
     other_synchro->state = SIMIX_READY;
     other_synchro->comm.type = SIMIX_COMM_READY;
 
     other_synchro->state = SIMIX_READY;
     other_synchro->comm.type = SIMIX_COMM_READY;
@@ -450,7 +447,6 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void
       }
       other_synchro->comm.refcount--;
       SIMIX_comm_destroy(this_synchro);
       }
       other_synchro->comm.refcount--;
       SIMIX_comm_destroy(this_synchro);
-      --smx_total_comms; // this creation was a pure waste
     }
   } else {
     /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
     }
   } else {
     /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */
@@ -467,7 +463,6 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void
       SIMIX_mbox_push(mbox, this_synchro);
     } else {
       SIMIX_comm_destroy(this_synchro);
       SIMIX_mbox_push(mbox, this_synchro);
     } else {
       SIMIX_comm_destroy(this_synchro);
-      --smx_total_comms; // this creation was a pure waste
       other_synchro->state = SIMIX_READY;
       other_synchro->comm.type = SIMIX_COMM_READY;
       //other_synchro->comm.refcount--;
       other_synchro->state = SIMIX_READY;
       other_synchro->comm.type = SIMIX_COMM_READY;
       //other_synchro->comm.refcount--;
@@ -536,7 +531,6 @@ smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int
   if(other_synchro)other_synchro->comm.refcount--;
 
   SIMIX_comm_destroy(this_synchro);
   if(other_synchro)other_synchro->comm.refcount--;
 
   SIMIX_comm_destroy(this_synchro);
-  --smx_total_comms;
   return other_synchro;
 }
 
   return other_synchro;
 }