OpenFOAM-5.x/src/meshTools
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
..
algorithms Updated UPstream::commsTypes to use the C++11 enum class 2017-03-10 19:54:55 +00:00
AMIInterpolation Updated UPstream::commsTypes to use the C++11 enum class 2017-03-10 19:54:55 +00:00
cellClassification Added forward declaration of friend functions 2016-05-30 08:28:35 +01:00
cellDist Doxygen documentation: Standardized the 'See also' heading 2016-06-17 17:31:34 +01:00
cellFeatures C++11: Replaced the C NULL with the safer C++11 nullptr 2016-08-05 17:19:38 +01:00
cellQuality Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
coordinateSystems functionObjects::fieldCoordinateSystemTransform: added coordinateSystem sub-dict and updated the description 2017-02-22 13:20:15 +00:00
edgeFaceCirculator Updates for clang++-3.9 2017-01-18 21:45:26 +00:00
edgeMesh Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
indexedOctree Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
Make Merged the edgeMesh library into the meshTools library 2017-04-21 10:38:53 +01:00
mappedPatches Updated member type comments 2016-11-28 09:22:56 +00:00
meshSearch meshSearch: Add support for cell decomposition mode CELL_TETS 2017-01-20 10:47:15 +00:00
meshStructure Added forward declaration of friend functions 2016-05-30 13:21:29 +01:00
meshTools Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
momentOfInertia Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
polyMeshZipUpCells Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
primitiveMeshGeometry Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
regionCoupled Removed unhelpful clutter 2017-01-26 17:47:24 +00:00
regionSplit decomposePar: Speed-up decomposing with constraints 2016-07-22 17:19:21 +01:00
searchableSurfaces Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
sets Parallel IO: New collated file format 2017-07-07 11:39:56 +01:00
surfaceSets Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
tetOverlapVolume primitiveShapes: Generalised tetrahedron and triangle cutting. Cuts are 2017-05-22 12:23:22 +01:00
triSurface Rationalize the "pos" function 2017-06-22 14:32:18 +01:00
twoDPointCorrector C++11: Replaced the C NULL with the safer C++11 nullptr 2016-08-05 17:19:38 +01:00