Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move the MSG process-kill example to teshsuite
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 29 Nov 2017 15:48:52 +0000 (16:48 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 29 Nov 2017 15:49:04 +0000 (16:49 +0100)
examples/msg/CMakeLists.txt
examples/msg/README.doc
teshsuite/msg/CMakeLists.txt
teshsuite/msg/process-kill/process-kill.c [moved from examples/msg/process-kill/process-kill.c with 87% similarity]
teshsuite/msg/process-kill/process-kill.tesh [moved from examples/msg/process-kill/process-kill.tesh with 78% similarity]

index d55fb5c..0c6fa92 100644 (file)
@@ -4,7 +4,7 @@ foreach(x app-masterworker app-pingpong app-token-ring async-wait async-waitall
           dht-pastry energy-consumption energy-onoff energy-pstate energy-ptask energy-vm platform-failures 
           io-file io-remote io-storage task-priority 
           plugin-hostload 
           dht-pastry energy-consumption energy-onoff energy-pstate energy-ptask energy-vm platform-failures 
           io-file io-remote io-storage task-priority 
           plugin-hostload 
-         process-create process-daemon process-join process-kill process-migration process-suspend 
+         process-create process-daemon process-join process-migration process-suspend 
           platform-properties process-startkilltime synchro-semaphore trace-categories 
           trace-route-user-variables trace-link-user-variables trace-masterworker trace-platform 
           trace-process-migration trace-host-user-variables)
           platform-properties process-startkilltime synchro-semaphore trace-categories 
           trace-route-user-variables trace-link-user-variables trace-masterworker trace-platform 
           trace-process-migration trace-host-user-variables)
@@ -83,7 +83,7 @@ set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/a
 foreach(x app-chainsend app-masterworker app-pingpong app-token-ring
           async-wait async-waitall async-waitany cloud-capping cloud-masterworker cloud-migration cloud-simple 
           cloud-two-tasks dht-pastry dht-kademlia platform-failures io-file io-remote io-storage task-priority 
 foreach(x app-chainsend app-masterworker app-pingpong app-token-ring
           async-wait async-waitall async-waitany cloud-capping cloud-masterworker cloud-migration cloud-simple 
           cloud-two-tasks dht-pastry dht-kademlia platform-failures io-file io-remote io-storage task-priority 
-          process-create process-daemon process-join process-kill process-migration process-startkilltime process-suspend 
+          process-create process-daemon process-join process-migration process-startkilltime process-suspend 
          platform-properties synchro-semaphore)
   ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/${x} ${x}.tesh)
 endforeach()
          platform-properties synchro-semaphore)
   ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/${x} ${x}.tesh)
 endforeach()
index 42597dd..17aeb0a 100644 (file)
@@ -76,9 +76,6 @@ shipped in the archive:
     Processes can be suspended and resumed during their executions
     thanks to the @ref MSG_process_suspend and @ref MSG_process_resume functions.
 
     Processes can be suspended and resumed during their executions
     thanks to the @ref MSG_process_suspend and @ref MSG_process_resume functions.
 
-  - <b>Kill processes</b>.
-    @ref examples/msg/process-kill/process-kill.c \n
-    Processes can forcefully stop other processes with the @ref MSG_process_kill function.
      
   - <b>Migrating processes</b>.
     @ref examples/msg/process-migration/process-migration.c \n
      
   - <b>Migrating processes</b>.
     @ref examples/msg/process-migration/process-migration.c \n
@@ -232,7 +229,6 @@ top of the example file).
 
 @example examples/msg/process-create/process-create.c
 @example examples/msg/process-suspend/process-suspend.c
 
 @example examples/msg/process-create/process-create.c
 @example examples/msg/process-suspend/process-suspend.c
-@example examples/msg/process-kill/process-kill.c
 @example examples/msg/process-migration/process-migration.c
 @example examples/msg/process-startkilltime/process-startkilltime.c
 
 @example examples/msg/process-migration/process-migration.c
 @example examples/msg/process-startkilltime/process-startkilltime.c
 
index c52f14f..6ac011f 100644 (file)
@@ -1,6 +1,6 @@
 # C examples
 foreach(x actions-comm actions-storage cloud-sharing get_sender host_on_off host_on_off_recv host_on_off_processes
 # C examples
 foreach(x actions-comm actions-storage cloud-sharing get_sender host_on_off host_on_off_recv host_on_off_processes
-          process-yield
+          process-kill process-yield
           trace_integration)
   add_executable       (${x}  ${x}/${x}.c)
   target_link_libraries(${x}  simgrid)
           trace_integration)
   add_executable       (${x}  ${x}/${x}.c)
   target_link_libraries(${x}  simgrid)
@@ -39,7 +39,8 @@ set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/acti
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm_split_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/actions-storage_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm_split_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/actions-storage_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/process-yield/process-yield_d.xml                                   
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/process-kill/process-kill_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/process-yield/process-yield_d.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.5-hbp1.5.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.5-hbp1.5.xml
@@ -55,7 +56,7 @@ set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/acti
 
 foreach(x get_sender host_on_off host_on_off_processes host_on_off_recv
     task_destroy_cancel task_listen_from task_progress 
 
 foreach(x get_sender host_on_off host_on_off_processes host_on_off_recv
     task_destroy_cancel task_listen_from task_progress 
-    process-yield 
+    process-kill process-yield 
     trace_integration)
   ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
 endforeach()
     trace_integration)
   ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
 endforeach()
similarity index 87%
rename from examples/msg/process-kill/process-kill.c
rename to teshsuite/msg/process-kill/process-kill.c
index 657c5cc..37ee439 100644 (file)
@@ -14,7 +14,7 @@ static int victimA_fun(int argc, char* argv[])
   MSG_process_suspend(MSG_process_self()); /* - First suspend itself */
   XBT_INFO("OK, OK. Let's work");          /* - Then is resumed and start to execute a task */
   MSG_task_execute(MSG_task_create("work", 1e9, 0, NULL));
   MSG_process_suspend(MSG_process_self()); /* - First suspend itself */
   XBT_INFO("OK, OK. Let's work");          /* - Then is resumed and start to execute a task */
   MSG_task_execute(MSG_task_create("work", 1e9, 0, NULL));
-  XBT_INFO("Bye!");  /* - But will never reach the end of it */
+  XBT_INFO("Bye!"); /* - But will never reach the end of it */
   return 0;
 }
 
   return 0;
 }
 
@@ -24,9 +24,9 @@ static int victimB_fun(int argc, char* argv[])
   return 0;
 }
 
   return 0;
 }
 
-static int killer(int argc, char *argv[])
+static int killer(int argc, charargv[])
 {
 {
-  XBT_INFO("Hello!");         /* - First start a victim process */
+  XBT_INFO("Hello!"); /* - First start a victim process */
   msg_process_t victimA = MSG_process_create("victim A", victimA_fun, NULL, MSG_host_by_name("Fafard"));
   msg_process_t victimB = MSG_process_create("victim B", victimB_fun, NULL, MSG_host_by_name("Bourassa"));
   MSG_process_sleep(10.0);
   msg_process_t victimA = MSG_process_create("victim A", victimA_fun, NULL, MSG_host_by_name("Fafard"));
   msg_process_t victimB = MSG_process_create("victim B", victimB_fun, NULL, MSG_host_by_name("Bourassa"));
   MSG_process_sleep(10.0);
@@ -47,12 +47,12 @@ static int killer(int argc, char *argv[])
   return 0;
 }
 
   return 0;
 }
 
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   MSG_init(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
 {
   MSG_init(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
-  MSG_create_environment(argv[1]);   /* - Load the platform description */
+  MSG_create_environment(argv[1]); /* - Load the platform description */
   /* - Create and deploy killer process, that will create the victim process  */
   MSG_process_create("killer", killer, NULL, MSG_host_by_name("Tremblay"));
 
   /* - Create and deploy killer process, that will create the victim process  */
   MSG_process_create("killer", killer, NULL, MSG_host_by_name("Tremblay"));
 
similarity index 78%
rename from examples/msg/process-kill/process-kill.tesh
rename to teshsuite/msg/process-kill/process-kill.tesh
index c0aa6d8..6c008e5 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a MSG_process_kill function
 
 
 p Testing a MSG_process_kill function
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-kill ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/process-kill ${srcdir:=.}/../../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:killer@Tremblay) Hello!
 > [  0.000000] (2:victim A@Fafard) Hello!
 > [  0.000000] (2:victim A@Fafard) Suspending myself
 > [  0.000000] (1:killer@Tremblay) Hello!
 > [  0.000000] (2:victim A@Fafard) Hello!
 > [  0.000000] (2:victim A@Fafard) Suspending myself