Statistics
| Branch: | Revision:

grapes / include / scheduler_common.h @ master

History | View | Annotate | Download (796 Bytes)

1 4f4e8c34 Luca Abeni
#ifndef SCHEDULER_COMMON_H
2
#define SCHEDULER_COMMON_H
3
4
/**
5
 * @file scheduler_common.h
6 b9e0d721 MarcoBiazzini
 * @brief Common definitions for the scheduler.
7 4f4e8c34 Luca Abeni
 *
8
 */
9
10
11
#include <stdlib.h>
12 0fb056cf Csaba Kiraly
13
14
/**
15 85c4b598 MarcoBiazzini
  * @brief Peer identifier used for scheduling
16 0fb056cf Csaba Kiraly
  */
17 adb39af9 Csaba Kiraly
typedef struct peer *schedPeerID ;
18 85c4b598 MarcoBiazzini
/**
19
  * @brief Chunk identifier used for scheduling
20
  */
21 cedff664 Csaba Kiraly
typedef int schedChunkID ;
22 0fb056cf Csaba Kiraly
23 4f4e8c34 Luca Abeni
/**
24 85c4b598 MarcoBiazzini
  * @brief The peer-chunk pair, the "atomic unit" of scheduling
25 4f4e8c34 Luca Abeni
  */
26
struct PeerChunk {
27 0fb056cf Csaba Kiraly
    schedPeerID  peer;
28
    schedChunkID  chunk;
29 4f4e8c34 Luca Abeni
};
30
31
/**
32 85c4b598 MarcoBiazzini
  * @brief Comodity function to convert peer and chunk lists to list of peer-chunk pairs
33 4f4e8c34 Luca Abeni
  */
34 0fb056cf Csaba Kiraly
void toPairs(schedPeerID  *peers, size_t peers_len, schedChunkID  *chunks, size_t chunks_len,         //in
35 4f4e8c34 Luca Abeni
                     struct PeerChunk *pairs, size_t *pairs_len);        //out, inout
36
37
#endif        /* SCHEDULER_COMMON_H */