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)
 ~ReductionSet ()

Public Attributes

int reductionSetID
int nextSequenceNumber
int submitsRegistered
int dataSize
ReductionSetDatadataQueue
int requireRegistered
int threadIsWaiting
int waitingForSequenceNumber
CthThread waitingThread
int addToRemoteSequenceNumber [REDUCTION_MAX_CHILDREN]


Constructor & Destructor Documentation

ReductionSet::ReductionSet int  setID,
int  size
 

Definition at line 77 of file ReductionMgr.C.

References 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 }

ReductionSet::~ReductionSet  ) 
 

Definition at line 94 of file ReductionMgr.C.

References ReductionSetData::next.

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


Member Function Documentation

ReductionSetData * ReductionSet::getData int  seqNum  ) 
 

Definition at line 106 of file ReductionMgr.C.

References dataSize.

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

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

ReductionSetData * ReductionSet::removeData int  seqNum  ) 
 

Definition at line 121 of file ReductionMgr.C.

References NAMD_die(), and ReductionSetData::next.

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


Member Data Documentation

int ReductionSet::addToRemoteSequenceNumber[REDUCTION_MAX_CHILDREN]
 

Definition at line 201 of file ReductionMgr.h.

Referenced by 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 Fri Oct 10 04:07:50 2008 for NAMD by  doxygen 1.3.9.1