When the collated file I/O of OpenFOAM is used the WENO scheme gets stuck when it reconstructs the global mesh. The reason for this is found in two locations of which one can be fixed.
Using File Handler for Boundary Patch Stream
The file handler is used to get the file stream for the boundary patch pointers. This causes a problem as the collated file handler will be applied causing the mpi to get stuck. This can be easily solved by using readHeader() first and then readList.
Constructing the PolyMesh
When the polyMesh is constructed each constructor calls Foam::polyMesh::readTetBasePtIs(). Within this function the Foam::IOobject::typeHeaderOk() function is called to check the file header which in return calls the general function typeFilePath() defined in IOObject. This calls the Foam::IOobject::localFilePath() which uses the file handler.
In the file handler the filePath() function is either implemented in Foam::fileOperations::masterUncollatedFileOperation::filePath() or Foam::fileOperations::uncollatedFileOperation::filePath(). If the collated file I/O option is chosen the masterUncollatedFileOperations path is chosen and within this function the masterOp<>() function is called which then causes the MPI to get stuck as a gatherList is called. The MPI gets stuck as not all processors are calling this function, caused by each processor reconstructing only a part of the mesh and not the global mesh.
When the collated file I/O of OpenFOAM is used the WENO scheme gets stuck when it reconstructs the global mesh. The reason for this is found in two locations of which one can be fixed.
Using File Handler for Boundary Patch Stream
The file handler is used to get the file stream for the boundary patch pointers. This causes a problem as the collated file handler will be applied causing the mpi to get stuck. This can be easily solved by using
readHeader()
first and thenreadList
.Constructing the PolyMesh
When the polyMesh is constructed each constructor calls
Foam::polyMesh::readTetBasePtIs()
. Within this function theFoam::IOobject::typeHeaderOk()
function is called to check the file header which in return calls the general functiontypeFilePath()
defined in IOObject. This calls theFoam::IOobject::localFilePath()
which uses the file handler.In the file handler the
filePath()
function is either implemented inFoam::fileOperations::masterUncollatedFileOperation::filePath()
orFoam::fileOperations::uncollatedFileOperation::filePath()
. If the collated file I/O option is chosen the masterUncollatedFileOperations path is chosen and within this function themasterOp<>()
function is called which then causes the MPI to get stuck as a gatherList is called. The MPI gets stuck as not all processors are calling this function, caused by each processor reconstructing only a part of the mesh and not the global mesh.