1 /* Copyright (c) 2007-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. */
10 #include "simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid/msg.h */
11 #include "xbt/sysdep.h" /* calloc */
13 /* Create a log channel to have nice outputs. */
15 #include "xbt/asserts.h"
19 #include "broadcaster.h"
22 /** @addtogroup MSG_examples
24 * - <b>chainsend/chainsend.c: Chainsend implementation</b>.
28 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_chainsend,
29 "Messages specific for chainsend");
35 /* Initialization stuff */
36 msg_error_t test_all(const char *platform_file,
37 const char *application_file);
41 msg_error_t test_all(const char *platform_file,
42 const char *application_file)
45 msg_error_t res = MSG_OK;
47 XBT_DEBUG("test_all");
49 /* Simulation setting */
50 MSG_create_environment(platform_file);
52 /* Trace categories */
53 TRACE_category_with_color("host0", "0 0 1");
54 TRACE_category_with_color("host1", "0 1 0");
55 TRACE_category_with_color("host2", "0 1 1");
56 TRACE_category_with_color("host3", "1 0 0");
57 TRACE_category_with_color("host4", "1 0 1");
58 TRACE_category_with_color("host5", "0 0 0");
59 TRACE_category_with_color("host6", "1 1 0");
60 TRACE_category_with_color("host7", "1 1 1");
61 TRACE_category_with_color("host8", "0 1 0");
63 /* Application deployment */
64 MSG_function_register("broadcaster", broadcaster);
65 MSG_function_register("peer", peer);
67 MSG_launch_application(application_file);
72 } /* end_of_test_all */
76 int main(int argc, char *argv[])
78 msg_error_t res = MSG_OK;
81 unsigned int prev_exponent_format =
82 _set_output_format(_TWO_DIGIT_EXPONENT);
85 MSG_init(&argc, argv);
87 res = test_all(argv[1], argv[2]);
89 XBT_INFO("Total simulation time: %e", MSG_get_clock());
92 _set_output_format(prev_exponent_format);