--- trunk/src/io/DumpReader.cpp 2005/11/08 13:32:27 721 +++ trunk/src/io/DumpReader.cpp 2006/06/28 14:35:14 996 @@ -71,53 +71,55 @@ namespace oopse { DumpReader::DumpReader(SimInfo* info, const std::string& filename) : info_(info), filename_(filename), isScanned_(false), nframes_(0) { - + #ifdef IS_MPI - - if (worldRank == 0) { + + if (worldRank == 0) { #endif - + inFile_ = new std::ifstream(filename_.c_str()); - - if (inFile_->fail()) { - sprintf(painCave.errMsg, "DumpReader: Cannot open file: %s\n", filename_.c_str()); - painCave.isFatal = 1; - simError(); - } - -#ifdef IS_MPI - + + if (inFile_->fail()) { + sprintf(painCave.errMsg, + "DumpReader: Cannot open file: %s\n", + filename_.c_str()); + painCave.isFatal = 1; + simError(); } - - strcpy(checkPointMsg, "Dump file opened for reading successfully."); - MPIcheckPoint(); - -#endif - - return; + +#ifdef IS_MPI + } - - DumpReader::~DumpReader() { - + + strcpy(checkPointMsg, "Dump file opened for reading successfully."); + MPIcheckPoint(); + +#endif + + return; + } + + DumpReader::~DumpReader() { + #ifdef IS_MPI - + if (worldRank == 0) { #endif - + delete inFile_; - + #ifdef IS_MPI - + } - + strcpy(checkPointMsg, "Dump file closed successfully."); MPIcheckPoint(); - + #endif - + return; } - + int DumpReader::getNFrames(void) { if (!isScanned_) @@ -538,11 +540,11 @@ namespace oopse { q[2] = tokenizer.nextTokenAsDouble(); q[3] = tokenizer.nextTokenAsDouble(); - double qlen = q.length(); + RealType qlen = q.length(); if (qlen < oopse::epsilon) { //check quaternion is not equal to 0 sprintf(painCave.errMsg, - "DumpReader Error: initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2 ~ 0\n"); + "DumpReader Error: initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2) ~ 0\n"); painCave.isFatal = 1; simError(); @@ -565,10 +567,10 @@ namespace oopse { void DumpReader::parseCommentLine(char* line, Snapshot* s) { - double currTime; + RealType currTime; Mat3x3d hmat; - double chi; - double integralOfChiDt; + RealType chi; + RealType integralOfChiDt; Mat3x3d eta; StringTokenizer tokenizer(line);