| 623 |
|
StuntDouble* sd; |
| 624 |
|
|
| 625 |
|
RealType min_val; |
| 626 |
< |
bool min_found = false; |
| 626 |
> |
int min_found = 0; |
| 627 |
|
StuntDouble* min_sd; |
| 628 |
|
|
| 629 |
|
RealType max_val; |
| 630 |
< |
bool max_found = false; |
| 630 |
> |
int max_found = 0; |
| 631 |
|
StuntDouble* max_sd; |
| 632 |
|
|
| 633 |
|
for (sd = seleManA_.beginSelected(selei); sd != NULL; |
| 682 |
|
if (!max_found) { |
| 683 |
|
max_val = value; |
| 684 |
|
max_sd = sd; |
| 685 |
< |
max_found = true; |
| 685 |
> |
max_found = 1; |
| 686 |
|
} else { |
| 687 |
|
if (max_val < value) { |
| 688 |
|
max_val = value; |
| 744 |
|
if (!min_found) { |
| 745 |
|
min_val = value; |
| 746 |
|
min_sd = sd; |
| 747 |
< |
min_found = true; |
| 747 |
> |
min_found = 1; |
| 748 |
|
} else { |
| 749 |
|
if (min_val > value) { |
| 750 |
|
min_val = value; |
| 857 |
|
|
| 858 |
|
Vector3d min_vel; |
| 859 |
|
Vector3d max_vel = max_sd->getVel(); |
| 860 |
< |
MPI_Status* status; |
| 860 |
> |
MPI_Status status; |
| 861 |
|
|
| 862 |
|
// point-to-point swap of the velocity vector |
| 863 |
|
MPI_Sendrecv(max_vel.getArrayPointer(), 3, MPI_REALTYPE, |
| 864 |
|
min_vals.rank, 0, |
| 865 |
|
min_vel.getArrayPointer(), 3, MPI_REALTYPE, |
| 866 |
< |
min_vals.rank, 0, MPI_COMM_WORLD, status); |
| 866 |
> |
min_vals.rank, 0, MPI_COMM_WORLD, &status); |
| 867 |
|
|
| 868 |
|
switch(rnemdFluxType_) { |
| 869 |
|
case rnemdKE : |
| 878 |
|
MPI_REALTYPE, min_vals.rank, 1, |
| 879 |
|
min_angMom.getArrayPointer(), 3, |
| 880 |
|
MPI_REALTYPE, min_vals.rank, 1, |
| 881 |
< |
MPI_COMM_WORLD, status); |
| 881 |
> |
MPI_COMM_WORLD, &status); |
| 882 |
|
|
| 883 |
|
max_sd->setJ(min_angMom); |
| 884 |
|
} |
| 903 |
|
|
| 904 |
|
Vector3d max_vel; |
| 905 |
|
Vector3d min_vel = min_sd->getVel(); |
| 906 |
< |
MPI_Status* status; |
| 906 |
> |
MPI_Status status; |
| 907 |
|
|
| 908 |
|
// point-to-point swap of the velocity vector |
| 909 |
|
MPI_Sendrecv(min_vel.getArrayPointer(), 3, MPI_REALTYPE, |
| 910 |
|
max_vals.rank, 0, |
| 911 |
|
max_vel.getArrayPointer(), 3, MPI_REALTYPE, |
| 912 |
< |
max_vals.rank, 0, MPI_COMM_WORLD, status); |
| 912 |
> |
max_vals.rank, 0, MPI_COMM_WORLD, &status); |
| 913 |
|
|
| 914 |
|
switch(rnemdFluxType_) { |
| 915 |
|
case rnemdKE : |
| 924 |
|
MPI_REALTYPE, max_vals.rank, 1, |
| 925 |
|
max_angMom.getArrayPointer(), 3, |
| 926 |
|
MPI_REALTYPE, max_vals.rank, 1, |
| 927 |
< |
MPI_COMM_WORLD, status); |
| 927 |
> |
MPI_COMM_WORLD, &status); |
| 928 |
|
|
| 929 |
|
min_sd->setJ(max_angMom); |
| 930 |
|
} |
| 1999 |
|
1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); |
| 2000 |
|
MPI_Allreduce(MPI_IN_PLACE, &binMass[i], |
| 2001 |
|
1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
| 2002 |
< |
MPI_Allreduce(MPI_IN_PLACE, &binP[i], |
| 2002 |
> |
MPI_Allreduce(MPI_IN_PLACE, binP[i].getArrayPointer(), |
| 2003 |
> |
3, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
| 2004 |
> |
MPI_Allreduce(MPI_IN_PLACE, binL[i].getArrayPointer(), |
| 2005 |
|
3, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
| 2006 |
< |
MPI_Allreduce(MPI_IN_PLACE, &binL[i], |
| 2005 |
< |
3, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
| 2006 |
< |
MPI_Allreduce(MPI_IN_PLACE, &binI[i], |
| 2006 |
> |
MPI_Allreduce(MPI_IN_PLACE, binI[i].getArrayPointer(), |
| 2007 |
|
9, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
| 2008 |
|
MPI_Allreduce(MPI_IN_PLACE, &binKE[i], |
| 2009 |
|
1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
| 2239 |
|
} |
| 2240 |
|
|
| 2241 |
|
rnemdFile_ << "#######################################################\n"; |
| 2242 |
< |
rnemdFile_ << "# Standard Deviations in those quantities follow:\n"; |
| 2242 |
> |
rnemdFile_ << "# 95% confidence intervals in those quantities follow:\n"; |
| 2243 |
|
rnemdFile_ << "#######################################################\n"; |
| 2244 |
|
|
| 2245 |
|
|
| 2248 |
|
for (unsigned int i = 0; i < outputMask_.size(); ++i) { |
| 2249 |
|
if (outputMask_[i]) { |
| 2250 |
|
if (data_[i].dataType == "RealType") |
| 2251 |
< |
writeRealStdDev(i,j); |
| 2251 |
> |
writeRealErrorBars(i,j); |
| 2252 |
|
else if (data_[i].dataType == "Vector3d") |
| 2253 |
< |
writeVectorStdDev(i,j); |
| 2253 |
> |
writeVectorErrorBars(i,j); |
| 2254 |
|
else { |
| 2255 |
|
sprintf( painCave.errMsg, |
| 2256 |
|
"RNEMD found an unknown data type for: %s ", |
| 2321 |
|
} |
| 2322 |
|
} |
| 2323 |
|
|
| 2324 |
< |
void RNEMD::writeRealStdDev(int index, unsigned int bin) { |
| 2324 |
> |
void RNEMD::writeRealErrorBars(int index, unsigned int bin) { |
| 2325 |
|
if (!doRNEMD_) return; |
| 2326 |
|
assert(index >=0 && index < ENDINDEX); |
| 2327 |
|
assert(int(bin) < nBins_); |
| 2331 |
|
count = data_[index].accumulator[bin]->count(); |
| 2332 |
|
if (count == 0) return; |
| 2333 |
|
|
| 2334 |
< |
dynamic_cast<Accumulator *>(data_[index].accumulator[bin])->getStdDev(s); |
| 2334 |
> |
dynamic_cast<Accumulator *>(data_[index].accumulator[bin])->get95percentConfidenceInterval(s); |
| 2335 |
|
|
| 2336 |
|
if (! isinf(s) && ! isnan(s)) { |
| 2337 |
|
rnemdFile_ << "\t" << s; |
| 2344 |
|
} |
| 2345 |
|
} |
| 2346 |
|
|
| 2347 |
< |
void RNEMD::writeVectorStdDev(int index, unsigned int bin) { |
| 2347 |
> |
void RNEMD::writeVectorErrorBars(int index, unsigned int bin) { |
| 2348 |
|
if (!doRNEMD_) return; |
| 2349 |
|
assert(index >=0 && index < ENDINDEX); |
| 2350 |
|
assert(int(bin) < nBins_); |
| 2354 |
|
count = data_[index].accumulator[bin]->count(); |
| 2355 |
|
if (count == 0) return; |
| 2356 |
|
|
| 2357 |
< |
dynamic_cast<VectorAccumulator*>(data_[index].accumulator[bin])->getStdDev(s); |
| 2357 |
> |
dynamic_cast<VectorAccumulator*>(data_[index].accumulator[bin])->get95percentConfidenceInterval(s); |
| 2358 |
|
if (isinf(s[0]) || isnan(s[0]) || |
| 2359 |
|
isinf(s[1]) || isnan(s[1]) || |
| 2360 |
|
isinf(s[2]) || isnan(s[2]) ) { |