X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6d7f851f116cff677f5d5cb009aa493a7510780c..bd08f5fb99eea01833b2b83730a0732443da8d38:/examples/msg/chainsend/peer.h diff --git a/examples/msg/chainsend/peer.h b/examples/msg/chainsend/peer.h index a5d99d362e..71306b1b82 100644 --- a/examples/msg/chainsend/peer.h +++ b/examples/msg/chainsend/peer.h @@ -1,7 +1,13 @@ +/* Copyright (c) 2012-2015. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #ifndef KADEPLOY_PEER_H #define KADEPLOY_PEER_H -#include "msg/msg.h" +#include "simgrid/msg.h" #include "xbt/sysdep.h" #include "messages.h" @@ -12,20 +18,24 @@ /* Peer struct */ typedef struct s_peer { int init; - const char *prev; - const char *next; + char *prev; + char *next; char *me; int pieces; + unsigned long long bytes; + xbt_dynar_t pending_recvs; xbt_dynar_t pending_sends; - int close_asap; /* TODO: unused */ + unsigned int total_pieces; } s_peer_t, *peer_t; /* Peer: helper functions */ msg_error_t peer_wait_for_message(peer_t peer); int peer_execute_task(peer_t peer, msg_task_t task); void peer_init_chain(peer_t peer, message_t msg); +void peer_delete(peer_t p); void peer_shutdown(peer_t p); void peer_init(peer_t p, int argc, char *argv[]); +void peer_print_stats(peer_t p, float elapsed_time); int peer(int argc, char *argv[]);