Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move converted MSG process examples to the dungeon
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 2 Dec 2017 10:39:47 +0000 (11:39 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 2 Dec 2017 10:39:47 +0000 (11:39 +0100)
.gitignore
examples/msg/CMakeLists.txt
examples/msg/README.doc
examples/s4u/actor-suspend/s4u-actor-suspend.tesh
teshsuite/msg/CMakeLists.txt
teshsuite/msg/process-daemon/process-daemon.c [moved from examples/msg/process-daemon/process-daemon.c with 100% similarity]
teshsuite/msg/process-daemon/process-daemon.tesh [moved from examples/msg/process-daemon/process-daemon.tesh with 79% similarity]
teshsuite/msg/process-migration/process-migration.c [moved from examples/msg/process-migration/process-migration.c with 84% similarity]
teshsuite/msg/process-migration/process-migration.tesh [moved from examples/msg/process-migration/process-migration.tesh with 83% similarity]
teshsuite/msg/process-suspend/process-suspend.c [moved from examples/msg/process-suspend/process-suspend.c with 75% similarity]
teshsuite/msg/process-suspend/process-suspend.tesh [moved from examples/msg/process-suspend/process-suspend.tesh with 92% similarity]

index f9fd051..0d6f60d 100644 (file)
@@ -137,7 +137,6 @@ examples/msg/dht-pastry/dht-pastry
 examples/msg/energy-consumption/energy-consumption
 examples/msg/energy-onoff/energy-onoff
 examples/msg/energy-pstate/energy-pstate
-examples/msg/energy-ptask/energy-ptask
 examples/msg/energy-vm/energy-vm
 examples/msg/io-file/io-file
 examples/msg/io-file-unlink/io-file-unlink
@@ -146,12 +145,9 @@ examples/msg/io-storage/io-storage
 examples/msg/platform-failures/platform-failures
 examples/msg/plugin-hostload/plugin-hostload
 examples/msg/process-create/process-create
-examples/msg/process-daemon/process-daemon
 examples/msg/process-kill/process-kill
 examples/msg/process-join/process-join
-examples/msg/process-migration/process-migration
 examples/msg/process-startkilltime/process-startkilltime
-examples/msg/process-suspend/process-suspend
 examples/msg/app-masterworker/app-masterworker
 examples/msg/mc/bugged1
 examples/msg/mc/bugged1_liveness
@@ -210,6 +206,7 @@ examples/s4u/basic/s4u-basic_deployment
 examples/s4u/basic/s4u-basic_function
 examples/s4u/dht-chord/s4u-dht-chord
 examples/s4u/energy-link/s4u-energy-link
+examples/s4u/energy-ptask/s4u-energy-ptask
 examples/s4u/io/s4u-io
 examples/s4u/mutex/s4u-mutex
 examples/s4u/plugin-hostload/s4u-plugin-hostload
@@ -265,6 +262,7 @@ teshsuite/msg/actions-storage/actions-storage
 teshsuite/msg/app-bittorrent/bittorrent
 teshsuite/msg/cloud-sharing/cloud-sharing
 teshsuite/msg/concurrent_rw/concurrent_rw
+teshsuite/msg/energy-ptask/energy-ptask
 teshsuite/msg/get_sender/get_sender
 teshsuite/msg/host_on_off/host_on_off
 teshsuite/msg/host_on_off_processes/host_on_off_processes
@@ -273,6 +271,9 @@ teshsuite/msg/host_on_off_wait/host_on_off_wait
 teshsuite/msg/listen_async/listen_async
 teshsuite/msg/pid/pid
 teshsuite/msg/process/process
+teshsuite/msg/process-daemon/process-daemon
+teshsuite/msg/process-migration/process-migration
+teshsuite/msg/process-suspend/process-suspend
 teshsuite/msg/process-yield/process-yield
 teshsuite/msg/storage_client_server/storage_client_server
 teshsuite/msg/task_destroy_cancel/task_destroy_cancel
index be821f7..7b17a53 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-vm platform-failures 
           io-file io-remote io-storage task-priority 
           plugin-hostload 
-         process-create process-daemon process-join process-migration process-suspend 
+         process-create process-join
           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,8 +83,8 @@ 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 
-          process-create process-daemon process-join process-migration process-startkilltime process-suspend 
-         platform-properties synchro-semaphore)
+          process-create process-join process-startkilltime
+          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 17aeb0a..2089863 100644 (file)
@@ -71,16 +71,6 @@ shipped in the archive:
     Most processes are started from the deployment XML file, but they
     can also be used with the @ref MSG_process_create() function.
 
-  - <b>Suspend and Resume processes</b>.
-    @ref examples/msg/process-suspend/process-suspend.c \n
-    Processes can be suspended and resumed during their executions
-    thanks to the @ref MSG_process_suspend and @ref MSG_process_resume functions.
-
-     
-  - <b>Migrating processes</b>.
-    @ref examples/msg/process-migration/process-migration.c \n
-    Processes can move or be moved from a host to another with the @ref MSG_process_migrate function.
-    
   - <b>Controling the process life cycle from the XML</b>.
     @ref examples/msg/process-startkilltime/process-startkilltime.c \n
     You can specify a start time and a kill time in the deployment
@@ -228,8 +218,6 @@ top of the example file).
 @example examples/msg/async-waitany/async-waitany.c
 
 @example examples/msg/process-create/process-create.c
-@example examples/msg/process-suspend/process-suspend.c
-@example examples/msg/process-migration/process-migration.c
 @example examples/msg/process-startkilltime/process-startkilltime.c
 
 @example examples/msg/trace-platform/trace-platform.c
index f5d897c..54f9cdf 100644 (file)
@@ -1,6 +1,6 @@
 #! ./tesh
 
-p Testing the suspend/resume feature of MSG
+p Testing the suspend/resume feature of S4U
 
 ! output sort 19
 $ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-suspend ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
index bdb83bf..62b1507 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
-          process-kill process-yield
+          process-daemon process-kill process-migration process-suspend process-yield
           energy-ptask
           trace_integration)
   add_executable       (${x}  ${x}/${x}.c)
@@ -56,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 
-    process-kill process-yield
+    process-daemon process-kill process-migration process-suspend process-yield
     energy-ptask
     trace_integration)
   ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
@@ -2,7 +2,7 @@
 
 p Testing the process daemonization feature of MSG
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-daemon ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/process-daemon ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:worker@Boivin) Let's do some work (for 10 sec on Boivin).
 > [  0.000000] (2:daemon@Tremblay) Hello from the infinite loop
 > [  3.000000] (2:daemon@Tremblay) Hello from the infinite loop
@@ -11,13 +11,13 @@ msg_bar_t barrier;
 static msg_process_t controlled_process = NULL;
 
 /* The Emigrant process will be moved from host to host. */
-static int emigrant(int argc, char *argv[])
+static int emigrant(int argc, charargv[])
 {
   XBT_INFO("I'll look for a new job on another machine ('Boivin') where the grass is greener.");
-  MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Boivin"));    /* - First, move to another host by myself */
+  MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Boivin")); /* - First, move to another host by myself */
 
   XBT_INFO("Yeah, found something to do");
-  msg_task_t task = MSG_task_create("job", 98095000, 0, NULL);            /* - Execute some work there */
+  msg_task_t task = MSG_task_create("job", 98095000, 0, NULL); /* - Execute some work there */
   MSG_task_execute(task);
   MSG_task_destroy(task);
   MSG_process_sleep(2);
@@ -35,9 +35,9 @@ static int emigrant(int argc, char *argv[])
 }
 
 /* The policeman check for emigrants and move them back to 'Jacquelin' */
-static int policeman(int argc, char *argv[])
+static int policeman(int argc, charargv[])
 {
-  XBT_INFO("Wait at the checkpoint.");  /* - block on the mutex+condition */
+  XBT_INFO("Wait at the checkpoint."); /* - block on the mutex+condition */
   MSG_barrier_wait(barrier);
   MSG_process_migrate(controlled_process, MSG_host_by_name("Jacquelin")); /* - Move an emigrant to Jacquelin */
   XBT_INFO("I moved the emigrant");
@@ -46,12 +46,12 @@ static int policeman(int argc, char *argv[])
   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_create_environment(argv[1]);  /* - Load the platform description */
+  MSG_create_environment(argv[1]); /* - Load the platform description */
   /* - Create and deploy the emigrant and policeman processes */
   MSG_process_create("emigrant", emigrant, NULL, MSG_get_host_by_name("Jacquelin"));
   MSG_process_create("policeman", policeman, NULL, MSG_get_host_by_name("Boivin"));
@@ -3,7 +3,7 @@
 p Testing the migration feature of MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/process-migration ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/process-migration ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:emigrant@Jacquelin) I'll look for a new job on another machine ('Boivin') where the grass is greener.
 > [  0.000000] (1:emigrant@Boivin) Yeah, found something to do
 > [  0.000000] (2:policeman@Boivin) Wait at the checkpoint.
@@ -9,13 +9,13 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_suspend, "Messages specific for this msg example");
 
 /* The Lazy guy only wants to sleep, but can be awaken by the dream_master process. */
-static int lazy_guy(int argc, char *argv[])
+static int lazy_guy(int argc, charargv[])
 {
   XBT_INFO("Nobody's watching me ? Let's go to sleep.");
-  MSG_process_suspend(MSG_process_self());       /* - Start by suspending itself */
+  MSG_process_suspend(MSG_process_self()); /* - Start by suspending itself */
   XBT_INFO("Uuuh ? Did somebody call me ?");
 
-  XBT_INFO("Going to sleep...");                 /* - Then repetitively go to sleep, but got awaken */
+  XBT_INFO("Going to sleep..."); /* - Then repetitively go to sleep, but got awaken */
   MSG_process_sleep(10.0);
   XBT_INFO("Mmm... waking up.");
 
@@ -33,22 +33,22 @@ static int lazy_guy(int argc, char *argv[])
 }
 
 /* The Dream master: */
-static int dream_master(int argc, char *argv[])
+static int dream_master(int argc, charargv[])
 {
   XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */
   msg_process_t lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
   XBT_INFO("Let's wait a little bit...");
-  MSG_process_sleep(10.0);              /* - Wait for 10 seconds */
+  MSG_process_sleep(10.0); /* - Wait for 10 seconds */
   XBT_INFO("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!");
-  MSG_process_resume(lazy);             /* - Then wake up the lazy_guy */
+  MSG_process_resume(lazy); /* - Then wake up the lazy_guy */
 
-  MSG_process_sleep(5.0);               /* Repeat two times: */
+  MSG_process_sleep(5.0); /* Repeat two times: */
   XBT_INFO("Suspend the lazy guy while he's sleeping...");
-  MSG_process_suspend(lazy);            /* - Suspend the lazy_guy while he's asleep */
+  MSG_process_suspend(lazy); /* - Suspend the lazy_guy while he's asleep */
   XBT_INFO("Let him finish his siesta.");
-  MSG_process_sleep(10.0);              /* - Wait for 10 seconds */
+  MSG_process_sleep(10.0); /* - Wait for 10 seconds */
   XBT_INFO("Wake up, lazy guy!");
-  MSG_process_resume(lazy);             /* - Then wake up the lazy_guy again */
+  MSG_process_resume(lazy); /* - Then wake up the lazy_guy again */
 
   MSG_process_sleep(5.0);
   XBT_INFO("Suspend again the lazy guy while he's sleeping...");
@@ -69,12 +69,12 @@ static int dream_master(int argc, char *argv[])
   return 0;
 }
 
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   MSG_init(&argc, argv);
   xbt_assert(argc > 1, "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 */
   MSG_function_register("dream_master", dream_master); /* - Create and deploy the dream_master */
   xbt_dynar_t hosts = MSG_hosts_as_dynar();
   MSG_process_create("dream_master", dream_master, NULL, xbt_dynar_getfirst_as(hosts, msg_host_t));
@@ -3,7 +3,7 @@
 p Testing the suspend/resume feature of MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/process-suspend ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/process-suspend ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dream_master@Boivin) Let's create a lazy guy.
 > [  0.000000] (2:Lazy@Boivin) Nobody's watching me ? Let's go to sleep.
 > [  0.000000] (1:dream_master@Boivin) Let's wait a little bit...