1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
/* Copyright (c) 2012-2025. 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 CHAINSEND_H
#define CHAINSEND_H
#include "simgrid/activity_set.h"
#include "simgrid/actor.h"
#include "simgrid/comm.h"
#include "simgrid/engine.h"
#include "simgrid/host.h"
#include "simgrid/instr.h"
#include "simgrid/mailbox.h"
#include "xbt/log.h"
#include "xbt/str.h"
#include "xbt/sysdep.h"
/* Connection parameters */
#define MAX_PENDING_COMMS 256
#define PIECE_SIZE 65536
#define MESSAGE_BUILD_CHAIN_SIZE 40
#define MESSAGE_SEND_DATA_HEADER_SIZE 1
/* Broadcaster struct */
typedef struct s_broadcaster {
unsigned int host_count;
unsigned int piece_count;
sg_mailbox_t first;
sg_mailbox_t* mailboxes;
sg_activity_set_t pending_sends;
} s_broadcaster_t;
typedef s_broadcaster_t* broadcaster_t;
typedef const s_broadcaster_t* const_broadcaster_t;
void broadcaster(int argc, char* argv[]);
/* Message struct */
typedef struct s_chain_message {
sg_mailbox_t prev_;
sg_mailbox_t next_;
unsigned int num_pieces;
} s_chain_message_t;
typedef s_chain_message_t* chain_message_t;
/* Peer struct */
typedef struct s_peer {
sg_mailbox_t prev;
sg_mailbox_t next;
sg_mailbox_t me;
unsigned long long received_bytes;
unsigned int received_pieces;
unsigned int total_pieces;
sg_activity_set_t pending_recvs;
sg_activity_set_t pending_sends;
} s_peer_t;
typedef s_peer_t* peer_t;
void peer(int argc, char* argv[]);
#endif /* CHAINSEND_H */
|