From 7c301dbff4f02317a85f9ad19fae435d4ab42e6f Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 7 Jul 2017 11:39:56 +0100 Subject: [PATCH] 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. --- .../electromagnetics/mhdFoam/createPhiB.H | 2 +- .../fluid/residualControlsFluid.H | 57 +- .../solid/createSolidFields.H | 2 +- .../heatTransfer/thermoFoam/setAlphaEff.H | 2 +- .../createFields.H | 4 +- .../createNonInertialFrameFields.H | 26 +- .../multiphase/VoF/createAlphaFluxes.H | 2 +- .../multiphaseSystem/phaseModel/phaseModel.C | 2 +- .../MovingPhaseModel/MovingPhaseModel.C | 4 +- .../twoPhaseSystem/phaseModel/phaseModel.C | 2 +- .../test/CompactIOList/Test-CompactIOList.C | 8 +- applications/test/IOField/Make/files | 3 + applications/test/IOField/Make/options | 2 + applications/test/IOField/Test-IOField.C | 189 ++ .../test/decomposedBlockData/Make/files | 3 + .../test/decomposedBlockData/Make/options | 0 .../Test-decomposedBlockData.C | 98 + .../advanced/autoRefineMesh/autoRefineMesh.C | 5 +- .../mesh/advanced/modifyMesh/modifyMesh.C | 3 +- .../refinementLevel/refinementLevel.C | 4 +- .../mesh/advanced/selectCells/edgeStats.C | 5 +- .../foamToStarMesh/foamToStarMesh.C | 3 +- .../conversion/foamToStarMesh/getTimeIndex.H | 2 +- .../conversion/foamToSurface/foamToSurface.C | 2 +- .../conversion/foamToSurface/getTimeIndex.H | 2 +- .../mesh/generation/blockMesh/blockMesh.C | 2 +- .../extrude/extrudeMesh/extrudeMesh.C | 6 +- .../extrudeToRegionMesh/extrudeToRegionMesh.C | 8 +- .../generation/extrude2DMesh/extrude2DMesh.C | 1 + .../DelaunayMesh/DelaunayMeshIO.C | 6 +- .../generation/snappyHexMesh/snappyHexMesh.C | 1 + .../mesh/manipulation/checkMesh/checkMesh.C | 3 +- .../mesh/manipulation/checkMesh/checkTools.C | 9 +- .../manipulation/createPatch/createPatch.C | 1 + .../manipulation/deformedGeom/deformedGeom.C | 4 +- .../mesh/manipulation/refineMesh/refineMesh.C | 7 +- .../mesh/manipulation/setSet/setSet.C | 8 +- .../splitMeshRegions/splitMeshRegions.C | 4 +- .../mesh/manipulation/stitchMesh/stitchMesh.C | 5 +- .../mesh/manipulation/topoSet/topoSet.C | 9 +- .../foamFormatConvert/foamFormatConvert.C | 291 ++- .../foamFormatConvert/writeMeshObject.H | 18 +- .../helpTypes/helpBoundary/helpBoundary.C | 5 +- .../miscellaneous/patchSummary/patchSummary.C | 4 +- .../decomposePar/decomposePar.C | 103 +- .../decomposePar/domainDecomposition.C | 3 - ...lagrangianFieldDecomposerDecomposeFields.C | 12 +- .../reconstructPar/reconstructPar.C | 117 +- .../reconstructParMesh/reconstructParMesh.C | 35 +- .../redistributePar/loadOrCreateMesh.C | 5 +- .../dataConversion/foamToEnsight/checkData.H | 2 +- .../foamToEnsight/checkMeshMoving.H | 2 +- .../foamToEnsight/foamToEnsight.C | 7 +- .../foamToEnsightParts/checkHasMovingMesh.H | 2 +- .../foamToEnsightParts/getTimeIndex.H | 2 +- .../foamToEnsightParts/moveMesh.H | 2 +- .../dataConversion/foamToGMV/gmvOutput.H | 8 +- .../dataConversion/foamToGMV/moveMesh.H | 2 +- .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C | 17 +- .../vtkPV3Foam/vtkPV3FoamUpdateInfo.C | 8 +- .../vtkPV3blockMesh/vtkPV3blockMesh.C | 9 +- .../PVFoamReader/vtkPVFoam/vtkPVFoam.C | 18 +- .../vtkPVFoam/vtkPVFoamUpdateInfo.C | 8 +- .../vtkPVblockMesh/vtkPVblockMesh.C | 9 +- .../ensightFoamReader/USERD_set_filenames.H | 4 +- .../ensightFoamReader/getFieldScalar.H | 2 +- .../ensightFoamReader/getFieldTensor.H | 2 +- .../ensightFoamReader/getFieldVector.H | 2 +- .../ensightFoamReader/getPatchFieldScalar.H | 2 +- .../ensightFoamReader/getPatchFieldTensor.H | 2 +- .../ensightFoamReader/getPatchFieldVector.H | 2 +- .../miscellaneous/postChannel/readFields.H | 2 +- .../utilities/postProcessing/noise/noise.C | 1 + .../applyBoundaryLayer/applyBoundaryLayer.C | 4 +- .../changeDictionary/changeDictionary.C | 4 +- .../foamUpgradeCyclics/foamUpgradeCyclics.C | 9 +- .../mapFields/MapConsistentVolFields.H | 23 +- .../preProcessing/mapFields/MapVolFields.H | 24 +- .../preProcessing/mapFieldsPar/MapVolFields.H | 2 +- .../preProcessing/setFields/setFields.C | 10 +- .../surfaceFeatureExtract.C | 3 +- .../surface/surfaceHookUp/surfaceHookUp.C | 3 +- .../surfaceMeshConvert/surfaceMeshConvert.C | 2 +- .../surfaceMeshConvertTesting.C | 6 +- .../surfaceMeshExport/surfaceMeshExport.C | 2 +- .../surfaceMeshImport/surfaceMeshImport.C | 2 +- .../surfaceMeshTriangulate.C | 1 + .../surfaceRedistributePar.C | 34 +- .../equilibriumCO/equilibriumCO.C | 1 + etc/controlDict | 14 + src/OSspecific/POSIX/POSIX.C | 380 +++- src/OSspecific/POSIX/fileStat.C | 29 +- src/OSspecific/POSIX/fileStat.H | 13 +- src/OSspecific/POSIX/regExp.H | 4 +- src/OpenFOAM/Make/files | 17 +- src/OpenFOAM/db/IOobject/IOobject.C | 256 ++- src/OpenFOAM/db/IOobject/IOobject.H | 116 +- src/OpenFOAM/db/IOobject/IOobjectIO.C | 5 +- src/OpenFOAM/db/IOobject/IOobjectTemplates.C | 91 + .../db/IOobject/IOobjectWriteHeader.C | 4 +- src/OpenFOAM/db/IOobjectList/IOobjectList.C | 29 +- .../IOobjects/CompactIOField/CompactIOField.C | 75 +- .../IOobjects/CompactIOField/CompactIOField.H | 10 +- .../IOobjects/CompactIOList/CompactIOList.C | 58 +- .../IOobjects/CompactIOList/CompactIOList.H | 8 +- .../IOobjects/GlobalIOField/GlobalIOField.C | 134 ++ .../IOobjects/GlobalIOField/GlobalIOField.H | 125 ++ .../IOobjects/GlobalIOField/GlobalIOFields.C | 65 + .../db/IOobjects/GlobalIOList/GlobalIOList.C | 130 ++ .../db/IOobjects/GlobalIOList/GlobalIOList.H | 125 ++ .../db/IOobjects/GlobalIOList/globalIOLists.C | 44 + .../db/IOobjects/GlobalIOList/globalIOLists.H | 88 + src/OpenFOAM/db/IOobjects/IOField/IOField.C | 83 +- src/OpenFOAM/db/IOobjects/IOField/IOField.H | 5 +- src/OpenFOAM/db/IOobjects/IOList/IOList.C | 48 +- src/OpenFOAM/db/IOobjects/IOMap/IOMap.C | 14 +- src/OpenFOAM/db/IOobjects/IOMap/IOMap.H | 15 +- src/OpenFOAM/db/IOobjects/IOMap/IOMapName.C | 9 +- .../db/IOobjects/IOPtrList/IOPtrList.C | 14 +- .../db/IOobjects/IOdictionary/IOdictionary.C | 164 +- .../db/IOobjects/IOdictionary/IOdictionary.H | 58 +- .../IOobjects/IOdictionary/IOdictionaryIO.C | 108 - .../IOobjects/IOdictionary/baseIOdictionary.C | 100 + .../IOobjects/IOdictionary/baseIOdictionary.H | 121 ++ .../IOdictionary/baseIOdictionaryIO.C | 56 + .../IOdictionary/localIOdictionary.C | 100 + .../IOdictionary/localIOdictionary.H | 103 + .../IOdictionary/unwatchedIOdictionary.C | 146 ++ .../IOdictionary/unwatchedIOdictionary.H | 127 ++ .../decomposedBlockData/decomposedBlockData.C | 921 +++++++++ .../decomposedBlockData/decomposedBlockData.H | 197 ++ src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C | 44 +- src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H | 8 +- .../db/IOstreams/Fstreams/masterOFstream.C | 164 ++ .../db/IOstreams/Fstreams/masterOFstream.H | 101 + .../IOstreams/StringStreams/IStringStream.H | 21 +- .../IOstreams/dummyISstream/dummyISstream.H | 160 ++ .../db/IOstreams/dummyIstream/dummyIstream.H | 161 ++ src/OpenFOAM/db/Time/Time.C | 165 +- src/OpenFOAM/db/Time/Time.H | 43 +- src/OpenFOAM/db/Time/TimeIO.C | 83 +- src/OpenFOAM/db/Time/findInstance.C | 135 +- src/OpenFOAM/db/Time/findTimes.C | 62 +- src/OpenFOAM/db/Time/instant/instant.C | 14 +- src/OpenFOAM/db/Time/instant/instant.H | 6 +- src/OpenFOAM/db/Time/timeSelector.C | 7 +- src/OpenFOAM/db/dictionary/dictionaryIO.C | 3 +- .../functionEntries/codeStream/codeStream.C | 59 +- .../functionEntries/codeStream/codeStream.H | 6 +- .../includeEntry/includeEntry.C | 14 +- .../includeEtcEntry/includeEtcEntry.C | 15 +- .../includeIfPresentEntry.C | 11 +- .../dlLibraryTable/dlLibraryTable.C | 8 +- .../IOOutputFilter/IOOutputFilter.C | 6 +- .../IOOutputFilter/IOOutputFilter.H | 4 +- .../functionObjectList/functionObjectList.C | 14 +- .../db/functionObjects/writeFile/writeFile.C | 5 +- .../db/objectRegistry/objectRegistry.C | 7 +- .../db/objectRegistry/objectRegistry.H | 3 +- src/OpenFOAM/db/regIOobject/regIOobject.C | 258 +-- src/OpenFOAM/db/regIOobject/regIOobject.H | 80 +- src/OpenFOAM/db/regIOobject/regIOobjectI.H | 10 +- src/OpenFOAM/db/regIOobject/regIOobjectRead.C | 303 ++- .../db/regIOobject/regIOobjectWrite.C | 116 +- .../GeometricField/GeometricField.C | 27 +- .../UniformDimensionedField.H | 15 +- ...eVaryingUniformFixedValuePointPatchField.C | 3 +- src/OpenFOAM/global/argList/argList.C | 45 +- .../collatedFileOperation/OFstreamCollator.C | 335 ++++ .../collatedFileOperation/OFstreamCollator.H | 167 ++ .../collatedFileOperation.C | 393 ++++ .../collatedFileOperation.H | 138 ++ .../threadedCollatedOFstream.C | 65 + .../threadedCollatedOFstream.H | 92 + .../fileOperation/fileOperation.C | 666 ++++++ .../fileOperation/fileOperation.H | 431 ++++ .../masterUncollatedFileOperation.C | 1781 +++++++++++++++++ .../masterUncollatedFileOperation.H | 715 +++++++ .../masterUncollatedFileOperationTemplates.C | 148 ++ .../uncollatedFileOperation.C | 673 +++++++ .../uncollatedFileOperation.H | 283 +++ src/OpenFOAM/include/OSspecific.H | 67 +- .../interpolation2DTable.C | 2 +- .../interpolationTable/interpolationTable.C | 1 - .../tableReaders/csv/csvTableReader.C | 8 +- .../openFoam/openFoamTableReader.C | 8 +- .../uniformInterpolationTable.C | 3 +- .../polyMesh/globalMeshData/globalMeshData.C | 2 +- .../polyBoundaryMesh/polyBoundaryMesh.C | 5 +- .../polyBoundaryMesh/polyBoundaryMesh.H | 5 +- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 4 +- src/OpenFOAM/meshes/polyMesh/polyMeshIO.C | 2 +- .../preservePatchTypes/preservePatchTypes.C | 5 +- .../primitives/functions/Function1/CSV/CSV.C | 6 +- .../functions/Function1/TableFile/TableFile.C | 4 +- .../primitives/strings/fileName/fileName.C | 11 +- .../primitives/strings/fileName/fileName.H | 7 +- .../primitives/strings/string/string.H | 3 + .../primitives/strings/string/stringI.H | 6 + src/Pstream/mpi/UPstream.C | 19 +- src/conversion/meshReader/meshReader.C | 5 +- src/conversion/meshReader/meshReaderAux.C | 5 +- .../dynamicRefineFvMesh/dynamicRefineFvMesh.C | 7 +- .../dynamicRefineFvMesh/dynamicRefineFvMesh.H | 5 +- .../componentDisplacementMotionSolver.C | 24 +- .../points0/points0MotionSolver.C | 25 +- .../motionSolvers/motionSolver/motionSolver.C | 3 +- .../motionSolvers/motionSolver/motionSolver.H | 5 +- .../polyTopoChange/hexRef8/hexRef8.C | 10 +- .../polyTopoChange/hexRef8/hexRef8.H | 4 +- .../polyTopoChange/hexRef8/hexRef8Data.C | 26 +- src/engine/engineTime/engineTime.H | 4 +- .../cfdTools/general/MRF/IOMRFZoneList.C | 4 +- .../cfdTools/general/fvOptions/fvOptions.C | 6 +- .../porosityModel/IOporosityModelList.C | 2 +- .../CrankNicolsonDdtScheme.C | 2 +- src/finiteVolume/fvMesh/fvMesh.C | 15 +- src/finiteVolume/fvMesh/fvMesh.H | 7 +- .../field/fieldAverage/fieldAverage.C | 2 +- .../fieldCoordinateSystemTransformTemplates.C | 6 +- .../field/readFields/readFieldsTemplates.C | 6 +- .../field/streamLine/streamLine.C | 2 +- .../field/streamLine/streamLineParticle.C | 21 +- .../writeDictionary/writeDictionary.C | 5 +- .../displacementLaplacianFvMotionSolver.C | 4 +- ...polatedDisplacementPointPatchVectorField.C | 2 +- .../Templates/DSMCParcel/DSMCParcelIO.C | 25 +- src/lagrangian/basic/Cloud/Cloud.H | 3 +- src/lagrangian/basic/Cloud/CloudIO.C | 43 +- src/lagrangian/basic/IOPosition/IOPosition.C | 28 +- src/lagrangian/basic/IOPosition/IOPosition.H | 6 +- .../basic/particle/particleTemplates.C | 47 +- .../Templates/KinematicCloud/KinematicCloud.C | 3 +- .../Templates/ReactingCloud/ReactingCloud.C | 2 +- .../ReactingMultiphaseCloud.C | 2 +- .../CollidingParcel/CollidingParcelIO.C | 63 +- .../KinematicParcel/KinematicParcelIO.C | 92 +- .../Templates/MPPICParcel/MPPICParcelIO.C | 17 +- .../ReactingMultiphaseParcelIO.C | 28 +- .../ReactingParcel/ReactingParcelIO.C | 26 +- .../Templates/ThermoParcel/ThermoParcelIO.C | 15 +- .../CloudFunctionObject/CloudFunctionObject.C | 1 + .../FieldActivatedInjection.H | 3 +- .../ManualInjection/ManualInjection.H | 3 +- .../AveragingMethod/AveragingMethod.C | 10 +- .../AveragingMethod/AveragingMethod.H | 2 +- .../molecule/molecule/moleculeIO.C | 56 +- .../pairPotentialList/pairPotentialList.C | 28 +- .../solidParticle/solidParticleIO.C | 15 +- .../Templates/SprayParcel/SprayParcelIO.C | 102 +- .../refinementFeatures/refinementFeatures.C | 7 +- src/meshTools/edgeMesh/edgeMesh.C | 13 +- src/meshTools/edgeMesh/edgeMesh.H | 9 +- .../edgeMeshFormats/edgeMesh/edgeMeshFormat.C | 5 +- .../extendedEdgeMesh/extendedEdgeMesh.C | 7 +- .../extendedEdgeMesh/extendedEdgeMesh.H | 5 +- .../extendedEdgeMeshFormat.C | 8 +- .../extendedFeatureEdgeMesh.C | 9 +- .../extendedFeatureEdgeMesh.H | 20 + .../featureEdgeMesh/featureEdgeMesh.H | 21 + .../triSurfaceMesh/triSurfaceMesh.C | 125 +- .../triSurfaceMesh/triSurfaceMesh.H | 48 +- .../cellSources/fieldToCell/fieldToCell.C | 10 +- src/meshTools/sets/topoSets/cellZoneSet.C | 9 +- src/meshTools/sets/topoSets/cellZoneSet.H | 5 +- src/meshTools/sets/topoSets/faceZoneSet.C | 9 +- src/meshTools/sets/topoSets/faceZoneSet.H | 5 +- src/meshTools/sets/topoSets/pointZoneSet.C | 9 +- src/meshTools/sets/topoSets/pointZoneSet.H | 5 +- .../distributedTriSurfaceMesh.C | 12 +- .../distributedTriSurfaceMesh.H | 25 +- .../reconstruct/reconstructLagrangianFields.C | 13 +- .../regionModel/regionModel/regionModel.C | 3 +- .../rigidBodyMeshMotion/rigidBodyMeshMotion.C | 5 +- .../rigidBodyMeshMotion/rigidBodyMeshMotion.H | 3 +- .../rigidBodyMeshMotionSolver.C | 7 +- .../rigidBodyMeshMotionSolver.H | 5 +- src/sampling/probes/probes.C | 4 +- .../sampledSet/sampledSets/sampledSets.C | 6 +- .../isoSurface/sampledIsoSurface.C | 4 +- .../sampledSurfaces/sampledSurfaces.C | 6 +- .../sixDoFRigidBodyMotionSolver.C | 7 +- .../sixDoFRigidBodyMotionSolver.H | 5 +- .../TDACChemistryModel/TDACChemistryModel.C | 2 +- .../radiativeIntensityRay.C | 2 +- .../radiationModel/radiationModel.C | 2 +- .../radiationModel/radiationModelNew.C | 4 +- .../basicMultiComponentMixture.C | 67 +- .../pyrolysisChemistryModel.C | 4 +- tutorials/IO/fileHandler/0/U | 38 + tutorials/IO/fileHandler/Allrun | 28 + tutorials/IO/fileHandler/constant/g | 22 + .../constant/kinematicCloudPositions | 92 + .../constant/kinematicCloudProperties | 138 ++ .../fileHandler/constant/transportProperties | 24 + .../fileHandler/constant/turbulenceProperties | 21 + tutorials/IO/fileHandler/system/blockMeshDict | 72 + tutorials/IO/fileHandler/system/controlDict | 53 + .../IO/fileHandler/system/decomposeParDict | 45 + tutorials/IO/fileHandler/system/fvSchemes | 43 + tutorials/IO/fileHandler/system/fvSolution | 22 + .../BernardCells/system/blockMeshDict | 5 +- .../iglooWithFridges/Allrun | 16 + 303 files changed, 13626 insertions(+), 2129 deletions(-) mode change 120000 => 100644 applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H create mode 100644 applications/test/IOField/Make/files create mode 100644 applications/test/IOField/Make/options create mode 100644 applications/test/IOField/Test-IOField.C create mode 100644 applications/test/decomposedBlockData/Make/files create mode 100644 applications/test/decomposedBlockData/Make/options create mode 100644 applications/test/decomposedBlockData/Test-decomposedBlockData.C create mode 100644 src/OpenFOAM/db/IOobject/IOobjectTemplates.C create mode 100644 src/OpenFOAM/db/IOobjects/GlobalIOField/GlobalIOField.C create mode 100644 src/OpenFOAM/db/IOobjects/GlobalIOField/GlobalIOField.H create mode 100644 src/OpenFOAM/db/IOobjects/GlobalIOField/GlobalIOFields.C create mode 100644 src/OpenFOAM/db/IOobjects/GlobalIOList/GlobalIOList.C create mode 100644 src/OpenFOAM/db/IOobjects/GlobalIOList/GlobalIOList.H create mode 100644 src/OpenFOAM/db/IOobjects/GlobalIOList/globalIOLists.C create mode 100644 src/OpenFOAM/db/IOobjects/GlobalIOList/globalIOLists.H create mode 100644 src/OpenFOAM/db/IOobjects/IOdictionary/baseIOdictionary.C create mode 100644 src/OpenFOAM/db/IOobjects/IOdictionary/baseIOdictionary.H create mode 100644 src/OpenFOAM/db/IOobjects/IOdictionary/baseIOdictionaryIO.C create mode 100644 src/OpenFOAM/db/IOobjects/IOdictionary/localIOdictionary.C create mode 100644 src/OpenFOAM/db/IOobjects/IOdictionary/localIOdictionary.H create mode 100644 src/OpenFOAM/db/IOobjects/IOdictionary/unwatchedIOdictionary.C create mode 100644 src/OpenFOAM/db/IOobjects/IOdictionary/unwatchedIOdictionary.H create mode 100644 src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.C create mode 100644 src/OpenFOAM/db/IOobjects/decomposedBlockData/decomposedBlockData.H create mode 100644 src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.C create mode 100644 src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.H create mode 100644 src/OpenFOAM/db/IOstreams/dummyISstream/dummyISstream.H create mode 100644 src/OpenFOAM/db/IOstreams/dummyIstream/dummyIstream.H create mode 100644 src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C create mode 100644 src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.H create mode 100644 src/OpenFOAM/global/fileOperations/collatedFileOperation/collatedFileOperation.C create mode 100644 src/OpenFOAM/global/fileOperations/collatedFileOperation/collatedFileOperation.H create mode 100644 src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.C create mode 100644 src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.H create mode 100644 src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C create mode 100644 src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.H create mode 100644 src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C create mode 100644 src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.H create mode 100644 src/OpenFOAM/global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperationTemplates.C create mode 100644 src/OpenFOAM/global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C create mode 100644 src/OpenFOAM/global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.H create mode 100644 tutorials/IO/fileHandler/0/U create mode 100755 tutorials/IO/fileHandler/Allrun create mode 100644 tutorials/IO/fileHandler/constant/g create mode 100644 tutorials/IO/fileHandler/constant/kinematicCloudPositions create mode 100644 tutorials/IO/fileHandler/constant/kinematicCloudProperties create mode 100644 tutorials/IO/fileHandler/constant/transportProperties create mode 100644 tutorials/IO/fileHandler/constant/turbulenceProperties create mode 100644 tutorials/IO/fileHandler/system/blockMeshDict create mode 100644 tutorials/IO/fileHandler/system/controlDict create mode 100644 tutorials/IO/fileHandler/system/decomposeParDict create mode 100644 tutorials/IO/fileHandler/system/fvSchemes create mode 100644 tutorials/IO/fileHandler/system/fvSolution diff --git a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H index 401917f55..02b48f8d2 100644 --- a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H +++ b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H @@ -9,7 +9,7 @@ IOobject phiBHeader surfaceScalarField* phiBPtr = nullptr; -if (phiBHeader.headerOk()) +if (phiBHeader.typeHeaderOk(true)) { Info<< "Reading face flux "; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H deleted file mode 120000 index f2ec2a0ce..000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H +++ /dev/null @@ -1 +0,0 @@ -../../fluid/residualControlsFluid.H \ No newline at end of file diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H new file mode 100644 index 000000000..fa95ed86e --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/residualControlsFluid.H @@ -0,0 +1,56 @@ +// Residual control used +if (residualControlUsed) +{ + bool UConv = false; + bool p_rghConv = false; + bool EConv = false; + + // Check which field is not used for control + { + if (UTol == -1 || !momentumPredictor) + { + UConv = true; + } + + if (p_rghTol == -1) + { + p_rghConv = true; + } + + if (ETol == -1) + { + EConv = true; + } + } + + // Get the last initial residual of the solvers + if (momentumPredictor && !UConv) + { + if (UTol > cmptMax(solvPerfU.initialResidual())) + { + UConv = true; + } + } + + if (!p_rghConv) + { + if (p_rghTol > solvPerfp_rgh.initialResidual()) + { + p_rghConv = true; + } + } + + if (!EConv) + { + if (ETol > solvPerfE.initialResidual()) + { + EConv = true; + } + } + + // Check if each field is converged + if (UConv && p_rghConv && EConv) + { + resReachedFluid = true; + } +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H index 82261f535..857f97f24 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -79,7 +79,7 @@ IOobject::AUTO_WRITE ); - if (betavSolidIO.headerOk()) + if (betavSolidIO.typeHeaderOk(true)) { betavSolid.set ( diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H index 73a157fc1..e7da9c6af 100644 --- a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H +++ b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H @@ -11,7 +11,7 @@ IOobject turbulencePropertiesHeader false ); -if (turbulencePropertiesHeader.headerOk()) +if (turbulencePropertiesHeader.typeHeaderOk(true)) { autoPtr turbulence ( diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H index d2be5bdd0..77287eed8 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createFields.H @@ -81,7 +81,7 @@ IOobject Hheader autoPtr HPtr; -if (Hheader.headerOk()) +if (Hheader.typeHeaderOk(true)) { Info<< "\nReading field H\n" << endl; @@ -99,7 +99,7 @@ IOobject HdotGradHheader autoPtr HdotGradHPtr; -if (HdotGradHheader.headerOk()) +if (HdotGradHheader.typeHeaderOk(true)) { Info<< "Reading field HdotGradH" << endl; diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H index abaede938..731a8196d 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/createNonInertialFrameFields.H @@ -11,7 +11,13 @@ autoPtr linearAccelerationPtr; - if (linearAccelerationHeader.headerOk()) + if + ( + linearAccelerationHeader.typeHeaderOk + ( + true + ) + ) { Info<< " Reading " << linearAccelerationHeader.name() << endl; @@ -33,7 +39,7 @@ autoPtr angularVelocityPtr; - if (angularVelocityHeader.headerOk()) + if (angularVelocityHeader.typeHeaderOk(true)) { Info<< " Reading " << angularVelocityHeader.name() << endl; @@ -55,7 +61,13 @@ autoPtr angularAccelerationPtr; - if (angularAccelerationHeader.headerOk()) + if + ( + angularAccelerationHeader.typeHeaderOk + ( + true + ) + ) { Info<< " Reading " << angularAccelerationHeader.name() << endl; @@ -77,7 +89,13 @@ autoPtr centreOfRotationPtr; - if (centreOfRotationHeader.headerOk()) + if + ( + centreOfRotationHeader.typeHeaderOk + ( + true + ) + ) { Info<< " Reading " << centreOfRotationHeader.name() << endl; diff --git a/applications/solvers/multiphase/VoF/createAlphaFluxes.H b/applications/solvers/multiphase/VoF/createAlphaFluxes.H index 2bf716cc5..72da18386 100644 --- a/applications/solvers/multiphase/VoF/createAlphaFluxes.H +++ b/applications/solvers/multiphase/VoF/createAlphaFluxes.H @@ -7,7 +7,7 @@ IOobject alphaPhi10Header IOobject::AUTO_WRITE ); -const bool alphaRestart = alphaPhi10Header.headerOk(); +const bool alphaRestart = alphaPhi10Header.typeHeaderOk(); // MULES flux from previous time-step surfaceScalarField alphaPhi10 diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C index 1751e404a..a1990a88c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C @@ -123,7 +123,7 @@ Foam::phaseModel::phaseModel IOobject::NO_READ ); - if (phiHeader.headerOk()) + if (phiHeader.typeHeaderOk(true)) { Info<< "Reading face flux field " << phiName << endl; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index 6e5aac34d..0aa04c362 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ Foam::MovingPhaseModel::phi(const volVectorField& U) const IOobject::NO_READ ); - if (phiHeader.headerOk()) + if (phiHeader.typeHeaderOk(true)) { Info<< "Reading face flux field " << phiName << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C index dab711fb2..87a249277 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C @@ -121,7 +121,7 @@ Foam::phaseModel::phaseModel IOobject::NO_READ ); - if (phiHeader.headerOk()) + if (phiHeader.typeHeaderOk(true)) { Info<< "Reading face flux field " << phiName << endl; diff --git a/applications/test/CompactIOList/Test-CompactIOList.C b/applications/test/CompactIOList/Test-CompactIOList.C index 12d64c6bd..2024e663e 100644 --- a/applications/test/CompactIOList/Test-CompactIOList.C +++ b/applications/test/CompactIOList/Test-CompactIOList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,7 +87,8 @@ int main(int argc, char *argv[]) ( format, IOstream::currentVersion, - IOstream::UNCOMPRESSED + IOstream::UNCOMPRESSED, + true ); Info<< "Written old format faceList in = " @@ -149,7 +150,8 @@ int main(int argc, char *argv[]) ( format, IOstream::currentVersion, - IOstream::UNCOMPRESSED + IOstream::UNCOMPRESSED, + true ); Info<< "Written new format faceList in = " diff --git a/applications/test/IOField/Make/files b/applications/test/IOField/Make/files new file mode 100644 index 000000000..74e614dea --- /dev/null +++ b/applications/test/IOField/Make/files @@ -0,0 +1,3 @@ +Test-IOField.C + +EXE = $(FOAM_USER_APPBIN)/Test-IOField diff --git a/applications/test/IOField/Make/options b/applications/test/IOField/Make/options new file mode 100644 index 000000000..6a9e9810b --- /dev/null +++ b/applications/test/IOField/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/IOField/Test-IOField.C b/applications/test/IOField/Test-IOField.C new file mode 100644 index 000000000..d49acaf8f --- /dev/null +++ b/applications/test/IOField/Test-IOField.C @@ -0,0 +1,189 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + Test-IOField + +Description + Test the processor-local reading of IOField (used in the lagrangian libs) + +\*---------------------------------------------------------------------------*/ + +#include "IOField.H" +#include "argList.H" +#include "polyMesh.H" +#include "Time.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +void write(const IOobject& io, const label sz) +{ + IOField