2 #ifndef _COMMAWARELB_H_
3 #define _COMMAWARELB_H_
6 #include "TempAwareCommLB.decl.h"
8 void CreateTempAwareCommLB();
9 BaseLB
* AllocateTempAwareCommLB();
11 class TempAwareCommLB
: public CBase_TempAwareCommLB
{
12 friend void printCurrentTemperature(void *LB
, double curWallTime
);
20 void populateEffectiveFreq(int numProcs
);
21 void convertToInsts();
22 int procsPerNode
,*freqsEffect
,*procFreq
,*procFreqEffect
,*procFreqNewEffect
,*procFreqNew
,numProcs
,coresPerChip
,*freqs
,numAvailFreqs
;
23 int numChips
,*procFreqPtr
;
24 void initStructs(LDStats
*s
);
29 float *procTemp
,*avgChipTemp
;
30 TempAwareCommLB(const CkLBOptions
&);
31 TempAwareCommLB(CkMigrateMessage
*m
):CBase_TempAwareCommLB(m
) {
32 lbname
= "TempAwareCommLB";
34 void work(LDStats
* stats
);
36 class ProcLoadGreater
;
40 class ProcCommGreater
;
44 enum HeapCmp
{GT
= '>', LT
= '<'};
45 void Heapify(HeapData
*, int, int, HeapCmp
);
46 void HeapSort(HeapData
*, int, HeapCmp
);
47 void BuildHeap(HeapData
*, int, HeapCmp
);
48 bool Compare(double, double, HeapCmp
);
49 HeapData
* BuildCpuArray(BaseLB::LDStats
*, int, int *);
50 HeapData
* BuildObjectArray(BaseLB::LDStats
*, int, int *);
51 bool QueryBalanceNow(int step
);
54 #endif /* _COMMAWARELB_H_ */