Bug #1062: Fix linking errors by moving definition of userDrivenMode to machine-commo...
[charm.git] / src / ck-ldb / LBAgent.h
blobd8eabcf032a7007188cb57a694893e2ec96112e1
1 /***********************************
2 * Author : Amit Sharma
3 * Date : 12/04/2004
4 ************************************/
6 #ifndef _AGENT_H
7 #define _AGENT_H
9 #include "CentralLB.h"
10 #include "topology.h"
12 class Agent {
13 public:
14 int npes;
16 typedef struct _Elem {
17 int pe;
18 double Cost;
19 _Elem(): pe(-1), Cost(-1.0) {}
20 }Elem;
22 Elem *preferred_list;
24 //public:
25 Agent(int p): npes(p) { }
26 virtual ~Agent() { }
28 virtual Elem* my_preferred_procs(int *existing_map,int object,int *trialpes,int metric){ return NULL; }
31 class TopologyAgent : public Agent {
32 //protected:
33 public:
34 CentralLB::LDStats* stats;
35 LBTopology *topo;
37 int **commObjs;
38 int **hopCount;
39 //public:
40 TopologyAgent(CentralLB::LDStats* lbDB,int p);
41 ~TopologyAgent() { }
42 Agent::Elem* my_preferred_procs(int *existing_map,int object,int *trialpes,int metric);
43 static int compare(const void *p,const void *q);
46 class comlibAgent : public Agent {
47 protected:
48 void* comlibstats;
49 public:
50 comlibAgent(int p): Agent(p) { }
51 ~comlibAgent() { }
53 Agent::Elem* my_preferred_procs(int *existing_map,int object,int *trialpes,int metric);
57 class MulticastAgent : public Agent {
58 protected:
59 struct MInfo {
60 int nbytes;
61 int messages;
62 CkVec<int> objs;
63 MInfo(): nbytes(0), messages(0) {}
64 MInfo(int b, int n): nbytes(b), messages(n) {}
66 CkVec<MInfo> mcastList;
67 CkVec<int> *objmap; // list of mcast involved for every object
68 int nobj;
69 public:
70 MulticastAgent(BaseLB::LDStats* lbDB, int p);
71 virtual ~MulticastAgent() { delete [] objmap; }
73 virtual Elem* my_preferred_procs(int *existing_map,int object,int *trialpes,int metric);
77 #endif