OpenFOAM-5.x/applications/utilities/mesh/manipulation
Henry Weller 7c301dbff4 Parallel IO: New collated file format
When an OpenFOAM simulation runs in parallel, the data for decomposed fields and
mesh(es) has historically been stored in multiple files within separate
directories for each processor.  Processor directories are named 'processorN',
where N is the processor number.

This commit introduces an alternative "collated" file format where the data for
each decomposed field (and mesh) is collated into a single file, which is
written and read on the master processor.  The files are stored in a single
directory named 'processors'.

The new format produces significantly fewer files - one per field, instead of N
per field.  For large parallel cases, this avoids the restriction on the number
of open files imposed by the operating system limits.

The file writing can be threaded allowing the simulation to continue running
while the data is being written to file.  NFS (Network File System) is not
needed when using the the collated format and additionally, there is an option
to run without NFS with the original uncollated approach, known as
"masterUncollated".

The controls for the file handling are in the OptimisationSwitches of
etc/controlDict:

OptimisationSwitches
{
    ...

    //- Parallel IO file handler
    //  uncollated (default), collated or masterUncollated
    fileHandler uncollated;

    //- collated: thread buffer size for queued file writes.
    //  If set to 0 or not sufficient for the file size threading is not used.
    //  Default: 2e9
    maxThreadFileBufferSize 2e9;

    //- masterUncollated: non-blocking buffer size.
    //  If the file exceeds this buffer size scheduled transfer is used.
    //  Default: 2e9
    maxMasterFileBufferSize 2e9;
}

When using the collated file handling, memory is allocated for the data in the
thread.  maxThreadFileBufferSize sets the maximum size of memory in bytes that
is allocated.  If the data exceeds this size, the write does not use threading.

When using the masterUncollated file handling, non-blocking MPI communication
requires a sufficiently large memory buffer on the master node.
maxMasterFileBufferSize sets the maximum size in bytes of the buffer.  If the
data exceeds this size, the system uses scheduled communication.

The installation defaults for the fileHandler choice, maxThreadFileBufferSize
and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within
the case controlDict file, like other parameters.  Additionally the fileHandler
can be set by:
- the "-fileHandler" command line argument;
- a FOAM_FILEHANDLER environment variable.

A foamFormatConvert utility allows users to convert files between the collated
and uncollated formats, e.g.
    mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated

An example case demonstrating the file handling methods is provided in:
$FOAM_TUTORIALS/IO/fileHandling

The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
2017-07-07 11:39:56 +01:00
..
attachMesh Formatting: Rationalized the indentation of #include 2015-02-10 20:35:50 +00:00
autoPatch Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
checkMesh Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
createBaffles C++11: Replaced the C NULL with the safer C++11 nullptr 2016-08-05 17:19:38 +01:00
createPatch Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
deformedGeom Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
flattenMesh Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
insideCells Other utilities: standardised argument naming for files 2017-05-12 15:16:29 +01:00
mergeMeshes Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
mergeOrSplitBaffles Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
mirrorMesh C++11: Replaced the C NULL with the safer C++11 nullptr 2016-08-05 17:19:38 +01:00
moveDynamicMesh checkGeometry, moveDynamicMesh: Convert processor IDs to 'List<label>' 2016-07-09 20:47:06 +01:00
moveEngineMesh ddtScheme::fvcDdtPhiCoeff: Zero ddtCorr on AMIs 2015-03-24 15:23:01 +00:00
moveMesh Formatting: Rationalized the indentation of #include 2015-02-10 20:35:50 +00:00
objToVTK applications: Update ...ErrorIn -> ...ErrorInFunction 2015-11-10 17:53:31 +00:00
orientFaceZone Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
polyDualMesh Standardized names of extrude2DMesh and polyDualMesh application source files 2017-05-14 15:44:48 +01:00
refineMesh Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
renumberMesh Make/options: Added -lscotchDecomp where appropriate 2016-12-27 15:26:53 +00:00
rotateMesh Updated headers 2016-04-21 21:07:28 +01:00
setSet Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
setsToZones setsToZones: Add support for multi-region cases 2017-01-19 08:17:54 +00:00
singleCellMesh applications: Update ...ErrorIn -> ...ErrorInFunction 2015-11-10 17:53:31 +00:00
splitMesh Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
splitMeshRegions Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
stitchMesh Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
subsetMesh Updated template formatting to C++11 2016-07-12 20:03:29 +01:00
topoSet Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
transformPoints transformPoints: Added "End" message 2016-04-21 21:05:47 +01:00
zipUpMesh Formatting: Rationalized the indentation of #include 2015-02-10 20:35:50 +00:00