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

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.

35 : seq(-10) { ; }

Member Function Documentation

int CollectProxyVectorInstance::append ( CollectVectorVarMsg msg)
inline

Definition at line 51 of file ParallelIOMgr.C.

References CollectVectorVarMsg::aid, CollectVectorVarMsg::BothValid, CollectVectorVarMsg::data, CollectVectorVarMsg::fdata, CollectVectorVarMsg::FloatVectorValid, NAMD_bug(), CollectVectorVarMsg::seq, CollectVectorVarMsg::size, CollectVectorVarMsg::status, and CollectVectorVarMsg::VectorValid.

52  {
53  if ( msg->status != vstatus ) {
54  NAMD_bug("CollectProxyVectorInstance vstatus mismatch");
55  }
56  if ( msg->seq != seq ) {
57  NAMD_bug("CollectProxyVectorInstance seq mismatch");
58  }
59  int size = msg->size;
60  for( int i = 0; i < size; ++i ) { aid.add(msg->aid[i]); }
63  for( int i = 0; i < size; ++i ) { data.add(msg->data[i]); }
64  }
67  for( int i = 0; i < size; ++i ) { fdata.add(msg->fdata[i]); }
68  }
69  const int atoms_per_message_target = 100000;
70  return ( ! --remaining || aid.size() > atoms_per_message_target );
71  }
CollectVectorVarMsg::DataStatus vstatus
void NAMD_bug(const char *err_msg)
Definition: common.C:123
int add(const Elem &elem)
Definition: ResizeArray.h:97
ResizeArray< FloatVector > fdata
ResizeArray< Vector > data
int size(void) const
Definition: ResizeArray.h:127
CollectVectorVarMsg* CollectProxyVectorInstance::buildMsg ( )
inline

Definition at line 73 of file ParallelIOMgr.C.

References CollectVectorVarMsg::aid, CollectVectorVarMsg::data, CollectVectorVarMsg::fdata, CollectVectorVarMsg::FloatVectorValid, CollectVectorVarMsg::seq, CollectVectorVarMsg::size, CollectVectorVarMsg::status, and CollectVectorVarMsg::VectorValid.

73  {
74  int numAtoms = aid.size();
76  if ( ! numAtoms ) {
77  msg = 0;
79  msg = new(numAtoms, numAtoms, 0, 0) CollectVectorVarMsg;
80  for(int j=0; j<numAtoms; j++) {
81  msg->aid[j] = aid[j];
82  msg->data[j] = data[j];
83  }
85  msg = new(numAtoms, 0, numAtoms, 0) CollectVectorVarMsg;
86  for(int j=0; j<numAtoms; j++) {
87  msg->aid[j] = aid[j];
88  msg->fdata[j] = fdata[j];
89  }
90  } else {
91  msg = new(numAtoms, numAtoms, numAtoms, 0) CollectVectorVarMsg;
92  for(int j=0; j<numAtoms; j++) {
93  msg->aid[j] = aid[j];
94  msg->data[j] = data[j];
95  msg->fdata[j] = fdata[j];
96  }
97  }
98  if ( msg ) {
99  msg->seq = seq;
100  msg->size = numAtoms;
101  msg->status = vstatus;
102  }
103  if ( remaining ) reset(seq,vstatus,remaining);
104  else free();
105  return msg;
106  }
CollectVectorVarMsg::DataStatus vstatus
ResizeArray< FloatVector > fdata
ResizeArray< Vector > data
int size(void) const
Definition: ResizeArray.h:127
void reset(int s, CollectVectorVarMsg::DataStatus v, int numClients)
Definition: ParallelIOMgr.C:40
void CollectProxyVectorInstance::free ( )
inline

Definition at line 37 of file ParallelIOMgr.C.

37 { seq = -10; }
int CollectProxyVectorInstance::notfree ( )
inline

Definition at line 38 of file ParallelIOMgr.C.

Referenced by CollectProxyVectorSequence::submitData().

38 { return ( seq != -10 ); }
void CollectProxyVectorInstance::reset ( int  s,
CollectVectorVarMsg::DataStatus  v,
int  numClients 
)
inline

Definition at line 40 of file ParallelIOMgr.C.

References NAMD_bug().

Referenced by CollectProxyVectorSequence::submitData().

40  {
41  if ( s == -10 ) NAMD_bug("seq == free in CollectionMgr");
42  seq = s;
43  vstatus = v;
44  remaining = numClients;
45  aid.resize(0);
46  data.resize(0);
47  fdata.resize(0);
48  }
CollectVectorVarMsg::DataStatus vstatus
void NAMD_bug(const char *err_msg)
Definition: common.C:123
void resize(int i)
Definition: ResizeArray.h:84
ResizeArray< FloatVector > fdata
ResizeArray< Vector > data

Member Data Documentation

AtomIDList CollectProxyVectorInstance::aid

Definition at line 109 of file ParallelIOMgr.C.

ResizeArray<Vector> CollectProxyVectorInstance::data

Definition at line 111 of file ParallelIOMgr.C.

ResizeArray<FloatVector> CollectProxyVectorInstance::fdata

Definition at line 112 of file ParallelIOMgr.C.

int CollectProxyVectorInstance::seq

Definition at line 108 of file ParallelIOMgr.C.

Referenced by CollectProxyVectorSequence::submitData().

CollectVectorVarMsg::DataStatus CollectProxyVectorInstance::vstatus

Definition at line 110 of file ParallelIOMgr.C.


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