Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix dependency issue to prevent problems with make -jx
[simgrid.git] / teshsuite / msg / app-chainsend / chainsend.c
1 /* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include "broadcaster.h"
8 #include "iterator.h"
9 #include "messages.h"
10 #include "peer.h"
11 #include "simgrid/msg.h"
12
13 /** @addtogroup MSG_examples
14  *
15  *  - <b>chainsend: MSG implementation of a file broadcasting system, similar to Kastafior (from Kadeploy).</b>.
16  */
17
18 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_chainsend, "Messages specific for chainsend");
19
20 int main(int argc, char* argv[])
21 {
22   MSG_init(&argc, argv);
23
24   MSG_create_environment(argv[1]);
25
26   /* Trace categories */
27   TRACE_category_with_color("host0", "0 0 1");
28   TRACE_category_with_color("host1", "0 1 0");
29   TRACE_category_with_color("host2", "0 1 1");
30   TRACE_category_with_color("host3", "1 0 0");
31   TRACE_category_with_color("host4", "1 0 1");
32   TRACE_category_with_color("host5", "0 0 0");
33   TRACE_category_with_color("host6", "1 1 0");
34   TRACE_category_with_color("host7", "1 1 1");
35   TRACE_category_with_color("host8", "0 1 0");
36
37   /*   Application deployment */
38   MSG_function_register("broadcaster", broadcaster);
39   MSG_function_register("peer", peer);
40
41   MSG_launch_application(argv[2]);
42
43   msg_error_t res = MSG_main();
44
45   XBT_INFO("Total simulation time: %e", MSG_get_clock());
46
47   return res != MSG_OK;
48 }