Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Further reorganize the MSG examples' documentation
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 15 May 2016 08:55:29 +0000 (10:55 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 16 May 2016 03:47:07 +0000 (05:47 +0200)
doc/Doxyfile.in
examples/msg/README.doc
examples/msg/process-kill/process-kill.c
examples/msg/process-migration/process-migration.c
examples/msg/process-startkilltime/process-startkilltime.c
examples/msg/process-suspend/process-suspend.c
examples/msg/trace-categories/trace-categories.c
examples/msg/trace-platform/trace-platform.c
examples/msg/trace-simple/trace-simple.c

index 77e7e45..3639a09 100644 (file)
@@ -688,36 +688,8 @@ INPUT                  = doxygen/index.doc \
                          @CMAKE_HOME_DIRECTORY@/src/simdag \
                          @CMAKE_HOME_DIRECTORY@/src/simix \
                          @CMAKE_BINARY_DIR@/include \
                          @CMAKE_HOME_DIRECTORY@/src/simdag \
                          @CMAKE_HOME_DIRECTORY@/src/simix \
                          @CMAKE_BINARY_DIR@/include \
-                         @CMAKE_BINARY_DIR@/src
-
-
-###################################################
-##  PLEASE DON'T MESS WITH THE ORDER OF EXAMPLES ## (unless you know what you are doing, of course)
-###################################################
-
-INPUT +=                 @CMAKE_HOME_DIRECTORY@/examples/msg/README.doc \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/process-suspend/process-suspend.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/process-kill/process-kill.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/process-migration/process-migration.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/process-startkilltime/process-startkilltime.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-simple/trace-simple.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-platform/trace-platform.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-categories/trace-categories.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-masterworker/trace-masterworker.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-process-migration/trace-process-migration.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-user-variables/trace-user-variables.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-link-user-variables/trace-link-user-variables.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/trace-link-srcdst-user-variables/trace-link-srcdst-user-variables.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/network-ns3/network-ns3.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/io-storage/io-storage.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/io-file/io-file.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/io-remote/io-remote.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/actions-comm/actions-comm.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/actions-storage/actions-storage.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/app-pmm/ \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/dht-chord \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/task-priority/task-priority.c \
-                         @CMAKE_HOME_DIRECTORY@/examples/msg/properties/properties.c
+                         @CMAKE_BINARY_DIR@/src \
+                         @CMAKE_HOME_DIRECTORY@/examples/msg/README.doc
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
index 0eaa34f..9fc8e91 100644 (file)
@@ -1,4 +1,5 @@
-This file follows the Doxygen syntax to be included in the documentation.
+This file follows the Doxygen syntax to be included in the
+documentation, but it should remain readable directly.
 
 /** 
  @defgroup MSG_examples MSG examples
 
 /** 
  @defgroup MSG_examples MSG examples
@@ -63,13 +64,81 @@ shipped in the archive:
    until one activity of the set completes, no matter which terminates
    first.
 
    until one activity of the set completes, no matter which terminates
    first.
 
+@section msg_ex_process Acting on Processes
+
+  - <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>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
+    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
+    file. See all *_d.xml files in this directory.
+
+@section msg_ex_tracing Tracing and visualization features
+
+Tracing can be activated by various configuration options which
+are illustrated in these example. See also the 
+@ref tracing_tracing_options "full list of options related to tracing".
+
+  - <b>Basic example</b>. @ref examples/msg/trace-simple/trace-simple.c \n
+    In this very simple program, each process creates, executes,
+    and destroy a task. You might want to run it with the
+    <i>--cfg=tracing/uncategorized:yes</i> option.
+
+  - <b>Platform tracing</b>.
+    @ref examples/msg/trace-platform/trace-platform.c \n
+    This program is a toy example just loading the platform, so that
+    you can play with the  <i>--cfg=tracing:yes</i> and
+    <i>--cfg=tracing/categorized:yes</i> options and visualize the
+    result.
+
+  - <b>Setting Categories</b>.
+    @ref examples/msg/trace-categories/trace-categories.c \n
+    This example declares several tracing categories
+    to that are used to classify its tasks. When the program is executed,
+    the tracing mechanism registers the resource utilization of hosts
+    and links according to these categories.\n
+    You want to run this program with the following options:
+    <i>--cfg=tracing:yes</i>, <i>--cfg=tracing/categorized:yes</i>,
+    <i>--cfg=tracing/uncategorized:yes</i>, <i>--cfg=viva/categorized:viva_cat.plist</i>, and
+    <i>--cfg=viva/uncategorized:viva_uncat.plist</i>.
+
+    
+    
+@example examples/msg/trace-masterworker/trace-masterworker.c
+@example examples/msg/trace-process-migration/trace-process-migration.c
+@example examples/msg/trace-user-variables/trace-user-variables.c
+@example examples/msg/trace-link-user-variables/trace-link-user-variables.c
+@example examples/msg/trace-link-srcdst-user-variables/trace-link-srcdst-user-variables.c
+@example examples/msg/network-ns3/network-ns3.c
+@example examples/msg/io-storage/io-storage.c
+@example examples/msg/io-file/io-file.c
+@example examples/msg/io-remote/io-remote.c
+@example examples/msg/actions-comm/actions-comm.c
+@example examples/msg/actions-storage/actions-storage.c
+@example examples/msg/app-pmm/app-pmm.c
+@example examples/msg/dht-chord
+@example examples/msg/task-priority/task-priority.c
+@example examples/msg/properties/properties.c
+
 */
 
 As a human, you can stop reading at this point. The rest is garbage:
 
 Every example must be listed in the following, but it's not possible
 */
 
 As a human, you can stop reading at this point. The rest is garbage:
 
 Every example must be listed in the following, but it's not possible
-to move this content upper as each example directive seems to eat the
-next doxygen commands. 
+to move this content upper as each @example directive seems to eat the
+next doxygen commands (and the content is placed at the top of the
+example file). 
 
 
 /**
 
 
 /**
@@ -81,6 +150,32 @@ next doxygen commands.
 @example examples/msg/async-wait/async-wait.c
 @example examples/msg/async-waitall/async-waitall.c
 @example examples/msg/async-waitall/async-waitany.c
 @example examples/msg/async-wait/async-wait.c
 @example examples/msg/async-waitall/async-waitall.c
 @example examples/msg/async-waitall/async-waitany.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/trace-simple/trace-simple.c
+@example examples/msg/trace-platform/trace-platform.c
+@example examples/msg/trace-categories/trace-categories.c
+@example examples/msg/trace-masterworker/trace-masterworker.c
+@example examples/msg/trace-process-migration/trace-process-migration.c
+@example examples/msg/trace-user-variables/trace-user-variables.c
+@example examples/msg/trace-link-user-variables/trace-link-user-variables.c
+@example examples/msg/trace-link-srcdst-user-variables/trace-link-srcdst-user-variables.c
+
+@example examples/msg/network-ns3/network-ns3.c
+@example examples/msg/io-storage/io-storage.c
+@example examples/msg/io-file/io-file.c
+@example examples/msg/io-remote/io-remote.c
+@example examples/msg/actions-comm/actions-comm.c
+@example examples/msg/actions-storage/actions-storage.c
+@example examples/msg/app-pmm/app-pmm.c
+@example examples/msg/dht-chord
+@example examples/msg/task-priority/task-priority.c
+@example examples/msg/properties/properties.c
+                        
 */
 
 Basic examples and features
 */
 
 Basic examples and features
index a716d9e..f83b68a 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007, 2009-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007, 2009-2016. The SimGrid Team. All rights reserved.    */
 
 /* 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. */
 
 /* 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. */
@@ -7,33 +6,28 @@
 #include "simgrid/msg.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_kill, "Messages specific for this msg example");
 #include "simgrid/msg.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_kill, "Messages specific for this msg example");
-/** @addtogroup MSG_examples
- *
- *  - <b>Killing: process-kill/process-kill.c</b>. Processes can also be killed by another if needed thanks to
- *    the @ref MSG_process_kill function.
- */
 
 static int victim(int argc, char *argv[])
 {
   XBT_INFO("Hello!");
   XBT_INFO("Suspending myself");
 
 static int victim(int argc, char *argv[])
 {
   XBT_INFO("Hello!");
   XBT_INFO("Suspending myself");
-  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_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_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;
 }
 
 static int killer(int argc, char *argv[])
 {
   return 0;
 }
 
 static int killer(int argc, char *argv[])
 {
-  XBT_INFO("Hello!");         /** - First start a @ref victim process */
+  XBT_INFO("Hello!");         /* - First start a victim process */
   msg_process_t poor_victim = MSG_process_create("victim", victim, NULL, MSG_host_by_name("Fafard"));
   MSG_process_sleep(10.0);
 
   msg_process_t poor_victim = MSG_process_create("victim", victim, NULL, MSG_host_by_name("Fafard"));
   MSG_process_sleep(10.0);
 
-  XBT_INFO("Resume process"); /** - Resume it from its suspended state */
+  XBT_INFO("Resume process"); /* - Resume it from its suspended state */
   MSG_process_resume(poor_victim);
 
   MSG_process_resume(poor_victim);
 
-  XBT_INFO("Kill process");   /** - and then kill it */
+  XBT_INFO("Kill process");   /* - and then kill it */
   MSG_process_kill(poor_victim);
 
   XBT_INFO("OK, goodbye now.");
   MSG_process_kill(poor_victim);
 
   XBT_INFO("OK, goodbye now.");
@@ -47,11 +41,11 @@ int main(int argc, char *argv[])
   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 */
-  /** - Create and deploy @ref killer process */
+  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"));
 
   MSG_process_create("killer", killer, NULL, MSG_host_by_name("Tremblay"));
 
-  res = MSG_main();                 /** - Run the simulation */
+  res = MSG_main();                 /* - Run the simulation */
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
index bb37b97..c1e0713 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2009-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
 
 /* 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. */
 
 /* 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. */
@@ -9,33 +8,27 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_migration, "Messages specific for this msg example");
 
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_migration, "Messages specific for this msg example");
 
-/** @addtogroup MSG_examples
- *
- *  - <b>Migration: process-migration/process-migration.c</b>. Processes can move or be moved from a host to another
- *    while they are running thanks to the @ref MSG_process_migrate function.
- */
-
 xbt_mutex_t checkpoint = NULL;
 xbt_cond_t identification = NULL;
 static msg_process_t controlled_process = NULL;
 
 xbt_mutex_t checkpoint = NULL;
 xbt_cond_t identification = NULL;
 static msg_process_t controlled_process = NULL;
 
-/** The Emigrant will be moved from host to host. */
+/* The Emigrant process will be moved from host to host. */
 static int emigrant(int argc, char *argv[])
 {
   XBT_INFO("I'll look for a new job on another machine ('Boivin') where the grass is greener.");
 static int emigrant(int argc, char *argv[])
 {
   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");
 
   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);
   XBT_INFO("Moving back home after work");
   MSG_task_execute(task);
   MSG_task_destroy(task);
   MSG_process_sleep(2);
   XBT_INFO("Moving back home after work");
-  MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Jacquelin")); /** - Move back to original location */
-  MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Boivin"));    /** - Go back to the other host to sleep*/
+  MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Jacquelin")); /* - Move back to original location */
+  MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Boivin"));    /* - Go back to the other host to sleep*/
   MSG_process_sleep(4);
   MSG_process_sleep(4);
-  xbt_mutex_acquire(checkpoint);                                          /** - Get controlled at checkpoint */
-  controlled_process = MSG_process_self();                                /** - and get moved back by @ref policeman */
+  xbt_mutex_acquire(checkpoint);                                          /* - Get controlled at checkpoint */
+  controlled_process = MSG_process_self();                                /* - and get moved back by the policeman process */
   xbt_cond_broadcast(identification);
   xbt_mutex_release(checkpoint);
   MSG_process_suspend(MSG_process_self());
   xbt_cond_broadcast(identification);
   xbt_mutex_release(checkpoint);
   MSG_process_suspend(MSG_process_self());
@@ -45,13 +38,13 @@ static int emigrant(int argc, char *argv[])
   return 0;
 }
 
   return 0;
 }
 
-/** The policeman check for emigrants and move them back to 'Jacquelin' */
+/* The policeman check for emigrants and move them back to 'Jacquelin' */
 static int policeman(int argc, char *argv[])
 {
   xbt_mutex_acquire(checkpoint);
 static int policeman(int argc, char *argv[])
 {
   xbt_mutex_acquire(checkpoint);
-  XBT_INFO("Wait at the checkpoint.");  /** - Wait at @ref checkpoint to control the @ref identification of processes */
+  XBT_INFO("Wait at the checkpoint.");  /* - block on the mutex+condition */
   while (controlled_process == NULL) xbt_cond_wait(identification, checkpoint);
   while (controlled_process == NULL) xbt_cond_wait(identification, checkpoint);
-  MSG_process_migrate(controlled_process, MSG_host_by_name("Jacquelin")); /** - Move an emigrant to Jacquelin */
+  MSG_process_migrate(controlled_process, MSG_host_by_name("Jacquelin")); /* - Move an emigrant to Jacquelin */
   XBT_INFO("I moved the emigrant");
   MSG_process_resume(controlled_process);
   xbt_mutex_release(checkpoint);
   XBT_INFO("I moved the emigrant");
   MSG_process_resume(controlled_process);
   xbt_mutex_release(checkpoint);
@@ -66,14 +59,14 @@ int main(int argc, char *argv[])
   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 */
-  /** - Create and deploy @ref emigrant and @ref policeman processes */
+  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"));
 
   MSG_process_create("emigrant", emigrant, NULL, MSG_get_host_by_name("Jacquelin"));
   MSG_process_create("policeman", policeman, NULL, MSG_get_host_by_name("Boivin"));
 
-  checkpoint = xbt_mutex_init();     /** - Initiate @ref checkpoint and @ref identification*/
+  checkpoint = xbt_mutex_init();     /* - Initiate the mutex and conditions */
   identification = xbt_cond_init();
   identification = xbt_cond_init();
-  res = MSG_main();                  /** - Run the simulation */
+  res = MSG_main();                  /* - Run the simulation */
   XBT_INFO("Simulation time %g", MSG_get_clock());
   xbt_cond_destroy(identification);
   xbt_mutex_destroy(checkpoint);
   XBT_INFO("Simulation time %g", MSG_get_clock());
   xbt_cond_destroy(identification);
   xbt_mutex_destroy(checkpoint);
index a738bac..287fd11 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007, 2009-2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
 
 /* 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. */
 
 /* 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. */
@@ -8,19 +7,13 @@
 
 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");
 
-/** @addtogroup MSG_examples
- *
- *  - <b>Life-Cycle: process-startkilltime/process-startkilltime.c</b>. The <i>creation</i> and  <i>termination</i>
- *    times of processes can be explicitly given in the deployment file (see *_d.xml files in example directory).
- */
-
-/** Executed on process termination*/
+/* Executed on process termination*/
 static int my_onexit(void* ignored1, void *ignored2) {
 static int my_onexit(void* ignored1, void *ignored2) {
-  XBT_INFO("Exiting now (done sleeping or got killed)."); /** - Just display an informative message (see tesh file) */
+  XBT_INFO("Exiting now (done sleeping or got killed)."); /* - Just display an informative message (see tesh file) */
   return 0;
 }
 
   return 0;
 }
 
-/** Just sleep until termination */
+/* Just sleep until termination */
 static int sleeper(int argc, char *argv[])
 {
   XBT_INFO("Hello! I go to sleep.");
 static int sleeper(int argc, char *argv[])
 {
   XBT_INFO("Hello! I go to sleep.");
@@ -39,11 +32,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]);
 
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
              "\tExample: %s msg_platform.xml msg_deployment.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("sleeper", sleeper);
   MSG_function_register("sleeper", sleeper);
-  MSG_launch_application(argv[2]);   /** - Deploy the @ref sleeper processes with explicit start/kill times */
+  MSG_launch_application(argv[2]);   /* - Deploy the sleeper processes with explicit start/kill times */
 
 
-  res = MSG_main();                  /** - Run the simulation */
+  res = MSG_main();                  /* - Run the simulation */
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 }
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 }
index 07e38fa..d4e79ba 100644 (file)
@@ -8,61 +8,50 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_suspend, "Messages specific for this msg example");
 
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_suspend, "Messages specific for this msg example");
 
-#define SLEEP(duration)                                 \
-  if (MSG_process_sleep(duration) != MSG_OK)            \
-    xbt_die("What's going on??? I failed to sleep!");
-
-/** @addtogroup MSG_examples
- *  @section msg_ex_process Acting on Processes
- * 
- * - <b>Suspend/Resume: process-suspend/process-suspend.c</b>. Processes can be suspended and resumed during
- *   their executions thanks to the @ref MSG_process_suspend and @ref MSG_process_resume functions.
- */
-
-/** The Lazy guy only wants to sleep, but can be awaken by the @ref dream_master. */
+/* The Lazy guy only wants to sleep, but can be awaken by the dream_master process. */
 static int lazy_guy(int argc, char *argv[])
 {
   XBT_INFO("Nobody's watching me ? Let's go to sleep.");
 static int lazy_guy(int argc, char *argv[])
 {
   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("Uuuh ? Did somebody call me ?");
 
-  XBT_INFO("Going to sleep...");                 /** - Then repetitively go to sleep, but got awaken */
-  SLEEP(10.0);
+  XBT_INFO("Going to sleep...");                 /* - Then repetitively go to sleep, but got awaken */
+  MSG_process_sleep(10.0);
   XBT_INFO("Mmm... waking up.");
 
   XBT_INFO("Going to sleep one more time...");
   XBT_INFO("Mmm... waking up.");
 
   XBT_INFO("Going to sleep one more time...");
-  SLEEP(10.0);
+  MSG_process_sleep(10.0);
   XBT_INFO("Waking up once for all!");
 
   XBT_INFO("Mmmh, goodbye now.");
   return 0;
 }
 
   XBT_INFO("Waking up once for all!");
 
   XBT_INFO("Mmmh, goodbye now.");
   return 0;
 }
 
-/** The Dream master: */
+/* The Dream master: */
 static int dream_master(int argc, char *argv[])
 {
   msg_process_t lazy = NULL;
 
 static int dream_master(int argc, char *argv[])
 {
   msg_process_t lazy = NULL;
 
-  XBT_INFO("Let's create a lazy guy."); /** - Create a @ref lazy_guy process */
+  XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */
   lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
   XBT_INFO("Let's wait a little bit...");
   lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
   XBT_INFO("Let's wait a little bit...");
-  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!!!!");
   XBT_INFO("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!");
-  MSG_process_resume(lazy);             /** - Then wake up the @ref lazy_guy */
+  MSG_process_resume(lazy);             /* - Then wake up the lazy_guy */
 
 
-  SLEEP(5.0);                           /** Repeat two times: */
+  MSG_process_sleep(5.0);               /* Repeat two times: */
   XBT_INFO("Suspend the lazy guy while he's sleeping...");
   XBT_INFO("Suspend the lazy guy while he's sleeping...");
-  MSG_process_suspend(lazy);            /** - Suspend the @ref 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.");
   XBT_INFO("Let him finish his siesta.");
-  SLEEP(10.0);                          /** - Wait for 10 seconds */
+  MSG_process_sleep(10.0);              /* - Wait for 10 seconds */
   XBT_INFO("Wake up, lazy guy!");
   XBT_INFO("Wake up, lazy guy!");
-  MSG_process_resume(lazy);             /** - Then wake up the @ref lazy_guy again */
+  MSG_process_resume(lazy);             /* - Then wake up the lazy_guy again */
 
 
-  SLEEP(5.0);
+  MSG_process_sleep(5.0);
   XBT_INFO("Suspend again the lazy guy while he's sleeping...");
   MSG_process_suspend(lazy);
   XBT_INFO("This time, don't let him finish his siesta.");
   XBT_INFO("Suspend again the lazy guy while he's sleeping...");
   MSG_process_suspend(lazy);
   XBT_INFO("This time, don't let him finish his siesta.");
-  SLEEP(2.0);
+  MSG_process_sleep(2.0);
   XBT_INFO("Wake up, lazy guy!");
   MSG_process_resume(lazy);
 
   XBT_INFO("Wake up, lazy guy!");
   MSG_process_resume(lazy);
 
@@ -77,12 +66,12 @@ int main(int argc, char *argv[])
   MSG_init(&argc, argv);
   xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
   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_function_register("dream_master", dream_master); /** - Create and deploy the @ref dream_master */
+  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));
   xbt_dynar_free(&hosts);
   xbt_dynar_t hosts = MSG_hosts_as_dynar();
   MSG_process_create("dream_master", dream_master, NULL, xbt_dynar_getfirst_as(hosts, msg_host_t));
   xbt_dynar_free(&hosts);
-  res = MSG_main();                 /** - Run the simulation */
+  res = MSG_main();                 /* - Run the simulation */
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
   return res != MSG_OK;
index 7f639f2..3030c3a 100644 (file)
@@ -1,18 +1,8 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2016. The SimGrid Team. All rights reserved.          */
 
 /* 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. */
 
 
 /* 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. */
 
-/** @addtogroup MSG_examples
- * 
- * - <b>Setting Categories: trace-categories/trace-categories.c</b>. This example declares several tracing categories
- * that are used to classify tasks. When the program is executed, the tracing mechanism registers the resource
- * utilization of hosts and links according to these categories. You might want to run this program with the following
- * options: <i>--cfg=tracing:yes</i>, <i>--cfg=tracing/categorized:yes</i>, <i>--cfg=tracing/uncategorized:yes</i>,
- * <i>--cfg=viva/categorized:viva_cat.plist</i>, and <i>--cfg=viva/uncategorized:viva_uncat.plist</i>.
- */
-
 #include "simgrid/msg.h"
 
 static int master(int argc, char *argv[])
 #include "simgrid/msg.h"
 
 static int master(int argc, char *argv[])
@@ -24,7 +14,7 @@ static int master(int argc, char *argv[])
   for (i = 0; i < number_of_tasks; i++) {
     msg_task_t task = NULL;
 
   for (i = 0; i < number_of_tasks; i++) {
     msg_task_t task = NULL;
 
-    //creating task and setting its category
+    /* creating task and setting its category */
     if (i % 2) {
       task = MSG_task_create("task_compute", 10000000, 0, NULL);
       MSG_task_set_category(task, "compute");
     if (i % 2) {
       task = MSG_task_create("task_compute", 10000000, 0, NULL);
       MSG_task_set_category(task, "compute");
@@ -74,7 +64,7 @@ int main(int argc, char *argv[])
 
   MSG_create_environment(argv[1]);
 
 
   MSG_create_environment(argv[1]);
 
-  //declaring user categories with RGB colors
+  /* declaring user categories with RGB colors */
   TRACE_category_with_color ("compute", "1 0 0"); //red
   TRACE_category_with_color ("request", "0 1 0"); //green
   TRACE_category_with_color ("data", "0 0 1");    //blue
   TRACE_category_with_color ("compute", "1 0 0"); //red
   TRACE_category_with_color ("request", "0 1 0"); //green
   TRACE_category_with_color ("data", "0 0 1");    //blue
index 0ca692d..c3a0600 100644 (file)
@@ -1,16 +1,8 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
 
 /* 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. */
 
 
 /* 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. */
 
-/** @addtogroup MSG_examples
- * 
- * - <b>Tracing the platform: trace-platform/trace-platform.c</b>. This example just loads a platform file to
- *  demonstrate how it can be traced into the Paje trace file format. You might want to run this program with the
- *  following options: <i>--cfg=tracing:yes</i> and <i>--cfg=tracing/categorized:yes</i>.
- */
-
 #include "simgrid/msg.h"
 
 int main(int argc, char *argv[])
 #include "simgrid/msg.h"
 
 int main(int argc, char *argv[])
index b735435..a53e51f 100644 (file)
@@ -1,20 +1,10 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved.    */
 
 /* 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 "simgrid/msg.h"
 
 
 /* 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 "simgrid/msg.h"
 
-/** @addtogroup MSG_examples
- * 
- * @section msg_ex_tracing Tracing and visualization features
- * Tracing can be activated by various configuration options which are illustrated in these example.
- * See \ref tracing_tracing_options for details.
- * - <b>Basic example: trace-simple/trace-simple.c</b>. In this very simple program, each process creates, executes,
- *   and destroy a task. You might want to run it with the <i>--cfg=tracing/uncategorized:yes</i> option.
- */
-
 static int simple_func(int argc, char *argv[])
 {
   msg_task_t task = MSG_task_create("task", 100, 0, NULL);
 static int simple_func(int argc, char *argv[])
 {
   msg_task_t task = MSG_task_create("task", 100, 0, NULL);