1 /* Copyright (c) 2010, 2012-2014. 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. */
9 #include "xbt/sysdep.h" /* calloc, printf */
11 /** @addtogroup MSG_examples
13 * @section MSG_ex_tracing Tracing and vizualization features
15 * - <b>tracing/simple.c</b> very simple program where each process creates, executes and
16 * destroy a task. You might want to run this program with the following parameters:
17 * --cfg=tracing/uncategorized:yes
18 * (See \ref tracing_tracing_options for details)
21 /* Create a log channel to have nice outputs. */
23 #include "xbt/asserts.h"
24 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
25 "Messages specific for this msg example");
27 int simple_func(int argc, char *argv[]);
29 /** Emitter function */
30 int simple_func(int argc, char *argv[])
32 msg_task_t task = MSG_task_create("task", 100, 0, NULL);
33 MSG_task_execute (task);
34 MSG_task_destroy (task);
39 int main(int argc, char *argv[])
41 MSG_init(&argc, argv);
43 printf("Usage: %s platform_file deployment_file\n", argv[0]);
47 char *platform_file = argv[1];
48 char *deployment_file = argv[2];
49 MSG_create_environment(platform_file);
51 MSG_function_register("master", simple_func);
52 MSG_function_register("slave", simple_func);
53 MSG_launch_application(deployment_file);