ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DumpWriter.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/DumpWriter.cpp (file contents):
Revision 949 by chuckv, Thu Jan 15 21:57:10 2004 UTC vs.
Revision 1000 by tim, Fri Jan 30 21:47:22 2004 UTC

# Line 95 | Line 95 | void DumpWriter::sortByGlobalIndex(){
95      indexArray.push_back(make_pair(i, atoms[i]->getGlobalIndex()));
96    
97    sort(indexArray.begin(), indexArray.end(), indexSortingCriterion);    
98
99  //for (int i = 0; i < mpiSim->getMyNlocal(); i++) {
100  //  printf("node %d has global %d at local %d\n", worldRank, indexArray[i].second, indexArray[i].first);
101  //}
102    
98   }
99  
100   #endif
# Line 110 | Line 105 | void DumpWriter::writeDump(double currentTime){
105    vector<ofstream*> fileStreams;
106  
107   #ifdef IS_MPI
113  printf("Hello from node %d\n", worldRank);
114  sortByGlobalIndex();
108    if(worldRank == 0 ){
109 <    
109 > #endif    
110      finalOut.open( entry_plug->finalName, ios::out | ios::trunc );
111      if( !finalOut ){
112        sprintf( painCave.errMsg,
# Line 122 | Line 115 | void DumpWriter::writeDump(double currentTime){
115        painCave.isFatal = 1;
116        simError();
117      }
118 + #ifdef IS_MPI
119    }
120   #endif // is_mpi
121  
# Line 143 | Line 137 | void DumpWriter::writeFinal(double currentTime){
137  
138   #ifdef IS_MPI
139    if(worldRank == 0 ){
140 + #endif // is_mpi
141  
142      finalOut.open( entry_plug->finalName, ios::out | ios::trunc );
143  
# Line 154 | Line 149 | void DumpWriter::writeFinal(double currentTime){
149        simError();
150      }
151  
152 + #ifdef IS_MPI
153    }
154   #endif // is_mpi
155    
# Line 393 | Line 389 | void DumpWriter::writeFrame( vector<ofstream*>& outFil
389          
390          haveError = 0;
391          which_atom = i;
396        
397        //local_index = -1;
398
399        //for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) {
400        //  if (atoms[j]->getGlobalIndex() == which_atom) local_index = j;
401        //}
392          
403        //if (local_index != -1) {
404          
393            local_index = indexArray[currentIndex].first;        
394            
395            if (which_atom == indexArray[currentIndex].second) {
# Line 530 | Line 518 | void DumpWriter::writeFrame( vector<ofstream*>& outFil
518          }
519          which_atom = i;
520  
533        //local_index = -1;
534
535        //for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) {
536        // if (atoms[j]->getGlobalIndex() == which_atom) local_index = j;
537        //}
538        
539        //if (local_index != -1) {
540
521          local_index = indexArray[currentIndex].first;        
522                  
523          if (which_atom == indexArray[currentIndex].second) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines