1 /* Copyright (c) 2010. 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 that creates, executes and destroy a task
18 /* Create a log channel to have nice outputs. */
20 #include "xbt/asserts.h"
21 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
22 "Messages specific for this msg example");
24 int simple_func(int argc, char *argv[]);
26 /** Emitter function */
27 int simple_func(int argc, char *argv[])
29 m_task_t task = MSG_task_create("task", 100, 0, NULL);
30 MSG_task_execute (task);
31 MSG_task_destroy (task);
36 int main(int argc, char *argv[])
38 MSG_global_init(&argc, argv);
40 printf("Usage: %s platform_file deployment_file\n", argv[0]);
44 char *platform_file = argv[1];
45 char *deployment_file = argv[2];
46 MSG_create_environment(platform_file);
48 MSG_function_register("master", simple_func);
49 MSG_function_register("slave", simple_func);
50 MSG_launch_application(deployment_file);