NAMD
Public Member Functions | Protected Attributes | List of all members
ProxyUsage Class Reference

#include <Rebalancer.h>

Public Member Functions

 ProxyUsage ()
 
void increment (int pe, int patch)
 
void decrement (int pe, int patch)
 
int getVal (int pe, int patch)
 

Protected Attributes

CkHashtableT< ProxyUsageKey, int > htable
 

Detailed Description

Definition at line 72 of file Rebalancer.h.

Constructor & Destructor Documentation

ProxyUsage::ProxyUsage ( )
inline

Definition at line 78 of file Rebalancer.h.

78 : htable (1217, 0.5) {} //pass in a large prime close to
CkHashtableT< ProxyUsageKey, int > htable
Definition: Rebalancer.h:74

Member Function Documentation

void ProxyUsage::decrement ( int  pe,
int  patch 
)
inline

Definition at line 88 of file Rebalancer.h.

References htable.

Referenced by Rebalancer::deAssign().

88  {
89  ProxyUsageKey pkey (pe, patch);
90 
91  int val = htable.get (pkey);
92  CkAssert (val > 0);
93  val --;
94 
95  if (val == 0)
96  htable.remove (pkey);
97  else
98  htable.put (pkey) = val;
99  }
CkHashtableT< ProxyUsageKey, int > htable
Definition: Rebalancer.h:74
int ProxyUsage::getVal ( int  pe,
int  patch 
)
inline

Definition at line 101 of file Rebalancer.h.

References htable.

Referenced by Rebalancer::deAssign().

101  {
102  ProxyUsageKey pkey (pe, patch);
103  return htable.get (pkey);
104  }
CkHashtableT< ProxyUsageKey, int > htable
Definition: Rebalancer.h:74
void ProxyUsage::increment ( int  pe,
int  patch 
)
inline

Definition at line 81 of file Rebalancer.h.

References htable.

Referenced by Rebalancer::assign(), and Rebalancer::InitProxyUsage().

81  {
82  ProxyUsageKey pkey (pe, patch);
83 
84  int val = htable.get (pkey);
85  htable.put (pkey) = val + 1;
86  }
CkHashtableT< ProxyUsageKey, int > htable
Definition: Rebalancer.h:74

Member Data Documentation

CkHashtableT<ProxyUsageKey, int> ProxyUsage::htable
protected

Definition at line 74 of file Rebalancer.h.

Referenced by decrement(), getVal(), and increment().


The documentation for this class was generated from the following file: