--- trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/01/16 21:51:51 951 +++ trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/04/12 20:32:20 1097 @@ -1,3 +1,4 @@ +#define _LARGEFILE_SOURCE64 #define _FILE_OFFSET_BITS 64 #include @@ -95,11 +96,6 @@ void DumpWriter::sortByGlobalIndex(){ indexArray.push_back(make_pair(i, atoms[i]->getGlobalIndex())); sort(indexArray.begin(), indexArray.end(), indexSortingCriterion); - - //for (int i = 0; i < mpiSim->getMyNlocal(); i++) { - // printf("node %d has global %d at local %d\n", worldRank, indexArray[i].second, indexArray[i].first); - //} - } #endif @@ -110,10 +106,8 @@ void DumpWriter::writeDump(double currentTime){ vector fileStreams; #ifdef IS_MPI - printf("Hello from node %d\n", worldRank); - sortByGlobalIndex(); if(worldRank == 0 ){ - +#endif finalOut.open( entry_plug->finalName, ios::out | ios::trunc ); if( !finalOut ){ sprintf( painCave.errMsg, @@ -122,6 +116,7 @@ void DumpWriter::writeDump(double currentTime){ painCave.isFatal = 1; simError(); } +#ifdef IS_MPI } #endif // is_mpi @@ -232,7 +227,7 @@ void DumpWriter::writeFrame( vector& outFil int nAtoms = entry_plug->n_atoms; #endif //is_mpi - double q[4]; + double q[4], ji[3]; DirectionalAtom* dAtom; Atom** atoms = entry_plug->atoms; double pos[3], vel[3]; @@ -279,6 +274,7 @@ void DumpWriter::writeFrame( vector& outFil dAtom = (DirectionalAtom *)atoms[i]; dAtom->getQ( q ); + dAtom->getJ( ji ); sprintf( tempBuffer, "%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n", @@ -286,9 +282,9 @@ void DumpWriter::writeFrame( vector& outFil q[1], q[2], q[3], - dAtom->getJx(), - dAtom->getJy(), - dAtom->getJz()); + ji[0], + ji[1], + ji[2]); strcat( writeLine, tempBuffer ); } else @@ -395,15 +391,7 @@ void DumpWriter::writeFrame( vector& outFil haveError = 0; which_atom = i; - - //local_index = -1; - - //for (j=0; (jgetMyNlocal()) && (local_index < 0); j++) { - // if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; - //} - //if (local_index != -1) { - local_index = indexArray[currentIndex].first; if (which_atom == indexArray[currentIndex].second) { @@ -429,6 +417,7 @@ void DumpWriter::writeFrame( vector& outFil dAtom = (DirectionalAtom *)atoms[local_index]; dAtom->getQ( q ); + dAtom->getJ( ji ); for (int j = 0; j < 6 ; j++) atomData13[j] = atomData6[j]; @@ -438,9 +427,9 @@ void DumpWriter::writeFrame( vector& outFil atomData13[8] = q[2]; atomData13[9] = q[3]; - atomData13[10] = dAtom->getJx(); - atomData13[11] = dAtom->getJy(); - atomData13[12] = dAtom->getJz(); + atomData13[10] = ji[0]; + atomData13[11] = ji[1]; + atomData13[12] = ji[2]; } } else { @@ -532,14 +521,6 @@ void DumpWriter::writeFrame( vector& outFil } which_atom = i; - //local_index = -1; - - //for (j=0; (jgetMyNlocal()) && (local_index < 0); j++) { - // if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; - //} - - //if (local_index != -1) { - local_index = indexArray[currentIndex].first; if (which_atom == indexArray[currentIndex].second) { @@ -565,6 +546,7 @@ void DumpWriter::writeFrame( vector& outFil dAtom = (DirectionalAtom *)atoms[local_index]; dAtom->getQ( q ); + dAtom->getJ( ji ); for (int j = 0; j < 6 ; j++) atomData13[j] = atomData6[j]; @@ -574,9 +556,9 @@ void DumpWriter::writeFrame( vector& outFil atomData13[8] = q[2]; atomData13[9] = q[3]; - atomData13[10] = dAtom->getJx(); - atomData13[11] = dAtom->getJy(); - atomData13[12] = dAtom->getJz(); + atomData13[10] = ji[0]; + atomData13[11] = ji[1]; + atomData13[12] = ji[2]; } } else {