1 /* Copyright (c) 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. */
7 #ifndef KADEPLOY_BROADCASTER_H
8 #define KADEPLOY_BROADCASTER_H
10 #include "simgrid/msg.h"
11 #include "xbt/sysdep.h"
13 /* Create a log channel to have nice outputs. */
15 #include "xbt/asserts.h"
21 /* Connection parameters */
22 #define MAX_PENDING_SENDS 10
24 /* Default values for the ``file'' details */
25 #define PIECE_SIZE 65536
26 #define PIECE_COUNT 16384
28 /* Broadcaster struct */
29 typedef struct s_broadcaster {
33 xbt_dynar_t host_list;
34 xbt_dynar_iterator_t it;
35 int max_pending_sends;
36 xbt_dynar_t pending_sends;
37 } s_broadcaster_t, *broadcaster_t;
39 xbt_dynar_t build_hostlist_from_hostcount(int hostcount);
41 /* Broadcaster: helper functions */
42 broadcaster_t broadcaster_init(xbt_dynar_t host_list, unsigned int piece_count);
43 int broadcaster_build_chain(broadcaster_t bc);
44 int broadcaster_send_file(broadcaster_t bc);
47 int broadcaster(int argc, char *argv[]);
49 #endif /* KADEPLOY_BROADCASTER_H */