1 |
|
#include <algorithm> |
2 |
|
#include <iostream> |
3 |
|
#include <vector> |
4 |
< |
//#include <pair> |
4 |
> |
|
5 |
> |
|
6 |
|
#include "io/ZConsWriter.hpp" |
7 |
|
#include "utils/simError.h" |
8 |
|
|
55 |
|
/** |
56 |
|
* |
57 |
|
*/ |
58 |
< |
void ZConsWriter::writeFZ(double time, int num, int* index, double* fz, double* curZPos, double* zpos){ |
58 |
> |
void ZConsWriter::writeFZ(SimInfo* info, double time, int num, int* index, double* fz, double* curZPos, double* zpos){ |
59 |
|
|
60 |
|
#ifndef IS_MPI |
61 |
|
output << time << std::endl; |
85 |
|
if(worldRank == 0){ |
86 |
|
|
87 |
|
int globalIndexOfCurMol; |
87 |
– |
int *MolToProcMap; |
88 |
– |
MolToProcMap = mpiSim->getMolToProcMap(); |
88 |
|
|
89 |
|
for(int i = 0; i < (int)(parameters->size()); i++){ |
90 |
|
|
91 |
|
globalIndexOfCurMol = (*parameters)[i].zconsIndex; |
92 |
< |
whichNode = MolToProcMap[globalIndexOfCurMol]; |
92 |
> |
whichNode = info->getMolToProc(globalIndexOfCurMol); |
93 |
|
|
94 |
|
if(whichNode == 0){ |
95 |
|
|
118 |
|
|
119 |
|
//Send ending request message to slave nodes |
120 |
|
status = EndOfRequest; |
121 |
< |
for(int i =1; i < mpiSim->getNProcessors(); i++) |
121 |
> |
|
122 |
> |
int nproc; |
123 |
> |
MPI_Comm_size(MPI_COMM_WORLD, &nproc); |
124 |
> |
|
125 |
> |
for(int i =1; i < nproc; i++) |
126 |
|
MPI_Send(&status, 1, MPI_INT, i, tag, MPI_COMM_WORLD); |
127 |
|
|
128 |
|
} |