Reading certain values brom boolmask data

Hello,

I need to read points from boolmask data to define boundary conditions (f.e. pressure inlet). It works for non parallel simulations with following code:

[code=“cpp”]
ScalarField3D boolMask(nx, ny, nz);
plb_ifstream ifile(param.bmask.c_str());
ifile >> boolMask;

    // Pressure Inlet
    for (plint iX=0; iX<=nx-1; ++iX) {
        for (plint iY=0; iY<=ny-1; ++iY) {
            for (plint iZ=0; iZ<=nz-1; ++iZ) {

    T a0=iX+nx*iY+ny*nz*iZ;        
    T b0=boolMask[a0];

if (b0==0){
Box3D Inlet (iX,iX, iY ,iY , iZ,iZ);
boundaryCondition->addPressureBoundary0N(Inlet, lattice);
setBoundaryDensity(lattice, Inlet, 1.);
}
.
.
.



But for parallel simulations there is the error

Fatal error in PMPI_Wait: Message truncated, error stack:
PMPI_Wait(183)…: MPI_Wait(request=01B4C110, status=01B4C128) failed
MPIR_Wait_impl(77):
do_cts(509)…: Message truncated; 124767 bytes received but buffer size is
2600



I tried using MultiScalarField3D, but I can't manage to read the boolmask values as with ScalarField3D because of the error "..\..\..\src\io\parallelIO.h|138|error: no match for 'operator>>' in '(& lhs)->plb::Parallel_istream::getOriginalStream() >> rhs'|".

[code="cpp"]
        MultiScalarField3D<T>* boolMask = new MultiScalarField3D<T>(nx,ny,nz);
        plb_ifstream ifile(param.bmask.c_str());
        ifile >> boolMask;

        for (plint iX=0; iX<=nx-1; ++iX) {
            for (plint iY=0; iY<=ny-1; ++iY) {
                for (plint iZ=0; iZ<=nz-1; ++iZ) {

        T M[iX][iY][iZ];
        boolMask->get(iX,iY,iZ) = M[iX][iY][iZ];
        T b0 = M[iX][iY][iZ];
.
.
.

Hope anyone has an idea how to read out the boolmask values.
Is it possible to run this part of the simulation in serial and everything else in parallel? That would be a good solution for me too.

Thanks in advance
Andi