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

Detailed Description

Definition at line 213 of file ReductionMgr.h.


Constructor & Destructor Documentation

ReductionSet::ReductionSet ( int  setID,
int  size,
int  numChildren 
)

Definition at line 57 of file ReductionMgr.C.

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

00057                                                                {
00058   if ( setID == REDUCTIONS_BASIC || setID == REDUCTIONS_AMD ) {
00059     if ( size != -1 ) {
00060       NAMD_bug("ReductionSet size specified for REDUCTIONS_BASIC or REDUCTIONS_AMD.");
00061     }
00062     size = REDUCTION_MAX_RESERVED;
00063   }
00064   if ( size == -1 ) NAMD_bug("ReductionSet size not specified.");
00065   dataSize = size;
00066   reductionSetID = setID;
00067   nextSequenceNumber = 0;
00068   submitsRegistered = 0;
00069   dataQueue = 0;
00070   requireRegistered = 0;
00071   threadIsWaiting = 0;
00072   addToRemoteSequenceNumber = new int[numChildren];
00073 }

ReductionSet::~ReductionSet (  ) 

Definition at line 75 of file ReductionMgr.C.

References addToRemoteSequenceNumber, dataQueue, ReductionSetData::next, and next().

00075                             {
00076 
00077   ReductionSetData *current = dataQueue;
00078 
00079   while ( current ) {
00080     ReductionSetData *next = current->next;
00081     delete current;
00082     current = next;
00083   }
00084   delete [] addToRemoteSequenceNumber;
00085 }


Member Function Documentation

ReductionSetData * ReductionSet::getData ( int  seqNum  ) 

Definition at line 88 of file ReductionMgr.C.

References dataQueue, and dataSize.

00088                                                   {
00089 
00090   ReductionSetData **current = &dataQueue;
00091 
00092   while ( *current ) {
00093     if ( (*current)->sequenceNumber == seqNum ) return *current;
00094     current = &((*current)->next);
00095   }
00096 
00097 //iout << "seq " << seqNum << " created on " << CkMyPe() << "\n" << endi;
00098   *current = new ReductionSetData(seqNum, dataSize);
00099   return *current;
00100 }

ReductionSetData * ReductionSet::removeData ( int  seqNum  ) 

Definition at line 103 of file ReductionMgr.C.

References dataQueue, NAMD_die(), and ReductionSetData::next.

00103                                                      {
00104 
00105   ReductionSetData **current = &dataQueue;
00106 
00107   while ( *current ) {
00108     if ( (*current)->sequenceNumber == seqNum ) break;
00109     current = &((*current)->next);
00110   }
00111 
00112   if ( ! *current ) { NAMD_die("ReductionSet::removeData on missing seqNum"); }
00113 
00114   ReductionSetData *toremove = *current;
00115   *current = (*current)->next;
00116   return toremove;
00117 }


Member Data Documentation

Definition at line 228 of file ReductionMgr.h.

Referenced by ReductionSet(), and ~ReductionSet().

Definition at line 219 of file ReductionMgr.h.

Referenced by getData(), ReductionSet(), removeData(), and ~ReductionSet().

Definition at line 218 of file ReductionMgr.h.

Referenced by getData(), and ReductionSet().

Definition at line 216 of file ReductionMgr.h.

Referenced by ReductionSet().

Definition at line 215 of file ReductionMgr.h.

Referenced by ReductionSet().

Definition at line 222 of file ReductionMgr.h.

Referenced by ReductionSet().

Definition at line 217 of file ReductionMgr.h.

Referenced by ReductionSet().

Definition at line 223 of file ReductionMgr.h.

Referenced by ReductionSet().

Definition at line 224 of file ReductionMgr.h.

Definition at line 225 of file ReductionMgr.h.


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

Generated on 8 Dec 2019 for NAMD by  doxygen 1.6.1