1 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
2 * Copyright (c) 2012. Maximiliano Geier.
3 * All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "msg/msg.h" /* Yeah! If you want to use msg, you need to include msg/msg.h */
12 #include "xbt/sysdep.h" /* calloc */
14 /* Create a log channel to have nice outputs. */
16 #include "xbt/asserts.h"
20 #include "broadcaster.h"
23 /** @addtogroup MSG_examples
25 * - <b>chainsend/chainsend.c: Chainsend implementation</b>.
29 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_chainsend,
30 "Messages specific for chainsend");
36 /* Initialization stuff */
37 msg_error_t test_all(const char *platform_file,
38 const char *application_file);
42 msg_error_t test_all(const char *platform_file,
43 const char *application_file)
46 msg_error_t res = MSG_OK;
50 XBT_DEBUG("test_all");
52 /* Simulation setting */
53 MSG_create_environment(platform_file);
55 /* Trace categories */
56 TRACE_category_with_color("host0", "0 0 1");
57 TRACE_category_with_color("host1", "0 1 0");
58 TRACE_category_with_color("host2", "0 1 1");
59 TRACE_category_with_color("host3", "1 0 0");
60 TRACE_category_with_color("host4", "1 0 1");
61 TRACE_category_with_color("host5", "0 0 0");
62 TRACE_category_with_color("host6", "1 1 0");
63 TRACE_category_with_color("host7", "1 1 1");
64 TRACE_category_with_color("host8", "0 1 0");
66 /* Application deployment */
67 MSG_function_register("broadcaster", broadcaster);
68 MSG_function_register("peer", peer);
70 MSG_launch_application(application_file);
75 } /* end_of_test_all */
79 int main(int argc, char *argv[])
81 msg_error_t res = MSG_OK;
84 unsigned int prev_exponent_format =
85 _set_output_format(_TWO_DIGIT_EXPONENT);
88 MSG_init(&argc, argv);
91 XBT_CRITICAL("Usage: %s platform_file deployment_file <model>\n",
94 ("example: %s msg_platform.xml msg_deployment.xml KCCFLN05_Vegas\n",
99 /* Options for the workstation/model:
101 KCCFLN05 => for maxmin
102 KCCFLN05_proportional => for proportional (Vegas)
103 KCCFLN05_Vegas => for TCP Vegas
104 KCCFLN05_Reno => for TCP Reno
106 //MSG_config("workstation/model", argv[3]);
108 res = test_all(argv[1], argv[2]);
110 XBT_INFO("Total simulation time: %le", MSG_get_clock());
113 _set_output_format(prev_exponent_format);