Commit Graph

113 Commits

Author SHA1 Message Date
d901b4f450 ENH: reduce profiling overhead (issue #764)
- avoid clockTime in favour of clockValue.

- avoid allocations when profiling is not active.

- replace hashing with manual pointer lists
2018-03-26 21:38:47 +02:00
36719bf55b STYLE: consistent lookupOrDefault template parameters
- in many cases can just use lookupOrDefault("key", bool) instead of
  lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a
  bool from an Istream uses the Switch(Istream&) anyhow

STYLE: relocated Switch string names into file-local scope
2018-03-26 09:09:09 +02:00
345a2a42f1 ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
  and HashTable method names. This improves method name consistency
  between classes and also requires less typing effort:

    args.found(optName)        vs.  args.optionFound(optName)
    args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
    ...
    args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
    args.read<scalar>(index)   vs.  args.argRead<scalar>(index)

- the older method names forms have been retained for code compatibility,
  but are now deprecated
2018-01-08 15:35:18 +01:00
ca5b0dcbaa ENH: improvements to Time
- expose the names of write and stopAt controls for reuse elsewhere and
  provide a stopAtControls enum for 'unknown'

- track the requested number of sub-cycles (was previously a bool)
2017-11-28 10:11:06 +01:00
fab9fb4332 STYLE: use readScalar(std::string) and readInt(std::string) wrappers 2017-11-28 10:08:36 +01:00
416a3790ea STYLE: prefer autoPtr::reset() to autoPtr::set()
- in most cases already checked valid() so don't need additional check
  for setting an existing pointer
2017-11-22 19:11:11 +01:00
d8d6030ab6 INT: Integration of Mattijs' collocated parallel IO additions
Original commit message:
------------------------

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
b287d1bddd CONFIG: cpu/sys information in profiling now OFF by default (issue #526)
- since the cpu/sys information is invariant, it doesn't make much
  sense to emit by default at every time-step.
2017-07-14 16:41:15 +02:00
f55c568f13 ENH: upgrade from NamedEnum to Enum (issue #515) 2017-07-03 21:43:33 +02:00
2e9bead519 MRG: merged develop line back into integration branch 2017-05-18 11:11:12 +01:00
6a583851bc ENH: support profiling on Time loop (issue #441)
- patch from Bernhard Gschaider
2017-04-19 09:52:17 +02:00
27776b09b0 ENH: support default profiling settings from etc/controlDict (issue #441)
- patch from Bernhard Gschaider
2017-04-19 01:20:51 +02:00
befb49af10 STYLE: add parameter names for Time.H (doxygen)
- consistent use of watchIndex vs watchFd
2017-04-19 09:34:27 +02:00
498fa94cb3 ENH: timeActivatedFileUpdate: avoid copying on master; simplified logic; Fixes #420. 2017-04-06 14:45:16 +01:00
2da2970c7c BUG: timeActivatedFileUpdate: was potentially rereading itself!
Fixed by setting flag which then gets queried by Time. Fixes #420.
2017-04-06 10:26:16 +01:00
dcb1a95e35 MRG: Integrated Foundation code to commit 7d6845d 2017-03-23 14:33:33 +00:00
4b93333292 ENH: improve handling of noFunctionObjects / withFunctionObjects (issue #352)
- do not enable function objects by default if there is no means of
  disabling them.
2017-03-07 10:53:40 +01:00
4401c0ee87 BUG: Time: time step adjustment not robust. Fixes #414. 2017-03-01 11:43:00 +00:00
78ee6c2abb Time: When increasing precision check if the time name is unchanged
Patch contributed by Mattijs Janssens
2017-02-03 14:27:38 +00:00
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +00:00
f281f77e4a Updated member type comments
Resolves bug-report http://bugs.openfoam.org/view.php?id=2356
2016-11-28 21:23:00 +00:00
b9940cbbb1 COMP: Multiple changes - first clean build after latest merge - UNTESTED 2016-09-23 15:36:53 +01:00
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
ddd4f9f2ef functionObject: change default behavior of 'end()' to do nothing rather than calling execute and write
Time: call functionObject 'execute()' and 'end()' for last time-step

Now the operation of functionObject 'end()' call is consistent between running and post-processing
2016-08-12 21:46:21 +01:00
85e246b8f2 BUG: profiling dictionary could be binary/compressed (fixed #157)
BUG: memInfo not activated by -profiling option (fixed #157)
2016-06-22 17:20:15 +02:00
37bf28c249 STYLE: rename Profiling -> profiling 2016-06-20 21:20:31 +02:00
be73d81a22 ENH: support '-profiling' command-line option
- this option overrides any controlDict settings as a convenient means
  to selecting profiling without messing with the controlDict.

- provide Profiling::writeNow() to emit profiling for utilities that
  don't have any natural time increment mechanism to trigger it.
2016-06-17 23:45:03 +02:00
2dc31390df ENH: add some system information when outputting profiling
- basic cpuInfo (model identification, MHz, etc)
- process memInfo

- profiling is activated via the case system/controlDict by
  adding a "profiling" sub-dictionary.

  Simply add the following (everything enabled):

      profiling
      {}

  Which corresponds to the longer form:

      profiling
      {
          active      true;  // default: true
          cpuInfo     true;  // default: true
          memInfo     true;  // default: true
          sysInfo     true;  // default: true
      }

  This can be used to selectively disable any extra information
  (eg, you don't want anyone else to know what hardware was used).
2016-06-15 20:17:44 +02:00
ef34e60e2d ENH: add profiling code from Bernhard Gschaider
- activate via the case's <system/controlDict>:

      profiling   yes;
2016-06-08 16:38:10 +01:00
9ab102bce3 STYLE: reduce code duplication in Time.C 2016-06-08 16:33:46 +01:00
5af1a7e4f3 functionObjects::partialWrite: Redundant and removed
the equivalent functionality is provided by the writeRegisteredObject
   functionObject in a MUCH simpler, easier and extensible manner.

functionObject: Removed the now redundant 'timeSet' function.
2016-05-18 12:23:29 +01:00
6164c2f262 Standardized the naming of functions which control the writing of fields etc.
to have the prefix 'write' rather than 'output'

So outputTime() -> writeTime()

but 'outputTime()' is still supported for backward-compatibility.

Also removed the redundant secondary-writing functionality from Time
which has been superseded by the 'writeRegisteredObject' functionObject.
2016-05-12 17:38:01 +01:00
32dbb01e96 functionObjectList: Rationalized and simplified the handling of disabled functionObjects
Simplified and generalized the handling of functionObjects which fail to
construct by removing them from the list rather than maintaining an
"enabled" switch in each functionObject.
2016-05-11 09:03:52 +01:00
fd9d801e2d GIT: Initial commit after latest foundation merge 2016-04-25 11:40:48 +01:00
3963149c05 src/OpenFOAM: Moved function documentation comments into .H files and removed duplicates 2016-02-29 21:21:41 +00:00
9e3ce4ec7f Merge branch 'master' of develop.openfoam.com:Development/OpenFOAM-plus into feature-shared-file
Conflicts:
	applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
	applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/pointFile/pointFile.C
	applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundary.C
	applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
	applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/vtkPV4Foam/vtkPV4FoamUpdateInfo.C
	applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C
	applications/utilities/postProcessing/velocityField/Co/Co.C
	applications/utilities/postProcessing/velocityField/Pe/Pe.C
	applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C
	applications/utilities/preProcessing/changeDictionary/changeDictionary.C
	applications/utilities/preProcessing/setFields/setFields.C
	applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
	applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
	applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C
	applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C
	src/OpenFOAM/db/IOobject/IOobject.C
	src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C
	src/OpenFOAM/db/IOobjects/IOField/IOField.C
	src/OpenFOAM/db/IOobjects/IOList/IOList.C
	src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C
	src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C
	src/OpenFOAM/db/Time/findInstance.C
	src/OpenFOAM/db/regIOobject/regIOobject.C
	src/OpenFOAM/db/regIOobject/regIOobjectI.H
	src/OpenFOAM/db/regIOobject/regIOobjectRead.C
	src/OpenFOAM/db/regIOobject/regIOobjectWrite.C
	src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/IOmapDistribute.C
	src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
	src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C
	src/dynamicMesh/fvMeshDistribute/IOmapDistributePolyMesh.C
	src/dynamicMesh/motionSolver/componentDisplacement/componentDisplacementMotionSolver.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8Data.C
	src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C
	src/dynamicMesh/polyTopoChange/polyTopoChanger/polyTopoChanger.C
	src/edgeMesh/edgeMeshFormats/edgeMesh/edgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C
	src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C
	src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationMotionSolver.C
	src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.C
	src/lagrangian/basic/Cloud/CloudIO.C
	src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C
	src/postProcessing/foamCalcFunctions/basic/addSubtract/addSubtract.C
	src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C
	src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C
	src/thermophysicalModels/radiation/radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C
	src/triSurface/triSurface/surfacePatch/surfacePatchIOList.C
2016-01-25 16:29:04 +00:00
e424059208 ENH: glboal file handling: initial commit
Moved file path handling to regIOobject and made it type specific so
now every object can have its own rules. Examples:
- faceZones are now processor local (and don't search up anymore)
- timeStampMaster is now no longer hardcoded inside IOdictionary
  (e.g. uniformDimensionedFields support it as well)
- the distributedTriSurfaceMesh is properly processor-local; no need
  for fileModificationChecking manipulation.
2016-01-25 13:03:15 +00:00
8f1d043364 GIT: Resolved conflict 2015-12-09 09:32:38 +00:00
3e5da0bcf2 ENH: functionObjects: call execute on last time step
- old convention was that on last time step it would only call end()
and not execute()
- however this meant that e.g. the functionObjectProperties file
did not get written
- and almost all functionObjects were doing an execute() inside of end()
- new convention: call execute() on last time step, just before doing end()
2015-12-03 17:39:34 +00:00
dc43311e62 src/OpenFOAM: Update ...IOErrorIn -> ...IOErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 21:13:04 +00:00
36ca836f28 Time: Correct precision adjustment for user-time 2015-05-20 12:43:54 +01:00
c28036665d potentialFoam: No longer executes functionObjects by default
Use the new -withFunctionObjects command-line option to execute functionObjects
2015-04-25 21:56:14 +01:00
ddb82aa14c Time: Corrected message when maximum time-precision is reached
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=815
2015-03-22 09:48:49 +00:00
3c2679c4bd Time: Adjust the precision of the time-directories only for write-times
Avoids unnecessary increases in precision during intermediate steps for
cases with adjustable time-step which may require very high precision to
represent the time name.
2015-03-15 18:49:52 +00:00
5c21051349 Time: Increase the precision the value entry is written in uniform/time
Add check for round-off error causing time reversal
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=815
2015-03-14 20:33:51 +00:00
b6e5ecc45f Time: Improved tolerance used to test time equivalence from Bruno
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=815
2015-03-08 21:02:51 +00:00
beb27a76a7 Update headers 2015-03-08 16:31:32 +00:00
7f3fb82ba0 Time: Handle precision changes on start-up and running more robustly
Changes based on patches from and discussions with Bruno Santos
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=815
2015-03-08 16:29:01 +00:00
b6fbff5229 Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev 2013-09-09 15:37:02 +01:00
0752591f4a ENH: Time: fast time comparison 2013-09-09 15:36:51 +01:00