From adb524c4eae6ae92ecdb6eeb0167e6194eb149b6 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 15 May 2016 10:55:29 +0200 Subject: [PATCH 1/1] Further reorganize the MSG examples' documentation --- doc/Doxyfile.in | 32 +----- examples/msg/README.doc | 101 +++++++++++++++++- examples/msg/process-kill/process-kill.c | 26 ++--- .../msg/process-migration/process-migration.c | 37 +++---- .../process-startkilltime.c | 21 ++-- .../msg/process-suspend/process-suspend.c | 47 ++++---- .../msg/trace-categories/trace-categories.c | 16 +-- examples/msg/trace-platform/trace-platform.c | 10 +- examples/msg/trace-simple/trace-simple.c | 12 +-- 9 files changed, 155 insertions(+), 147 deletions(-) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 77e7e45c97..3639a096a3 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -688,36 +688,8 @@ INPUT = doxygen/index.doc \ @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 diff --git a/examples/msg/README.doc b/examples/msg/README.doc index 0eaa34f582..9fc8e910e8 100644 --- a/examples/msg/README.doc +++ b/examples/msg/README.doc @@ -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 @@ -63,13 +64,81 @@ shipped in the archive: until one activity of the set completes, no matter which terminates first. +@section msg_ex_process Acting on Processes + + - Suspend and Resume processes. + @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. + + - Kill processes. + @ref examples/msg/process-kill/process-kill.c \n + Processes can forcefully stop other processes with the @ref MSG_process_kill function. + + - Migrating processes. + @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. + + - Controling the process life cycle from the XML. + @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". + + - Basic example. @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 + --cfg=tracing/uncategorized:yes option. + + - Platform tracing. + @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 --cfg=tracing:yes and + --cfg=tracing/categorized:yes options and visualize the + result. + + - Setting Categories. + @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: + --cfg=tracing:yes, --cfg=tracing/categorized:yes, + --cfg=tracing/uncategorized:yes, --cfg=viva/categorized:viva_cat.plist, and + --cfg=viva/uncategorized:viva_uncat.plist. + + + +@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 -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/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 diff --git a/examples/msg/process-kill/process-kill.c b/examples/msg/process-kill/process-kill.c index a716d9e29b..f83b68a100 100644 --- a/examples/msg/process-kill/process-kill.c +++ b/examples/msg/process-kill/process-kill.c @@ -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. */ @@ -7,33 +6,28 @@ #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_kill, "Messages specific for this msg example"); -/** @addtogroup MSG_examples - * - * - Killing: process-kill/process-kill.c. 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"); - 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)); - 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[]) { - 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); - 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); - 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."); @@ -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_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")); - res = MSG_main(); /** - Run the simulation */ + res = MSG_main(); /* - Run the simulation */ XBT_INFO("Simulation time %g", MSG_get_clock()); return res != MSG_OK; diff --git a/examples/msg/process-migration/process-migration.c b/examples/msg/process-migration/process-migration.c index bb37b976ff..c1e0713549 100644 --- a/examples/msg/process-migration/process-migration.c +++ b/examples/msg/process-migration/process-migration.c @@ -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. */ @@ -9,33 +8,27 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_migration, "Messages specific for this msg example"); -/** @addtogroup MSG_examples - * - * - Migration: process-migration/process-migration.c. 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; -/** 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."); - 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); 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); - 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()); @@ -45,13 +38,13 @@ static int emigrant(int argc, char *argv[]) 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); - 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); - 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); @@ -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_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")); - checkpoint = xbt_mutex_init(); /** - Initiate @ref checkpoint and @ref identification*/ + checkpoint = xbt_mutex_init(); /* - Initiate the mutex and conditions */ 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); diff --git a/examples/msg/process-startkilltime/process-startkilltime.c b/examples/msg/process-startkilltime/process-startkilltime.c index a738bac42d..287fd11a8d 100644 --- a/examples/msg/process-startkilltime/process-startkilltime.c +++ b/examples/msg/process-startkilltime/process-startkilltime.c @@ -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. */ @@ -8,19 +7,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); -/** @addtogroup MSG_examples - * - * - Life-Cycle: process-startkilltime/process-startkilltime.c. The creation and termination - * 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) { - 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; } -/** Just sleep until termination */ +/* Just sleep until termination */ 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]); - MSG_create_environment(argv[1]); /** - Load the platform description */ + MSG_create_environment(argv[1]); /* - Load the platform description */ 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; } diff --git a/examples/msg/process-suspend/process-suspend.c b/examples/msg/process-suspend/process-suspend.c index 07e38fa29d..d4e79ba526 100644 --- a/examples/msg/process-suspend/process-suspend.c +++ b/examples/msg/process-suspend/process-suspend.c @@ -8,61 +8,50 @@ 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 - * - * - Suspend/Resume: process-suspend/process-suspend.c. 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."); - 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 */ - 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..."); - SLEEP(10.0); + MSG_process_sleep(10.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; - 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..."); - 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 @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..."); - 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."); - 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 @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."); - SLEEP(2.0); + MSG_process_sleep(2.0); 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_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); - res = MSG_main(); /** - Run the simulation */ + res = MSG_main(); /* - Run the simulation */ XBT_INFO("Simulation time %g", MSG_get_clock()); return res != MSG_OK; diff --git a/examples/msg/trace-categories/trace-categories.c b/examples/msg/trace-categories/trace-categories.c index 7f639f2a02..3030c3a9e2 100644 --- a/examples/msg/trace-categories/trace-categories.c +++ b/examples/msg/trace-categories/trace-categories.c @@ -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. */ -/** @addtogroup MSG_examples - * - * - Setting Categories: trace-categories/trace-categories.c. 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: --cfg=tracing:yes, --cfg=tracing/categorized:yes, --cfg=tracing/uncategorized:yes, - * --cfg=viva/categorized:viva_cat.plist, and --cfg=viva/uncategorized:viva_uncat.plist. - */ - #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; - //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"); @@ -74,7 +64,7 @@ int main(int argc, char *argv[]) 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 diff --git a/examples/msg/trace-platform/trace-platform.c b/examples/msg/trace-platform/trace-platform.c index 0ca692d511..c3a06007a8 100644 --- a/examples/msg/trace-platform/trace-platform.c +++ b/examples/msg/trace-platform/trace-platform.c @@ -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. */ -/** @addtogroup MSG_examples - * - * - Tracing the platform: trace-platform/trace-platform.c. 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: --cfg=tracing:yes and --cfg=tracing/categorized:yes. - */ - #include "simgrid/msg.h" int main(int argc, char *argv[]) diff --git a/examples/msg/trace-simple/trace-simple.c b/examples/msg/trace-simple/trace-simple.c index b735435f84..a53e51fb15 100644 --- a/examples/msg/trace-simple/trace-simple.c +++ b/examples/msg/trace-simple/trace-simple.c @@ -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" -/** @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. - * - Basic example: trace-simple/trace-simple.c. In this very simple program, each process creates, executes, - * and destroy a task. You might want to run it with the --cfg=tracing/uncategorized:yes option. - */ - static int simple_func(int argc, char *argv[]) { msg_task_t task = MSG_task_create("task", 100, 0, NULL); -- 2.20.1