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 vizualisation features
13 * - <b>tracing/simple.c</b> very simple program where each process creates, executes and destroy a task. You might want
14 * to run this program with the following parameters:
15 * --cfg=tracing/uncategorized:yes
16 * (See \ref tracing_tracing_options for details)
19 static int simple_func(int argc, char *argv[])
21 msg_task_t task = MSG_task_create("task", 100, 0, NULL);
22 MSG_task_execute (task);
23 MSG_task_destroy (task);
27 int main(int argc, char *argv[])
29 MSG_init(&argc, argv);
30 xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
32 MSG_create_environment(argv[1]);
33 MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Tremblay"));
34 MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Fafard"));