grapes / include / scheduler_common.h @ 15130e4f
History | View | Annotate | Download (736 Bytes)
1 |
#ifndef SCHEDULER_COMMON_H
|
---|---|
2 |
#define SCHEDULER_COMMON_H
|
3 |
|
4 |
/**
|
5 |
* @file scheduler_common.h
|
6 |
* @brief Common definitions for the scheduler
|
7 |
*
|
8 |
*/
|
9 |
|
10 |
|
11 |
#include <stdlib.h> |
12 |
|
13 |
|
14 |
/**
|
15 |
* peer and chunk identifiers used for scheduling
|
16 |
*/
|
17 |
typedef struct nodeID *schedPeerID ; |
18 |
typedef struct chunk* schedChunkID ; |
19 |
|
20 |
/**
|
21 |
* peer-chunk pair, the "atomic unit" of scheduling
|
22 |
*/
|
23 |
struct PeerChunk {
|
24 |
schedPeerID peer; |
25 |
schedChunkID chunk; |
26 |
}; |
27 |
|
28 |
/**
|
29 |
* Comodity function to convert peer and chunk lists to list of peer-chunk pairs
|
30 |
*/
|
31 |
void toPairs(schedPeerID *peers, size_t peers_len, schedChunkID *chunks, size_t chunks_len, //in |
32 |
struct PeerChunk *pairs, size_t *pairs_len); //out, inout |
33 |
|
34 |
#endif /* SCHEDULER_COMMON_H */ |