1 /* Copyright (c) 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"
11 #include "xbt/dynar.h"
16 #define PEER_SHUTDOWN_DEADLINE 60000
19 typedef struct s_peer {
25 unsigned long long bytes;
26 xbt_dynar_t pending_recvs;
27 xbt_dynar_t pending_sends;
28 unsigned int total_pieces;
30 typedef s_peer_t* peer_t;
32 /* Peer: helper functions */
33 msg_error_t peer_wait_for_message(peer_t peer);
34 int peer_execute_task(peer_t peer, msg_task_t task);
35 void peer_init_chain(peer_t peer, message_t msg);
36 void peer_delete(peer_t p);
37 void peer_shutdown(peer_t p);
38 void peer_init(peer_t p, int argc, char* argv[]);
39 void peer_print_stats(peer_t p, float elapsed_time);
41 int peer(int argc, char* argv[]);