Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ReductionSet Class Reference

#include <ReductionMgr.h>

List of all members.

Public Member Functions

ReductionSetDatagetData (int seqNum)
ReductionSetDataremoveData (int seqNum)
 ReductionSet (int setID, int size, int numChildren)
 ~ReductionSet ()

Public Attributes

int reductionSetID
int nextSequenceNumber
int submitsRegistered
int dataSize
ReductionSetDatadataQueue
int requireRegistered
int threadIsWaiting
int waitingForSequenceNumber
CthThread waitingThread
int * addToRemoteSequenceNumber


Constructor & Destructor Documentation

ReductionSet::ReductionSet int  setID,
int  size,
int  numChildren
 

Definition at line 77 of file ReductionMgr.C.

References addToRemoteSequenceNumber, dataQueue, dataSize, NAMD_bug(), nextSequenceNumber, reductionSetID, requireRegistered, submitsRegistered, and threadIsWaiting.

00077                                                                {
00078   if ( setID == REDUCTIONS_BASIC ) {
00079     if ( size != -1 ) {
00080       NAMD_bug("ReductionSet size specified for REDUCTIONS_BASIC.");
00081     }
00082     size = REDUCTION_MAX_RESERVED;
00083   }
00084   if ( size == -1 ) NAMD_bug("ReductionSet size not specified.");
00085   dataSize = size;
00086   reductionSetID = setID;
00087   nextSequenceNumber = 0;
00088   submitsRegistered = 0;
00089   dataQueue = 0;
00090   requireRegistered = 0;
00091   threadIsWaiting = 0;
00092   addToRemoteSequenceNumber = new int[numChildren];
00093 }

ReductionSet::~ReductionSet  ) 
 

Definition at line 95 of file ReductionMgr.C.

References ReductionSetData::next.

00095                             {
00096 
00097   ReductionSetData *current = dataQueue;
00098 
00099   while ( current ) {
00100     ReductionSetData *next = current->next;
00101     delete current;
00102     current = next;
00103   }
00104   delete [] addToRemoteSequenceNumber;
00105 }


Member Function Documentation

ReductionSetData * ReductionSet::getData int  seqNum  ) 
 

Definition at line 108 of file ReductionMgr.C.

References dataSize.

Referenced by ReductionMgr::remoteRegister(), ReductionMgr::remoteSubmit(), ReductionMgr::remoteUnregister(), ReductionMgr::willRequire(), and ReductionMgr::willSubmit().

00108                                                   {
00109 
00110   ReductionSetData **current = &dataQueue;
00111 
00112   while ( *current ) {
00113     if ( (*current)->sequenceNumber == seqNum ) return *current;
00114     current = &((*current)->next);
00115   }
00116 
00117 //iout << "seq " << seqNum << " created on " << CkMyPe() << "\n" << endi;
00118   *current = new ReductionSetData(seqNum, dataSize);
00119   return *current;
00120 }

ReductionSetData * ReductionSet::removeData int  seqNum  ) 
 

Definition at line 123 of file ReductionMgr.C.

References NAMD_die(), and ReductionSetData::next.

00123                                                      {
00124 
00125   ReductionSetData **current = &dataQueue;
00126 
00127   while ( *current ) {
00128     if ( (*current)->sequenceNumber == seqNum ) break;
00129     current = &((*current)->next);
00130   }
00131 
00132   if ( ! *current ) { NAMD_die("ReductionSet::removeData on missing seqNum"); }
00133 
00134   ReductionSetData *toremove = *current;
00135   *current = (*current)->next;
00136   return toremove;
00137 }


Member Data Documentation

int* ReductionSet::addToRemoteSequenceNumber
 

Definition at line 201 of file ReductionMgr.h.

Referenced by ReductionSet(), ReductionMgr::remoteRegister(), and ReductionMgr::remoteSubmit().

ReductionSetData* ReductionSet::dataQueue
 

Definition at line 192 of file ReductionMgr.h.

Referenced by ReductionSet().

int ReductionSet::dataSize
 

Definition at line 191 of file ReductionMgr.h.

Referenced by getData(), ReductionSet(), and ReductionMgr::remoteSubmit().

int ReductionSet::nextSequenceNumber
 

Definition at line 189 of file ReductionMgr.h.

Referenced by ReductionSet(), ReductionMgr::remoteRegister(), ReductionMgr::remoteUnregister(), ReductionMgr::willRequire(), and ReductionMgr::willSubmit().

int ReductionSet::reductionSetID
 

Definition at line 188 of file ReductionMgr.h.

Referenced by ReductionSet().

int ReductionSet::requireRegistered
 

Definition at line 195 of file ReductionMgr.h.

Referenced by ReductionSet(), and ReductionMgr::willRequire().

int ReductionSet::submitsRegistered
 

Definition at line 190 of file ReductionMgr.h.

Referenced by ReductionSet(), ReductionMgr::remoteRegister(), ReductionMgr::remoteSubmit(), ReductionMgr::remoteUnregister(), and ReductionMgr::willSubmit().

int ReductionSet::threadIsWaiting
 

Definition at line 196 of file ReductionMgr.h.

Referenced by ReductionSet().

int ReductionSet::waitingForSequenceNumber
 

Definition at line 197 of file ReductionMgr.h.

CthThread ReductionSet::waitingThread
 

Definition at line 198 of file ReductionMgr.h.


The documentation for this class was generated from the following files:
Generated on Tue Nov 24 04:07:51 2009 for NAMD by  doxygen 1.3.9.1