CollectProxyVectorInstance Class Reference

List of all members.

Public Member Functions

 CollectProxyVectorInstance ()
void free ()
int notfree ()
void reset (int s, CollectVectorVarMsg::DataStatus v, int numClients)
int append (CollectVectorVarMsg *msg)
CollectVectorVarMsgbuildMsg ()

Public Attributes

int seq
AtomIDList aid
CollectVectorVarMsg::DataStatus vstatus
ResizeArray< Vectordata
ResizeArray< FloatVectorfdata

Detailed Description

Definition at line 32 of file ParallelIOMgr.C.


Constructor & Destructor Documentation

CollectProxyVectorInstance::CollectProxyVectorInstance (  )  [inline]

Definition at line 35 of file ParallelIOMgr.C.

00035 : seq(-10) { ; }


Member Function Documentation

int CollectProxyVectorInstance::append ( CollectVectorVarMsg msg  )  [inline]

Definition at line 51 of file ParallelIOMgr.C.

References ResizeArray< Elem >::add(), CollectVectorVarMsg::aid, aid, CollectVectorVarMsg::BothValid, CollectVectorVarMsg::data, data, CollectVectorVarMsg::fdata, fdata, CollectVectorVarMsg::FloatVectorValid, NAMD_bug(), seq, CollectVectorVarMsg::seq, ResizeArray< Elem >::size(), CollectVectorVarMsg::size, CollectVectorVarMsg::status, CollectVectorVarMsg::VectorValid, and vstatus.

00052     {
00053       if ( msg->status != vstatus ) {
00054         NAMD_bug("CollectProxyVectorInstance vstatus mismatch");
00055       }
00056       if ( msg->seq != seq ) {
00057         NAMD_bug("CollectProxyVectorInstance seq mismatch");
00058       }
00059       int size = msg->size;
00060       for( int i = 0; i < size; ++i ) { aid.add(msg->aid[i]); }
00061       if ( vstatus == CollectVectorVarMsg::VectorValid ||
00062            vstatus == CollectVectorVarMsg::BothValid ) {
00063         for( int i = 0; i < size; ++i ) { data.add(msg->data[i]); }
00064       }
00065       if ( vstatus == CollectVectorVarMsg::FloatVectorValid ||
00066            vstatus == CollectVectorVarMsg::BothValid ) {
00067         for( int i = 0; i < size; ++i ) { fdata.add(msg->fdata[i]); } 
00068       }
00069       const int atoms_per_message_target = 100000;
00070       return ( ! --remaining || aid.size() > atoms_per_message_target );
00071     }

CollectVectorVarMsg* CollectProxyVectorInstance::buildMsg (  )  [inline]

Definition at line 73 of file ParallelIOMgr.C.

References CollectVectorVarMsg::aid, aid, data, CollectVectorVarMsg::data, fdata, CollectVectorVarMsg::fdata, CollectVectorVarMsg::FloatVectorValid, free(), j, reset(), seq, CollectVectorVarMsg::seq, CollectVectorVarMsg::size, ResizeArray< Elem >::size(), CollectVectorVarMsg::status, CollectVectorVarMsg::VectorValid, and vstatus.

00073                                     {
00074       int numAtoms = aid.size();
00075       CollectVectorVarMsg *msg;
00076       if ( ! numAtoms ) {
00077         msg = 0;
00078       } else if ( vstatus == CollectVectorVarMsg::VectorValid) {
00079         msg = new(numAtoms, numAtoms, 0, 0) CollectVectorVarMsg;
00080         for(int j=0; j<numAtoms; j++) {
00081           msg->aid[j] = aid[j];
00082           msg->data[j] = data[j];
00083         }
00084       } else if (vstatus == CollectVectorVarMsg::FloatVectorValid) {
00085         msg = new(numAtoms, 0, numAtoms, 0) CollectVectorVarMsg;
00086         for(int j=0; j<numAtoms; j++) {
00087           msg->aid[j] = aid[j];
00088           msg->fdata[j] = fdata[j];
00089         }
00090       } else {
00091         msg = new(numAtoms, numAtoms, numAtoms, 0) CollectVectorVarMsg;
00092         for(int j=0; j<numAtoms; j++) {
00093           msg->aid[j] = aid[j];
00094           msg->data[j] = data[j];
00095           msg->fdata[j] = fdata[j];
00096         }
00097       }
00098       if ( msg ) {
00099         msg->seq = seq;
00100         msg->size = numAtoms;
00101         msg->status = vstatus;
00102       }
00103       if ( remaining ) reset(seq,vstatus,remaining);
00104       else free();
00105       return msg;
00106     }

void CollectProxyVectorInstance::free (  )  [inline]

Definition at line 37 of file ParallelIOMgr.C.

References seq.

Referenced by buildMsg().

00037 { seq = -10; }

int CollectProxyVectorInstance::notfree (  )  [inline]

Definition at line 38 of file ParallelIOMgr.C.

References seq.

Referenced by CollectProxyVectorSequence::submitData().

00038 { return ( seq != -10 ); }

void CollectProxyVectorInstance::reset ( int  s,
CollectVectorVarMsg::DataStatus  v,
int  numClients 
) [inline]

Definition at line 40 of file ParallelIOMgr.C.

References aid, data, fdata, NAMD_bug(), ResizeArray< Elem >::resize(), seq, and vstatus.

Referenced by buildMsg().

00040                                                                        {
00041       if ( s == -10 ) NAMD_bug("seq == free in CollectionMgr");
00042       seq = s;
00043       vstatus = v;
00044       remaining = numClients;
00045       aid.resize(0);
00046       data.resize(0);
00047       fdata.resize(0);
00048     }


Member Data Documentation

Definition at line 109 of file ParallelIOMgr.C.

Referenced by append(), buildMsg(), and reset().

Definition at line 111 of file ParallelIOMgr.C.

Referenced by append(), buildMsg(), and reset().

Definition at line 112 of file ParallelIOMgr.C.

Referenced by append(), buildMsg(), and reset().

Definition at line 110 of file ParallelIOMgr.C.

Referenced by append(), buildMsg(), and reset().


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

Generated on 21 Sep 2020 for NAMD by  doxygen 1.6.1