Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Split xml files to avoid memory leaks in the parser.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 6 Mar 2014 11:56:54 +0000 (12:56 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 6 Mar 2014 11:57:40 +0000 (12:57 +0100)
teshsuite/msg/CMakeLists.txt
teshsuite/msg/host_on_off.c
teshsuite/msg/host_on_off.tesh
teshsuite/msg/host_on_off_d.xml [new file with mode: 0644]
teshsuite/msg/host_on_off_p.xml [moved from teshsuite/msg/host_on_off.xml with 61% similarity]
teshsuite/msg/task_destroy_cancel.c
teshsuite/msg/task_destroy_cancel.tesh
teshsuite/msg/task_destroy_cancel_d.xml [new file with mode: 0644]
teshsuite/msg/task_destroy_cancel_p.xml [moved from teshsuite/msg/task_destroy_cancel.xml with 61% similarity]

index 174c262..1656f25 100644 (file)
@@ -32,8 +32,10 @@ set(xml_files
   ${CMAKE_CURRENT_SOURCE_DIR}/get_sender_p.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/pid_d.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/pid_p.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_d.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_p.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_d.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_p.xml
   PARENT_SCOPE
   )
 set(teshsuite_src
index a26d7e0..8d01fc4 100644 (file)
@@ -99,13 +99,13 @@ int main(int argc, char *argv[])
   const char *application_file;
 
   MSG_init(&argc, argv);
-  if (argc < 2) {
+  if (argc != 3) {
     printf("Usage: %s platform_file deployment_file\n", argv[0]);
     printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
     exit(1);
   }
   platform_file = argv[1];
-  application_file = argv[1];
+  application_file = argv[2];
 
   /* MSG_config("workstation/model","KCCFLN05"); */
   {                             /*  Simulation setting */
index 403d26d..7b613bc 100644 (file)
@@ -1,5 +1,5 @@
 
-$ msg/host_on_off  ${srcdir:=.}/msg/host_on_off.xml
+$ msg/host_on_off ${srcdir:=.}/msg/host_on_off_p.xml ${srcdir:=.}/msg/host_on_off_d.xml
 > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "task on"
 > [Jupiter:slave:(2) 0.682345] [msg_test/INFO] Task "task on" done
 > [Tremblay:master:(1) 1.027003] [msg_test/INFO] Sending "task off"
diff --git a/teshsuite/msg/host_on_off_d.xml b/teshsuite/msg/host_on_off_d.xml
new file mode 100644 (file)
index 0000000..5c8fc7f
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+  <!-- The master process (with some arguments) -->
+  <process host="Tremblay" function="master">
+  </process>
+
+  <!-- The slave processes (with mailbox to listen on as argument) -->
+  <process host="Jupiter" function="slave">
+  </process>
+</platform>
similarity index 61%
rename from teshsuite/msg/host_on_off.xml
rename to teshsuite/msg/host_on_off_p.xml
index d57e0f3..1947841 100644 (file)
     <link_ctn id="1"/>
    </route>
   </AS>
-
-  <!-- The master process (with some arguments) -->
-  <process host="Tremblay" function="master">
-  </process>
-  
-  <!-- The slave processes (with mailbox to listen on as argument) -->
-  <process host="Jupiter" function="slave">
-  </process>
- </platform>
\ No newline at end of file
+</platform>
index 0d04024..6daa0d2 100644 (file)
@@ -125,13 +125,13 @@ int main(int argc, char *argv[])
   const char *application_file;
 
   MSG_init(&argc, argv);
-  if (argc < 2) {
+  if (argc != 3) {
     printf("Usage: %s platform_file deployment_file\n", argv[0]);
     printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
     exit(1);
   }
   platform_file = argv[1];
-  application_file = argv[1];
+  application_file = argv[2];
 
   /* MSG_config("workstation/model","KCCFLN05"); */
   {                             /*  Simulation setting */
index 1e3a6ba..3569491 100644 (file)
@@ -1,5 +1,5 @@
 
-$ msg/task_destroy_cancel ${srcdir:=.}/msg/task_destroy_cancel.xml
+$ msg/task_destroy_cancel ${srcdir:=.}/msg/task_destroy_cancel_p.xml ${srcdir:=.}/msg/task_destroy_cancel_d.xml
 > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending task: "normal"
 > [Jupiter:slave:(2) 0.027003] [msg_test/INFO] Handling task "normal"
 > [Tremblay:master:(1) 0.027003] [msg_test/INFO] Canceling task "cancel directly" directly
diff --git a/teshsuite/msg/task_destroy_cancel_d.xml b/teshsuite/msg/task_destroy_cancel_d.xml
new file mode 100644 (file)
index 0000000..5c8fc7f
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+  <!-- The master process (with some arguments) -->
+  <process host="Tremblay" function="master">
+  </process>
+
+  <!-- The slave processes (with mailbox to listen on as argument) -->
+  <process host="Jupiter" function="slave">
+  </process>
+</platform>
similarity index 61%
rename from teshsuite/msg/task_destroy_cancel.xml
rename to teshsuite/msg/task_destroy_cancel_p.xml
index d57e0f3..1947841 100644 (file)
     <link_ctn id="1"/>
    </route>
   </AS>
-
-  <!-- The master process (with some arguments) -->
-  <process host="Tremblay" function="master">
-  </process>
-  
-  <!-- The slave processes (with mailbox to listen on as argument) -->
-  <process host="Jupiter" function="slave">
-  </process>
- </platform>
\ No newline at end of file
+</platform>