1 /* Copyright (c) 2010, 2012-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "simgrid/msg.h"
9 /** @addtogroup MSG_examples
11 * @section msg_ex_tracing Tracing and visualization features
12 * Tracing can be activated by various configuration options which are illustrated in these example.
13 * See \ref tracing_tracing_options for details.
14 * - <b>Basic example: trace-simple/trace-simple.c</b>. In this very simple program, each process creates, executes,
15 * and destroy a task. You might want to run it with the <i>--cfg=tracing/uncategorized:yes</i> option.
18 static int simple_func(int argc, char *argv[])
20 msg_task_t task = MSG_task_create("task", 100, 0, NULL);
21 MSG_task_execute (task);
22 MSG_task_destroy (task);
26 int main(int argc, char *argv[])
28 MSG_init(&argc, argv);
29 xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
31 MSG_create_environment(argv[1]);
32 MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Tremblay"));
33 MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Fafard"));