Dear Community,
I encountered some problems with get() function. My code fraction is as follows:
if (global::mpi().isMainProcessor())
{
ParticleField3D<T,Descriptor>& atomicSerialParticles =
dynamic_cast<ParticleField3D<T,Descriptor>&>(multiSerialParticles.getComponent(0));
std::vector<Particle3D<T,Descriptor>*> found;
SmartBulk3D oneBlockBulk(serialMultiBlockManagement, 0);
atomicSerialParticles.findParticles(oneBlockBulk.toLocal(particles.getBoundingBox()), found);
for (pluint iParticle=0; iParticle<found.size(); ++iParticle)
{
Array<T,3> pos(found[iParticle]->getPosition());
vector<int> label(8);
Box3D cur;
cur.x0 = (plint)floor(pos[0]);
cur.x1 = (plint)ceil(pos[0]);
cur.y0 = (plint)floor(pos[1]);
cur.y1 = (plint)ceil(pos[1]);
cur.z0 = (plint)floor(pos[2]);
cur.z1 = (plint)ceil(pos[2]);
label[0] = geometry.get(cur.x0, cur.y0, cur.z0);
label[1] = geometry.get(cur.x0, cur.y0, cur.z1);
label[2] = geometry.get(cur.x0, cur.y1, cur.z0);
label[3] = geometry.get(cur.x0, cur.y1, cur.z1);
label[4] = geometry.get(cur.x1, cur.y0, cur.z0);
label[5] = geometry.get(cur.x1, cur.y0, cur.z1);
label[6] = geometry.get(cur.x1, cur.y1, cur.z0);
label[7] = geometry.get(cur.x1, cur.y1, cur.z1);
}
}
The code is based on "writeAsciiParticlePos", the "geometry" is a "MultiScalarField<int>" which reads the geometry input data file.
In serial run, the program went will; however, when the code is running in parallel, I got this error:
Fatal error in MPI_Recv: Message truncated, error stack:
MPI_Recv(186)…: MPI_Recv(buf=0x793e70, count=1, MPI_INT, src=MPI_ANY_SOURCE, tag=0, MPI_COMM_WORLD, status=0x7fff9d135320) failed
MPIDI_CH3U_Receive_data_found(129): Message from rank 3 and tag 0 truncated; 1200 bytes received but buffer size is 4
Could anybody please tell me why this happens, and help me to solve this problems?
Many thanks in advance!
Best Regards,
whatsoever
2012.2.20