Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
factor Cmake and clean files
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 14 Mar 2016 12:51:18 +0000 (13:51 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 14 Mar 2016 12:59:13 +0000 (13:59 +0100)
30 files changed:
.gitignore
examples/msg/mc/CMakeLists.txt
examples/msg/mc/bugged1.c
examples/msg/mc/bugged1_liveness.c
examples/msg/mc/bugged1_liveness.h
examples/msg/mc/bugged2.c
examples/msg/mc/bugged2_liveness.c
examples/msg/mc/bugged2_liveness.h
examples/msg/mc/bugged3.c
examples/msg/mc/centralized_mutex.c
examples/msg/mc/centralized_mutex.tesh [moved from examples/msg/mc/centralized.tesh with 98% similarity]
examples/msg/mc/deploy_bugged1.xml
examples/msg/mc/deploy_bugged1_liveness.xml
examples/msg/mc/deploy_bugged1_liveness_visited.xml
examples/msg/mc/deploy_bugged2.xml
examples/msg/mc/deploy_bugged2_liveness.xml
examples/msg/mc/deploy_bugged3.xml
examples/msg/mc/deploy_centralized_mutex.xml [moved from examples/msg/mc/deploy_mutex.xml with 100% similarity]
examples/msg/mc/deploy_electric_fence.xml
examples/msg/mc/electric_fence.c
teshsuite/mc/CMakeLists.txt
teshsuite/mc/dwarf/CMakeLists.txt
teshsuite/mc/dwarf_expression/CMakeLists.txt
teshsuite/mc/mutex_handling.c
teshsuite/mc/mutex_handling.xml
teshsuite/mc/replay/CMakeLists.txt
teshsuite/mc/replay/random_bug.c
teshsuite/simdag/platforms/CMakeLists.txt
teshsuite/simdag/platforms/evaluate_get_route_time.c [moved from teshsuite/simdag/platforms/Evaluate_get_route_time.c with 100% similarity]
teshsuite/simdag/platforms/evaluate_parse_time.c [moved from teshsuite/simdag/platforms/Evaluate_parse_time.c with 100% similarity]

index ce66e3d..450c460 100644 (file)
@@ -166,7 +166,7 @@ examples/msg/mc/bugged2
 examples/msg/mc/bugged2_liveness
 examples/msg/mc/bugged2_stateful
 examples/msg/mc/bugged3
-examples/msg/mc/centralized
+examples/msg/mc/centralized_mutex
 examples/msg/mc/centralized_liveness
 examples/msg/mc/electric_fence
 examples/msg/mc/test/snapshot_comparison1
index c3b7268..d6e288b 100644 (file)
@@ -1,19 +1,13 @@
-if(HAVE_MC)
-  add_executable       (centralized      centralized_mutex.c)
-  target_link_libraries(centralized      simgrid)
-  add_executable       (bugged1          bugged1.c)
-  target_link_libraries(bugged1          simgrid)
-  add_executable       (bugged2          bugged2.c)
-  target_link_libraries(bugged2          simgrid)
-  add_executable       (bugged3          bugged3.c)
-  target_link_libraries(bugged3          simgrid)
-  add_executable       (electric_fence   electric_fence.c)
-  target_link_libraries(electric_fence   simgrid)
-  add_executable       (bugged1_liveness bugged1_liveness.c)
-  target_link_libraries(bugged1_liveness simgrid)
-  add_executable       (bugged2_liveness bugged2_liveness.c)
-  target_link_libraries(bugged2_liveness simgrid)
+foreach (x bugged1 bugged2 bugged3 centralized_mutex electric_fence bugged1_liveness bugged2_liveness)
+  if(HAVE_MC)
+    add_executable       (${x} ${x}.c)
+    target_link_libraries(${x} simgrid)
+  endif()
+  set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.c)
+  set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/deploy_${x}.xml)
+endforeach()
 
+if(HAVE_MC)
   if(HAVE_C_STACK_CLEANER)
     add_executable       (bugged1_liveness_cleaner_on  bugged1_liveness.c)
     target_link_libraries(bugged1_liveness_cleaner_on  simgrid)
@@ -25,43 +19,17 @@ if(HAVE_MC)
   endif()
 endif()
 
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged2.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_sparse.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited_sparse.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/centralized.tesh
-  PARENT_SCOPE)
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness_visited.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged2_liveness.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged2.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged3.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_electric_fence.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_mutex.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml
-  PARENT_SCOPE)
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_liveness.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/electric_fence.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/centralized_mutex.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_liveness.h
-  PARENT_SCOPE)
-set(bin_files
-  ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/promela_bugged1_liveness
-  ${CMAKE_CURRENT_SOURCE_DIR}/promela_bugged2_liveness
-  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_stack_cleaner
-  PARENT_SCOPE)
+set(tesh_files   ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/bugged1.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged2.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_sparse.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited_sparse.tesh
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/centralized_mutex.tesh                PARENT_SCOPE)
+set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness_visited.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml                          PARENT_SCOPE)
+set(examples_src ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.h
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_liveness.h                    PARENT_SCOPE)
+set(bin_files    ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/promela_bugged1_liveness
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/promela_bugged2_liveness
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_stack_cleaner        PARENT_SCOPE)
index aa397f8..e709335 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-int server(int argc, char *argv[])
+static int server(int argc, char *argv[])
 {
   msg_task_t task = NULL;
   int count = 0;
@@ -37,12 +34,9 @@ int server(int argc, char *argv[])
   return 0;
 }
 
-int client(int argc, char *argv[])
+static int client(int argc, char *argv[])
 {
-
-  msg_task_t task =
-      MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ ,
-                      NULL /*arbitrary data */ );
+  msg_task_t task =  MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ , NULL /*arbitrary data */ );
 
   MSG_task_send(task, "mymailbox");
 
@@ -52,19 +46,14 @@ int client(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-
   MSG_init(&argc, argv);
 
   MSG_create_environment("platform.xml");
 
   MSG_function_register("server", server);
-
   MSG_function_register("client", client);
-
   MSG_launch_application("deploy_bugged1.xml");
 
   MSG_main();
-
   return 0;
-
 }
index ac0fb35..0494521 100644 (file)
@@ -37,7 +37,7 @@ static void garbage_stack(void) {
 }
 #endif
 
-int coordinator(int argc, char *argv[])
+static int coordinator(int argc, char *argv[])
 {
   int CS_used = 0;   
   msg_task_t task = NULL, answer = NULL; 
@@ -61,7 +61,7 @@ int coordinator(int argc, char *argv[])
           answer = NULL;
         }
       }
-    } else {      
+    } else {
       if (!xbt_dynar_is_empty(requests)) {
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
         xbt_dynar_shift(requests, &req);
@@ -81,11 +81,10 @@ int coordinator(int argc, char *argv[])
     kind = NULL;
     req = NULL;
   }
   return 0;
 }
 
-int client(int argc, char *argv[])
+static int client(int argc, char *argv[])
 {
   int my_pid = MSG_process_get_PID(MSG_process_self());
 
@@ -125,7 +124,7 @@ int client(int argc, char *argv[])
     release = NULL;
 
     MSG_process_sleep(my_pid);
-    
+
     if(strcmp(my_mailbox, "1") == 0){
       cs=0;
       r=0;
@@ -133,7 +132,6 @@ int client(int argc, char *argv[])
     }
     
   }
-
   return 0;
 }
 
@@ -151,19 +149,15 @@ static int raw_client(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
   MSG_init(&argc, argv);
-  char **options = &argv[1];
 
   MC_automaton_new_propositional_symbol_pointer("r", &r);
   MC_automaton_new_propositional_symbol_pointer("cs", &cs);
 
-  const char* platform_file = options[0];
-  const char* application_file = options[1];
-
-  MSG_create_environment(platform_file);
+  MSG_create_environment(argv[1]);
 
   MSG_function_register("coordinator", coordinator);
   MSG_function_register("client", raw_client);
-  MSG_launch_application(application_file);
+  MSG_launch_application(argv[2]);
 
   MSG_main();
 
index 7246422..c24c967 100644 (file)
@@ -10,7 +10,4 @@
 int predR(void);
 int predCS(void);
 
-int coordinator(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
 #endif 
index 4cda68c..9087da3 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-int server(int argc, char *argv[])
+static int server(int argc, char *argv[])
 {
   msg_task_t task1 = NULL;
   msg_task_t task2 = NULL;
@@ -52,7 +49,7 @@ int server(int argc, char *argv[])
   return 0;
 }
 
-int client(int argc, char *argv[])
+static int client(int argc, char *argv[])
 {
   msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
   msg_task_t task2 = MSG_task_create(argv[1], 0, 10000, NULL);
@@ -77,6 +74,5 @@ int main(int argc, char *argv[])
   MSG_launch_application("deploy_bugged2.xml");
 
   MSG_main();
-
   return 0;
 }
index e13dd5a..da785bb 100644 (file)
 #include "bugged2_liveness.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages");
-int cs = 0;
 
-int coordinator(int argc, char **argv);
-int client(int argc, char **argv);
+int cs = 0;
 
-int coordinator(int argc, char *argv[])
+static int coordinator(int argc, char *argv[])
 {
   int CS_used = 0;              // initially the CS is idle
-  
+
   while (1) {
     msg_task_t task = NULL;
     MSG_task_receive(&task, "coordinator");
@@ -49,56 +46,47 @@ int coordinator(int argc, char *argv[])
     MSG_task_destroy(task);
     kind = NULL;
   }
-  
+
   return 0;
 }
 
-int client(int argc, char *argv[])
+static int client(int argc, char *argv[])
 {
   int my_pid = MSG_process_get_PID(MSG_process_self());
   char *my_mailbox = xbt_strdup(argv[1]);
   const char* kind;
-  while(1){
 
+  while(1){
     XBT_INFO("Client (%s) asks the request", my_mailbox);
-    MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox),
-                  "coordinator");
+    MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox), "coordinator");
 
     msg_task_t answer = NULL;
     MSG_task_receive(&answer, my_mailbox);
 
     kind = MSG_task_get_name(answer);
-    
-    if (!strcmp(kind, "grant")) {
 
+    if (!strcmp(kind, "grant")) {
       XBT_INFO("Client (%s) got the answer (grant). Sleep a bit and release it", my_mailbox);
-
       if(!strcmp(my_mailbox, "1"))
         cs = 1;
-      
     }else{
-      
       XBT_INFO("Client (%s) got the answer (not grant). Try again", my_mailbox);
-      
     }
 
     MSG_task_destroy(answer);
     kind = NULL;
-    
+
     MSG_process_sleep(my_pid);
   }
-
   return 0;
 }
 
 int main(int argc, char *argv[])
 {
-  
   MSG_init(&argc, argv);
 
   MC_automaton_new_propositional_symbol_pointer("cs", &cs);
-  
+
   MSG_create_environment("../msg_platform.xml");
   MSG_function_register("coordinator", coordinator);
   MSG_function_register("client", client);
index ec62e31..d9ad041 100644 (file)
@@ -9,7 +9,4 @@
 
 int predCS(void);
 
-int coordinator(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
 #endif 
index c89b32d..3d8d736 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "this example");
 
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
 
-int server(int argc, char *argv[])
+static int server(int argc, char *argv[])
 {
   msg_task_t task1,task2;
 
@@ -39,7 +37,7 @@ int server(int argc, char *argv[])
   return 0;
 }
 
-int client(int argc, char *argv[])
+static int client(int argc, char *argv[])
 {
   msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
 
@@ -65,6 +63,5 @@ int main(int argc, char *argv[])
   MSG_launch_application("deploy_bugged3.xml");
 
   MSG_main();
-
   return 0;
 }
index bc6e7ee..64a4461 100644 (file)
 #define CS_PER_PROCESS 2
 XBT_LOG_NEW_DEFAULT_CATEGORY(centralized, "my log messages");
 
-int coordinator(int argc, char **argv);
-int client(int argc, char **argv);
-
-int coordinator(int argc, char *argv[])
+static int coordinator(int argc, char *argv[])
 {
   xbt_dynar_t requests = xbt_dynar_new(sizeof(char *), NULL);   // dynamic vector storing requests (which are char*)
   int CS_used = 0;              // initially the CS is idle
@@ -41,8 +38,7 @@ int coordinator(int argc, char *argv[])
       }
     } else {                    // that's a release. Check if someone was waiting for the lock
       if (!xbt_dynar_is_empty(requests)) {
-        XBT_INFO("CS release. Grant to queued requests (queue size: %lu)",
-              xbt_dynar_length(requests));
+        XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
         char *req;
         xbt_dynar_shift(requests, &req);
         MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
@@ -59,7 +55,7 @@ int coordinator(int argc, char *argv[])
   return 0;
 }
 
-int client(int argc, char *argv[])
+static int client(int argc, char *argv[])
 {
   int my_pid = MSG_process_get_PID(MSG_process_self());
   // use my pid as name of mailbox to contact me
@@ -68,16 +64,14 @@ int client(int argc, char *argv[])
   int i;
   for (i = 0; i < CS_PER_PROCESS; i++) {
     XBT_INFO("Ask the request");
-    MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox),
-                  "coordinator");
+    MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox), "coordinator");
     // wait the answer
     msg_task_t grant = NULL;
     MSG_task_receive(&grant, my_mailbox);
     MSG_task_destroy(grant);
     XBT_INFO("got the answer. Sleep a bit and release it");
     MSG_process_sleep(1);
-    MSG_task_send(MSG_task_create("release", 0, 1000, NULL),
-                  "coordinator");
+    MSG_task_send(MSG_task_create("release", 0, 1000, NULL), "coordinator");
     MSG_process_sleep(my_pid);
   }
   XBT_INFO("Got all the CS I wanted, quit now");
@@ -90,7 +84,7 @@ int main(int argc, char *argv[])
   MSG_create_environment("../msg_platform.xml");
   MSG_function_register("coordinator", coordinator);
   MSG_function_register("client", client);
-  MSG_launch_application("deploy_mutex.xml");
+  MSG_launch_application("deploy_centralized_mutex.xml");
   MSG_main();
   return 0;
 }
similarity index 98%
rename from examples/msg/mc/centralized.tesh
rename to examples/msg/mc/centralized_mutex.tesh
index 1e14eb3..791d064 100644 (file)
@@ -1,6 +1,6 @@
 #! ./tesh
 
-$ ${bindir:=.}/centralized
+$ ${bindir:=.}/centralized_mutex
 > [Fafard:client:(2) 0.000000] [centralized/INFO] Ask the request
 > [Boivin:client:(3) 0.000000] [centralized/INFO] Ask the request
 > [TeX:client:(4) 0.000000] [centralized/INFO] Ask the request
index 1e99f4d..9d971c0 100644 (file)
@@ -1,16 +1,8 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
-  <process host="HostA" function="server">
-    <argument value="0"/>
-  </process>
-  <process host="HostB" function="client">
-    <argument value="1"/>
-  </process>  
-  <process host="HostC" function="client">
-    <argument value="2"/>
-  </process>
-  <process host="HostD" function="client">
-    <argument value="3"/>
-  </process>
+  <process host="HostA" function="server">    <argument value="0"/>  </process>
+  <process host="HostB" function="client">    <argument value="1"/>  </process>  
+  <process host="HostC" function="client">    <argument value="2"/>  </process>
+  <process host="HostD" function="client">    <argument value="3"/>  </process>
 </platform>
index ad87a48..3a36156 100644 (file)
@@ -2,12 +2,6 @@
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
   <process host="Tremblay" function="coordinator" />
-
-  <process host="Boivin" function="client" >
-    <argument value="1"/>
-  </process>
-
-  <process host="Fafard" function="client" >
-    <argument value="2"/>
-  </process>
+  <process host="Boivin" function="client" >         <argument value="1"/>  </process>
+  <process host="Fafard" function="client" >         <argument value="2"/>  </process>
 </platform>
index f8e8d9b..5f2bffa 100644 (file)
@@ -2,12 +2,6 @@
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
   <process host="Tremblay" function="coordinator" />
-
-   <process host="Boivin" function="client" >
-    <argument value="2"/>
-  </process>
-
-  <process host="Fafard" function="client" >
-    <argument value="1"/>
-  </process>
+   <process host="Boivin" function="client" >          <argument value="2"/>  </process>
+   <process host="Fafard" function="client" >          <argument value="1"/>  </process>
 </platform>
index 56a0e7e..6063b5d 100644 (file)
@@ -1,13 +1,7 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
-  <process host="HostA" function="server">
-    <argument value="0"/>
-  </process>
-  <process host="HostB" function="client">
-    <argument value="1"/>
-  </process>  
-  <process host="HostC" function="client">
-    <argument value="2"/>
-  </process>
+  <process host="HostA" function="server">    <argument value="0"/>  </process>
+  <process host="HostB" function="client">    <argument value="1"/>  </process>  
+  <process host="HostC" function="client">    <argument value="2"/>  </process>
 </platform>
index 547229c..0388e19 100644 (file)
@@ -2,12 +2,6 @@
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
   <process host="Tremblay" function="coordinator" />
-
-  <process host="Fafard" function="client" >
-    <argument value="1"/>
-  </process>
-
-  <process host="Boivin" function="client" >
-    <argument value="2"/>
-  </process>
+  <process host="Fafard"   function="client" >       <argument value="1"/>  </process>
+  <process host="Boivin" function="client" >         <argument value="2"/>  </process>
 </platform>
index 56a0e7e..1f004f1 100644 (file)
@@ -1,13 +1,7 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
-  <process host="HostA" function="server">
-    <argument value="0"/>
-  </process>
-  <process host="HostB" function="client">
-    <argument value="1"/>
-  </process>  
-  <process host="HostC" function="client">
-    <argument value="2"/>
-  </process>
+  <process host="HostA" function="server">   <argument value="0"/>  </process>
+  <process host="HostB" function="client">   <argument value="1"/>  </process>  
+  <process host="HostC" function="client">   <argument value="2"/>  </process>
 </platform>
index 56a0e7e..6063b5d 100644 (file)
@@ -1,13 +1,7 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
-  <process host="HostA" function="server">
-    <argument value="0"/>
-  </process>
-  <process host="HostB" function="client">
-    <argument value="1"/>
-  </process>  
-  <process host="HostC" function="client">
-    <argument value="2"/>
-  </process>
+  <process host="HostA" function="server">    <argument value="0"/>  </process>
+  <process host="HostB" function="client">    <argument value="1"/>  </process>  
+  <process host="HostC" function="client">    <argument value="2"/>  </process>
 </platform>
index a018c1a..f260cd9 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(electric_fence, "Example to check the soundness of DPOR");
 
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
 
-int server(int argc, char *argv[])
+static int server(int argc, char *argv[])
 {
   msg_task_t task1 = NULL, task2 = NULL;
   msg_comm_t comm_received1 = NULL, comm_received2 = NULL;
@@ -36,32 +34,26 @@ int server(int argc, char *argv[])
   return 0;
 }
 
-int client(int argc, char *argv[])
+static int client(int argc, char *argv[])
 {
-
   msg_task_t task = MSG_task_create(argv[1], 0, 10000, NULL);
 
   MSG_task_send(task, "mymailbox");
-  
+
   XBT_INFO("Sent!");
   return 0;
 }
 
 int main(int argc, char *argv[])
 {
-
   MSG_init(&argc, argv);
 
   MSG_create_environment("platform.xml");
 
   MSG_function_register("server", server);
-
   MSG_function_register("client", client);
-
   MSG_launch_application("deploy_electric_fence.xml");
 
   MSG_main();
-
   return 0;
-
 }
index 6a38e8b..880d9ce 100644 (file)
@@ -5,16 +5,7 @@ add_executable       (without_mutex_handling mutex_handling.c)
 target_link_libraries(without_mutex_handling simgrid)
 set_target_properties(without_mutex_handling PROPERTIES COMPILE_FLAGS -DDISABLE_THE_MUTEX=1)
 
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/with_mutex_handling.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/without_mutex_handling.tesh
-  PARENT_SCOPE)
-set(testsuite_src
-  ${testsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/mutex_handling.c
-  PARENT_SCOPE)
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/mutex_handling.xml
-  PARENT_SCOPE)
+set(tesh_files     ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/with_mutex_handling.tesh
+                                     ${CMAKE_CURRENT_SOURCE_DIR}/without_mutex_handling.tesh    PARENT_SCOPE)
+set(testsuite_src  ${testsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/mutex_handling.c               PARENT_SCOPE)
+set(xml_files      ${xml_files}      ${CMAKE_CURRENT_SOURCE_DIR}/mutex_handling.xml             PARENT_SCOPE)
index 904cafb..6d15d78 100644 (file)
@@ -3,11 +3,5 @@ if(HAVE_MC)
   target_link_libraries(dwarf simgrid)
 endif()
 
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.tesh
-  PARENT_SCOPE)
-set(testsuite_src
-  ${testsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.cpp
-  PARENT_SCOPE)
+set(tesh_files     ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.tesh  PARENT_SCOPE)
+set(testsuite_src  ${testsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.cpp   PARENT_SCOPE)
index e17889e..5f03c68 100644 (file)
@@ -3,11 +3,5 @@ if(HAVE_MC)
   target_link_libraries(dwarf-expression simgrid)
 endif()
 
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_expression.tesh
-  PARENT_SCOPE)
-set(testsuite_src
-  ${testsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_expression.cpp
-  PARENT_SCOPE)
+set(tesh_files     ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_expression.tesh  PARENT_SCOPE)
+set(testsuite_src  ${testsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_expression.cpp   PARENT_SCOPE)
index e07970b..e13bd2f 100644 (file)
  * and the MC does not find the counter-example.
  */
 
-#include <stdio.h>
 #include "simgrid/msg.h"
-#include "xbt/log.h"
 #include "mc/mc.h"
 #include <xbt/synchro_core.h>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
-                             "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
 #define BOX_NAME "box"
 
@@ -68,13 +65,11 @@ int main(int argc, char *argv[])
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
        "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
 
-   const char *platform_file = argv[1];
-  const char *application_file = argv[2];
-  MSG_create_environment(platform_file);
+  MSG_create_environment(argv[1]);
   MSG_function_register("receiver", receiver);
   MSG_function_register("sender", sender);
 
-  MSG_launch_application(application_file);
+  MSG_launch_application(argv[2]);
 #ifndef DISABLE_THE_MUTEX
   mutex = xbt_mutex_init();
 #endif
@@ -85,4 +80,4 @@ int main(int argc, char *argv[])
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
   return res != MSG_OK;
-}
\ No newline at end of file
+}
index 7f60f93..e656348 100644 (file)
@@ -1,15 +1,7 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
 <platform version="4">
-  <!-- For using with ping_pong, platform_sendrecv.xml -->
-  <!-- receiver my_name -->
   <process host="Disney" function="receiver"/>
-
-  <!-- sender my_name receiver_name other_sender_name -->
-  <process host="Jill" function="sender">
-    <argument value="X"/>
-  </process>
-  <process host="UNIX" function="sender">
-    <argument value="Y"/>
-  </process>
+  <process host="Jill" function="sender">   <argument value="X"/>  </process>
+  <process host="UNIX" function="sender">   <argument value="Y"/>  </process>
 </platform>
index 9bfb7ad..edec841 100644 (file)
@@ -1,16 +1,7 @@
 add_executable       (random_bug random_bug.c)
 target_link_libraries(random_bug simgrid)
 
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/random_bug.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/random_bug_replay.tesh
-  PARENT_SCOPE)
-set(testsuite_src
-  ${testsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/random_bug.c
-  PARENT_SCOPE)
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/random_bug.xml
-  PARENT_SCOPE)
+set(tesh_files     ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/random_bug.tesh
+                                     ${CMAKE_CURRENT_SOURCE_DIR}/random_bug_replay.tesh  PARENT_SCOPE)
+set(testsuite_src  ${testsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/random_bug.c            PARENT_SCOPE)
+set(xml_files      ${xml_files}      ${CMAKE_CURRENT_SOURCE_DIR}/random_bug.xml          PARENT_SCOPE)
index fac0e25..f0967f9 100644 (file)
@@ -4,16 +4,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <stdio.h>
-
-#include <xbt/log.h>
 #include <simgrid/msg.h>
 #include <simgrid/modelchecker.h>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(random_bug, "Application");
 
-/** An (fake) application with a bug occuring for some random values
- */
+/** An (fake) application with a bug occuring for some random values */
 static int app(int argc, char *argv[])
 {
   int x = MC_random(0, 5);
index 3a95a07..ba75fa2 100644 (file)
@@ -1,75 +1,58 @@
-add_executable       (basic_parsing_test      basic_parsing_test.c)
-target_link_libraries(basic_parsing_test      simgrid)
+foreach(x basic_parsing_test basic_link_test evaluate_parse_time evaluate_get_route_time)
+  add_executable       (${x} ${x}.c)
+  target_link_libraries(${x} simgrid)
+
+  set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.c)
+endforeach()
+
 add_executable       (is_router_test          is_router_test.cpp)
 target_link_libraries(is_router_test          simgrid)
 add_executable       (flatifier               flatifier.cpp)
 target_link_libraries(flatifier               simgrid)
-add_executable       (basic_link_test         basic_link_test.c)
-target_link_libraries(basic_link_test         simgrid)
-add_executable       (evaluate_parse_time     Evaluate_parse_time.c)
-target_link_libraries(evaluate_parse_time     simgrid)
-add_executable       (evaluate_get_route_time Evaluate_get_route_time.c)
-target_link_libraries(evaluate_get_route_time simgrid)
 
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test_failing.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test_sym_full.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test_bypass.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/basic_link_test.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/flatifier.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/get_full_link.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bogus_two_hosts_asymetric.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bogus_missing_gateway.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bogus_disk_attachment.tesh
-  PARENT_SCOPE)
-set(xml_files
-  ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/four_hosts_Dijkstra_ns3.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/four_hosts_floyd_ns3.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/four_hosts_floyd.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_multi_hop.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/host_attributes.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/link_attributes.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_file.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_multicore.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_fullduplex.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_router_id.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/platform_include.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/properties.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/test_of_is_router.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/three_hosts_non_symmetric_route.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/two_clusters_one_name.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/two_clusters_router_id.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/two_clusters.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/bogus_missing_src_gateway.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/bogus_missing_dst_gateway.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/bogus_two_hosts_asymetric.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_one_link_fullduplex.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_one_link_symmetrical.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_one_link.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/clusterA.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/clusterB.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/Dijkstra.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/bogus_disk_attachment.xml
-  PARENT_SCOPE)
-set(teshsuite_src
-  ${teshsuite_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/basic_link_test.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/Evaluate_get_route_time.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/Evaluate_parse_time.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/flatifier.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/is_router_test.cpp
-  PARENT_SCOPE)
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/carol.fail
-  ${CMAKE_CURRENT_SOURCE_DIR}/bob.trace
-  ${CMAKE_CURRENT_SOURCE_DIR}/erin.avail
-  ${CMAKE_CURRENT_SOURCE_DIR}/link.bw
-  ${CMAKE_CURRENT_SOURCE_DIR}/link.fail
-  ${CMAKE_CURRENT_SOURCE_DIR}/link.lat
-  PARENT_SCOPE)
+set(tesh_files    ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test_failing.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test_sym_full.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/basic_parsing_test_bypass.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/basic_link_test.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/flatifier.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/get_full_link.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bogus_two_hosts_asymetric.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bogus_missing_gateway.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bogus_disk_attachment.tesh                 PARENT_SCOPE)
+set(xml_files     ${xml_files}      ${CMAKE_CURRENT_SOURCE_DIR}/four_hosts_Dijkstra_ns3.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/four_hosts_floyd_ns3.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/four_hosts_floyd.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_multi_hop.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/host_attributes.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/link_attributes.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_file.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_multicore.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_fullduplex.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster_router_id.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/one_cluster.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/platform_include.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/properties.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/test_of_is_router.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/three_hosts_non_symmetric_route.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/two_clusters_one_name.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/two_clusters_router_id.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/two_clusters.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bogus_missing_src_gateway.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bogus_missing_dst_gateway.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bogus_two_hosts_asymetric.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_one_link_fullduplex.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_one_link_symmetrical.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/two_hosts_one_link.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/clusterA.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/clusterB.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/Dijkstra.xml
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bogus_disk_attachment.xml                  PARENT_SCOPE)
+set(teshsuite_src ${teshsuite_src}  ${CMAKE_CURRENT_SOURCE_DIR}/flatifier.cpp
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/is_router_test.cpp                         PARENT_SCOPE)
+set(txt_files     ${txt_files}      ${CMAKE_CURRENT_SOURCE_DIR}/carol.fail
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/bob.trace
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/erin.avail
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/link.bw
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/link.fail
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/link.lat                                   PARENT_SCOPE)