| 60 | 
  | 
    Globals* simParams = info->getSimParams(); | 
| 61 | 
  | 
    needCompression_ = simParams->getCompressDumpFile(); | 
| 62 | 
  | 
    needForceVector_ = simParams->getOutputForceVector(); | 
| 63 | 
+ | 
    needParticlePot_ = simParams->getOutputParticlePotential(); | 
| 64 | 
  | 
    createDumpFile_ = true; | 
| 65 | 
  | 
#ifdef HAVE_LIBZ | 
| 66 | 
  | 
    if (needCompression_) { | 
| 100 | 
  | 
 | 
| 101 | 
  | 
    needCompression_ = simParams->getCompressDumpFile(); | 
| 102 | 
  | 
    needForceVector_ = simParams->getOutputForceVector(); | 
| 103 | 
+ | 
    needParticlePot_ = simParams->getOutputParticlePotential(); | 
| 104 | 
  | 
    createDumpFile_ = true; | 
| 105 | 
  | 
#ifdef HAVE_LIBZ | 
| 106 | 
  | 
    if (needCompression_) { | 
| 140 | 
  | 
     | 
| 141 | 
  | 
    needCompression_ = simParams->getCompressDumpFile(); | 
| 142 | 
  | 
    needForceVector_ = simParams->getOutputForceVector(); | 
| 143 | 
+ | 
    needParticlePot_ = simParams->getOutputParticlePotential(); | 
| 144 | 
  | 
     | 
| 145 | 
  | 
#ifdef HAVE_LIBZ | 
| 146 | 
  | 
    if (needCompression_) { | 
| 309 | 
  | 
    } | 
| 310 | 
  | 
     | 
| 311 | 
  | 
    const int masterNode = 0; | 
| 312 | 
< | 
 | 
| 312 | 
> | 
    int nProc; | 
| 313 | 
> | 
    MPI_Comm_size(MPI_COMM_WORLD, &nProc); | 
| 314 | 
  | 
    if (worldRank == masterNode) {       | 
| 315 | 
  | 
      os << "  <Snapshot>\n";    | 
| 316 | 
  | 
      writeFrameProperties(os, info_->getSnapshotManager()->getCurrentSnapshot()); | 
| 318 | 
  | 
         | 
| 319 | 
  | 
      os << buffer; | 
| 320 | 
  | 
 | 
| 321 | 
< | 
      int nProc; | 
| 318 | 
< | 
      MPI_Comm_size(MPI_COMM_WORLD, &nProc); | 
| 321 | 
> | 
      | 
| 322 | 
  | 
      for (int i = 1; i < nProc; ++i) { | 
| 323 | 
  | 
 | 
| 324 | 
  | 
        // receive the length of the string buffer that was | 
| 325 | 
  | 
        // prepared by processor i | 
| 326 | 
< | 
 | 
| 326 | 
> | 
        | 
| 327 | 
> | 
        MPI_Bcast(&i, 1, MPI_INT,masterNode,MPI_COMM_WORLD); | 
| 328 | 
  | 
        int recvLength; | 
| 329 | 
  | 
        MPI_Recv(&recvLength, 1, MPI_INT, i, 0, MPI_COMM_WORLD, &istatus); | 
| 330 | 
  | 
        char* recvBuffer = new char[recvLength]; | 
| 341 | 
  | 
      os.flush(); | 
| 342 | 
  | 
    } else { | 
| 343 | 
  | 
      int sendBufferLength = buffer.size() + 1; | 
| 344 | 
< | 
      MPI_Send(&sendBufferLength, 1, MPI_INT, masterNode, 0, MPI_COMM_WORLD); | 
| 345 | 
< | 
      MPI_Send((void *)buffer.c_str(), sendBufferLength, MPI_CHAR, masterNode, 0, MPI_COMM_WORLD); | 
| 344 | 
> | 
      int myturn = 0; | 
| 345 | 
> | 
      for (int i = 1; i < nProc; ++i){ | 
| 346 | 
> | 
        MPI_Bcast(&myturn,1, MPI_INT,masterNode,MPI_COMM_WORLD); | 
| 347 | 
> | 
        if (myturn == worldRank){ | 
| 348 | 
> | 
          MPI_Send(&sendBufferLength, 1, MPI_INT, masterNode, 0, MPI_COMM_WORLD); | 
| 349 | 
> | 
          MPI_Send((void *)buffer.c_str(), sendBufferLength, MPI_CHAR, masterNode, 0, MPI_COMM_WORLD); | 
| 350 | 
> | 
        } | 
| 351 | 
> | 
      } | 
| 352 | 
  | 
    } | 
| 353 | 
  | 
 | 
| 354 | 
  | 
#endif // is_mpi | 
| 468 | 
  | 
        line += tempBuffer; | 
| 469 | 
  | 
      }       | 
| 470 | 
  | 
    } | 
| 471 | 
+ | 
    if (needParticlePot_) { | 
| 472 | 
+ | 
      type += "u"; | 
| 473 | 
+ | 
      RealType particlePot; | 
| 474 | 
+ | 
 | 
| 475 | 
+ | 
      particlePot = integrableObject->getParticlePot(); | 
| 476 | 
+ | 
 | 
| 477 | 
+ | 
      if (isinf(particlePot) || isnan(particlePot)) {       | 
| 478 | 
+ | 
        sprintf( painCave.errMsg, | 
| 479 | 
+ | 
                 "DumpWriter detected a numerical error writing the particle " | 
| 480 | 
+ | 
                 " potential for object %d", index);       | 
| 481 | 
+ | 
        painCave.isFatal = 1; | 
| 482 | 
+ | 
        simError(); | 
| 483 | 
+ | 
      } | 
| 484 | 
+ | 
      sprintf(tempBuffer, " %13e", particlePot); | 
| 485 | 
+ | 
      line += tempBuffer; | 
| 486 | 
+ | 
    } | 
| 487 | 
  | 
     | 
| 488 | 
  | 
    sprintf(tempBuffer, "%10d %7s %s\n", index, type.c_str(), line.c_str()); | 
| 489 | 
  | 
    return std::string(tempBuffer); |