File: chainsend.h

package info (click to toggle)
simgrid 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,192 kB
  • sloc: cpp: 124,913; ansic: 66,744; python: 8,560; java: 6,773; fortran: 6,079; f90: 5,123; xml: 4,587; sh: 2,194; perl: 1,436; makefile: 111; lisp: 49; javascript: 7; sed: 6
file content (64 lines) | stat: -rw-r--r-- 1,614 bytes parent folder | download | duplicates (2)
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 */