1 /* Copyright (c) 2007-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. */
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;
49 XBT_DEBUG("test_all");
51 /* Simulation setting */
52 MSG_create_environment(platform_file);
54 /* Trace categories */
55 TRACE_category_with_color("host0", "0 0 1");
56 TRACE_category_with_color("host1", "0 1 0");
57 TRACE_category_with_color("host2", "0 1 1");
58 TRACE_category_with_color("host3", "1 0 0");
59 TRACE_category_with_color("host4", "1 0 1");
60 TRACE_category_with_color("host5", "0 0 0");
61 TRACE_category_with_color("host6", "1 1 0");
62 TRACE_category_with_color("host7", "1 1 1");
63 TRACE_category_with_color("host8", "0 1 0");
65 /* Application deployment */
66 MSG_function_register("broadcaster", broadcaster);
67 MSG_function_register("peer", peer);
69 MSG_launch_application(application_file);
74 } /* end_of_test_all */
78 int main(int argc, char *argv[])
80 msg_error_t res = MSG_OK;
83 unsigned int prev_exponent_format =
84 _set_output_format(_TWO_DIGIT_EXPONENT);
87 MSG_init(&argc, argv);
90 XBT_CRITICAL("Usage: %s platform_file deployment_file <model>\n",
93 ("example: %s msg_platform.xml msg_deployment.xml KCCFLN05_Vegas\n",
98 /* Options for the workstation/model:
100 KCCFLN05 => for maxmin
101 KCCFLN05_proportional => for proportional (Vegas)
102 KCCFLN05_Vegas => for TCP Vegas
103 KCCFLN05_Reno => for TCP Reno
105 //MSG_config("workstation/model", argv[3]);
107 res = test_all(argv[1], argv[2]);
109 XBT_INFO("Total simulation time: %e", MSG_get_clock());
112 _set_output_format(prev_exponent_format);