--- trunk/src/rnemd/RNEMD.cpp 2014/02/26 14:14:50 1969 +++ trunk/src/rnemd/RNEMD.cpp 2014/04/05 21:17:12 1980 @@ -623,11 +623,11 @@ namespace OpenMD { StuntDouble* sd; RealType min_val; - bool min_found = false; + int min_found = 0; StuntDouble* min_sd; RealType max_val; - bool max_found = false; + int max_found = 0; StuntDouble* max_sd; for (sd = seleManA_.beginSelected(selei); sd != NULL; @@ -682,7 +682,7 @@ namespace OpenMD { if (!max_found) { max_val = value; max_sd = sd; - max_found = true; + max_found = 1; } else { if (max_val < value) { max_val = value; @@ -744,7 +744,7 @@ namespace OpenMD { if (!min_found) { min_val = value; min_sd = sd; - min_found = true; + min_found = 1; } else { if (min_val > value) { min_val = value; @@ -857,13 +857,13 @@ namespace OpenMD { Vector3d min_vel; Vector3d max_vel = max_sd->getVel(); - MPI_Status* status; + MPI_Status status; // point-to-point swap of the velocity vector MPI_Sendrecv(max_vel.getArrayPointer(), 3, MPI_REALTYPE, min_vals.rank, 0, min_vel.getArrayPointer(), 3, MPI_REALTYPE, - min_vals.rank, 0, MPI_COMM_WORLD, status); + min_vals.rank, 0, MPI_COMM_WORLD, &status); switch(rnemdFluxType_) { case rnemdKE : @@ -878,7 +878,7 @@ namespace OpenMD { MPI_REALTYPE, min_vals.rank, 1, min_angMom.getArrayPointer(), 3, MPI_REALTYPE, min_vals.rank, 1, - MPI_COMM_WORLD, status); + MPI_COMM_WORLD, &status); max_sd->setJ(min_angMom); } @@ -903,13 +903,13 @@ namespace OpenMD { Vector3d max_vel; Vector3d min_vel = min_sd->getVel(); - MPI_Status* status; + MPI_Status status; // point-to-point swap of the velocity vector MPI_Sendrecv(min_vel.getArrayPointer(), 3, MPI_REALTYPE, max_vals.rank, 0, max_vel.getArrayPointer(), 3, MPI_REALTYPE, - max_vals.rank, 0, MPI_COMM_WORLD, status); + max_vals.rank, 0, MPI_COMM_WORLD, &status); switch(rnemdFluxType_) { case rnemdKE : @@ -924,7 +924,7 @@ namespace OpenMD { MPI_REALTYPE, max_vals.rank, 1, max_angMom.getArrayPointer(), 3, MPI_REALTYPE, max_vals.rank, 1, - MPI_COMM_WORLD, status); + MPI_COMM_WORLD, &status); min_sd->setJ(max_angMom); } @@ -1999,11 +1999,11 @@ namespace OpenMD { 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); MPI_Allreduce(MPI_IN_PLACE, &binMass[i], 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(MPI_IN_PLACE, &binP[i], + MPI_Allreduce(MPI_IN_PLACE, binP[i].getArrayPointer(), + 3, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(MPI_IN_PLACE, binL[i].getArrayPointer(), 3, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(MPI_IN_PLACE, &binL[i], - 3, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(MPI_IN_PLACE, &binI[i], + MPI_Allreduce(MPI_IN_PLACE, binI[i].getArrayPointer(), 9, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); MPI_Allreduce(MPI_IN_PLACE, &binKE[i], 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); @@ -2239,7 +2239,7 @@ namespace OpenMD { } rnemdFile_ << "#######################################################\n"; - rnemdFile_ << "# Standard Deviations in those quantities follow:\n"; + rnemdFile_ << "# 95% confidence intervals in those quantities follow:\n"; rnemdFile_ << "#######################################################\n"; @@ -2248,9 +2248,9 @@ namespace OpenMD { for (unsigned int i = 0; i < outputMask_.size(); ++i) { if (outputMask_[i]) { if (data_[i].dataType == "RealType") - writeRealStdDev(i,j); + writeRealErrorBars(i,j); else if (data_[i].dataType == "Vector3d") - writeVectorStdDev(i,j); + writeVectorErrorBars(i,j); else { sprintf( painCave.errMsg, "RNEMD found an unknown data type for: %s ", @@ -2321,7 +2321,7 @@ namespace OpenMD { } } - void RNEMD::writeRealStdDev(int index, unsigned int bin) { + void RNEMD::writeRealErrorBars(int index, unsigned int bin) { if (!doRNEMD_) return; assert(index >=0 && index < ENDINDEX); assert(int(bin) < nBins_); @@ -2331,7 +2331,7 @@ namespace OpenMD { count = data_[index].accumulator[bin]->count(); if (count == 0) return; - dynamic_cast(data_[index].accumulator[bin])->getStdDev(s); + dynamic_cast(data_[index].accumulator[bin])->get95percentConfidenceInterval(s); if (! isinf(s) && ! isnan(s)) { rnemdFile_ << "\t" << s; @@ -2344,7 +2344,7 @@ namespace OpenMD { } } - void RNEMD::writeVectorStdDev(int index, unsigned int bin) { + void RNEMD::writeVectorErrorBars(int index, unsigned int bin) { if (!doRNEMD_) return; assert(index >=0 && index < ENDINDEX); assert(int(bin) < nBins_); @@ -2354,7 +2354,7 @@ namespace OpenMD { count = data_[index].accumulator[bin]->count(); if (count == 0) return; - dynamic_cast(data_[index].accumulator[bin])->getStdDev(s); + dynamic_cast(data_[index].accumulator[bin])->get95percentConfidenceInterval(s); if (isinf(s[0]) || isnan(s[0]) || isinf(s[1]) || isnan(s[1]) || isinf(s[2]) || isnan(s[2]) ) {