-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharmHpccg.h
54 lines (45 loc) · 1.14 KB
/
charmHpccg.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
47
48
49
50
51
52
53
54
#if !defined(CHARM_HPCCG)
#define CHARM_HPCCG
#include "HPCCG.hpp"
#include <string>
#include <map>
#include <vector>
#include <iostream>
#include <pup_stl.h>
#include "completion.h"
#include "charmHpccg.decl.h"
/*readonly*/ extern int numChares;
/*readonly*/ extern CProxy_CompletionDetector detector;
/*readonly*/ extern CProxy_charmMain mainProxy;
struct RemoteX {
std::vector<int> rows, values;
int offset;
RemoteX() : offset(-1) { }
RemoteX(std::vector<int> values_, int offset_)
: values(values_)
, offset(offset_) { }
};
class charmHpccg : public CBase_charmHpccg {
public:
charmHpccg() { __sdag_init(); }
charmHpccg(CkMigrateMessage*) { }
void findExternals();
void needXElements(int requester, std::vector<int> rows);
protected:
HPC_Sparse_Matrix* A;
double *x, *b, *xexact;
std::map<int, RemoteX> xToReceive, xToSend; // chare index -> rows of x
double *r, *p, *Ap;
double normr, rtrans;
int xMessagesReceived;
int iteration;
charmHpccg_SDAG_CODE
};
class charmMain : public CBase_charmMain {
public:
charmMain(CkArgMsg* msg);
private:
CProxy_charmHpccg array;
charmMain_SDAG_CODE
};
#endif /*CHARM_HPCCG*/