99 |
|
#ifdef IS_MPI |
100 |
|
int streamSize; |
101 |
|
const int masterNode = 0; |
102 |
< |
int commStatus; |
102 |
> |
|
103 |
|
if (worldRank == masterNode) { |
104 |
< |
commStatus = MPI_Bcast(&mdFileVersion, 1, MPI_INT, masterNode, MPI_COMM_WORLD); |
104 |
> |
MPI::COMM_WORLD.Bcast(&mdFileVersion, 1, MPI::INT, masterNode); |
105 |
|
#endif |
106 |
|
SimplePreprocessor preprocessor; |
107 |
|
preprocessor.preprocess(rawMetaDataStream, filename, startOfMetaDataBlock, ppStream); |
109 |
|
#ifdef IS_MPI |
110 |
|
//brocasting the stream size |
111 |
|
streamSize = ppStream.str().size() +1; |
112 |
< |
commStatus = MPI_Bcast(&streamSize, 1, MPI_LONG, masterNode, MPI_COMM_WORLD); |
113 |
< |
|
114 |
< |
commStatus = MPI_Bcast(static_cast<void*>(const_cast<char*>(ppStream.str().c_str())), streamSize, MPI_CHAR, masterNode, MPI_COMM_WORLD); |
115 |
< |
|
116 |
< |
|
112 |
> |
MPI::COMM_WORLD.Bcast(&streamSize, 1, MPI::LONG, masterNode); |
113 |
> |
MPI::COMM_WORLD.Bcast(static_cast<void*>(const_cast<char*>(ppStream.str().c_str())), streamSize, MPI::CHAR, masterNode); |
114 |
> |
|
115 |
|
} else { |
116 |
< |
|
119 |
< |
commStatus = MPI_Bcast(&mdFileVersion, 1, MPI_INT, masterNode, MPI_COMM_WORLD); |
116 |
> |
MPI::COMM_WORLD.Bcast(&mdFileVersion, 1, MPI::INT, masterNode); |
117 |
|
|
118 |
|
//get stream size |
119 |
< |
commStatus = MPI_Bcast(&streamSize, 1, MPI_LONG, masterNode, MPI_COMM_WORLD); |
119 |
> |
MPI::COMM_WORLD.Bcast(&streamSize, 1, MPI::LONG, masterNode); |
120 |
|
|
121 |
|
char* buf = new char[streamSize]; |
122 |
|
assert(buf); |
123 |
|
|
124 |
|
//receive file content |
125 |
< |
commStatus = MPI_Bcast(buf, streamSize, MPI_CHAR, masterNode, MPI_COMM_WORLD); |
125 |
> |
MPI::COMM_WORLD.Bcast(buf, streamSize, MPI::CHAR, masterNode); |
126 |
|
|
127 |
|
ppStream.str(buf); |
128 |
|
delete [] buf; |
132 |
– |
|
129 |
|
} |
130 |
|
#endif |
131 |
|
// Create a scanner that reads from the input stream |
522 |
|
int nTarget; |
523 |
|
int done; |
524 |
|
int i; |
529 |
– |
int j; |
525 |
|
int loops; |
526 |
|
int which_proc; |
527 |
|
int nProcessors; |
963 |
|
} |
964 |
|
|
965 |
|
void SimCreator::loadCoordinates(SimInfo* info, const std::string& mdFileName) { |
971 |
– |
Globals* simParams; |
972 |
– |
|
973 |
– |
simParams = info->getSimParams(); |
966 |
|
|
967 |
|
DumpReader reader(info, mdFileName); |
968 |
|
int nframes = reader.getNFrames(); |
969 |
< |
|
969 |
> |
|
970 |
|
if (nframes > 0) { |
971 |
|
reader.readFrame(nframes - 1); |
972 |
|
} else { |