# | Line 35 | Line 35 | |
---|---|---|
35 | * | |
36 | * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). | |
37 | * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). | |
38 | < | * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
38 | > | * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 | * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). | |
40 | * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). | |
41 | */ | |
42 | – | |
42 | ||
43 | + | #ifdef IS_MPI |
44 | + | #include <mpi.h> |
45 | + | #endif |
46 | + | |
47 | #include <sys/types.h> | |
48 | #include <sys/stat.h> | |
49 | ||
# | Line 59 | Line 62 | |
62 | #include "utils/StringTokenizer.hpp" | |
63 | #include "restraints/ObjectRestraint.hpp" | |
64 | #include "restraints/MolecularRestraint.hpp" | |
62 | – | |
63 | – | #ifdef IS_MPI |
64 | – | |
65 | – | #include <mpi.h> |
66 | – | #endif |
65 | ||
66 | namespace OpenMD { | |
67 | ||
68 | void RestReader::scanFile(){ | |
69 | < | int lineNo = 0; |
69 | > | |
70 | std::streampos prevPos; | |
71 | < | std::streampos currPos; |
71 | > | std::streampos currPos; |
72 | ||
73 | #ifdef IS_MPI | |
74 | ||
# | Line 82 | Line 80 | namespace OpenMD { | |
80 | prevPos = currPos; | |
81 | ||
82 | bool foundOpenSnapshotTag = false; | |
83 | < | |
83 | > | int lineNo = 0; |
84 | while(!foundOpenSnapshotTag && inFile_->getline(buffer, bufferSize)) { | |
85 | ++lineNo; | |
86 | ||
# | Line 97 | Line 95 | namespace OpenMD { | |
95 | ||
96 | #ifdef IS_MPI | |
97 | } | |
98 | < | MPI::COMM_WORLD.Bcast(&framePos_, 1, MPI::INT, 0); |
98 | > | MPI_Bcast(&framePos_, 1, MPI_INT, 0, MPI_COMM_WORLD); |
99 | #endif // is_mpi | |
100 | } | |
101 | ||
# | Line 132 | Line 130 | namespace OpenMD { | |
130 | } | |
131 | ||
132 | int sendBufferSize = sendBuffer.size(); | |
133 | < | MPI::COMM_WORLD.Bcast(&sendBufferSize, 1, MPI::INT, masterNode); |
134 | < | MPI::COMM_WORLD.Bcast((void *)sendBuffer.c_str(), sendBufferSize, |
135 | < | MPI::CHAR, masterNode); |
133 | > | MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD); |
134 | > | MPI_Bcast((void *)sendBuffer.c_str(), sendBufferSize, |
135 | > | MPI_CHAR, masterNode, MPI_COMM_WORLD); |
136 | ||
137 | sstream.str(sendBuffer); | |
138 | } else { | |
139 | int sendBufferSize; | |
140 | < | MPI::COMM_WORLD.Bcast(&sendBufferSize, 1, MPI::INT, masterNode); |
140 | > | MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD); |
141 | char * recvBuffer = new char[sendBufferSize+1]; | |
142 | assert(recvBuffer); | |
143 | recvBuffer[sendBufferSize] = '\0'; | |
144 | < | MPI::COMM_WORLD.Bcast(recvBuffer, sendBufferSize, MPI::CHAR, masterNode); |
144 | > | MPI_Bcast(recvBuffer, sendBufferSize, MPI_CHAR, masterNode, |
145 | > | MPI_COMM_WORLD); |
146 | sstream.str(recvBuffer); | |
147 | delete [] recvBuffer; | |
148 | } | |
# | Line 368 | Line 367 | namespace OpenMD { | |
367 | ||
368 | // is this io restrained? | |
369 | GenericData* data = sd->getPropertyByName("Restraint"); | |
371 | – | ObjectRestraint* oRest; |
370 | ||
371 | if (data != NULL) { | |
372 | // make sure we can reinterpret the generic data as restraint data: | |
# | Line 376 | Line 374 | namespace OpenMD { | |
374 | if (restData != NULL) { | |
375 | // make sure we can reinterpet the restraint data as a pointer to | |
376 | // an ObjectRestraint: | |
377 | < | oRest = dynamic_cast<ObjectRestraint*>(restData->getData()); |
377 | > | ObjectRestraint* oRest = dynamic_cast<ObjectRestraint*>(restData->getData()); |
378 | if (oRest != NULL) { | |
379 | if (sd->isDirectional()) { | |
380 | oRest->setReferenceStructure(pos, q.toRotationMatrix3()); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |