-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcommon.h
46 lines (39 loc) · 1.27 KB
/
common.h
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
#ifndef COMMON_H
#define COMMON_H
#include <gasnet.h>
#include "address_space.h"
#include "alloc.h"
#define GASNET_SAFE(fncall) do { \
int _retval; \
if ((_retval = fncall) != GASNET_OK) { \
fprintf(stderr, "ERROR calling: %s\n" \
" at: %s:%i\n" \
" error: %s (%s)\n", \
#fncall, __FILE__, __LINE__, \
gasnet_ErrorName(_retval), gasnet_ErrorDesc(_retval)); \
fflush(stderr); \
gasnet_exit(_retval); \
exit(_retval); \
} \
} while(0)
struct gassyfs_opts {
int rank0_alloc;
int local_mode;
size_t heap_size;
};
struct NodeAlloc {
NodeAlloc(Node *n) :
node(n), alloc(new Allocator(n->size()))
{}
Node *node;
Allocator *alloc;
};
struct Extent {
// logical
size_t length;
// physical
NodeAlloc *node;
size_t addr;
size_t size;
};
#endif