Commit Graph

34 Commits

Author SHA1 Message Date
69786840af STYLE: code cleanup for includeEntry 2017-10-29 11:34:09 +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
5148e4f860 STYLE: manage dictionary inputMode directly within entry class
- The logic for switching input-mode was previously completely
  encapsulated within the #inputMode directive, but without any
  programming equivalent. Furthermore, the encapsulation in inputMode
  made the logic less clear in other places.

  Exposing the inputMode as an enum with direct access from entry
  simplifies things a fair bit.

- eliminate one level of else/if nesting in entryIO.C for clearer logic

- for dictionary function entries, simply use
  addNamedToMemberFunctionSelectionTable() and avoid defining a type()
  as a static. For most function entries the information is only used
  to get a name for the selection table lookup anyhow.
2017-08-03 07:14:17 +02:00
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
6a53ed41ba Doxygen documentation: Standardized the 'See also' heading 2016-06-17 17:31:34 +01:00
a9492b074f Updated headers 2016-05-31 17:18:14 +01:00
7c45066996 includeEntry, includeEtcEntry, includeIfPresentEntry: report -> log
for consistency with the 'Log' macro.
2016-05-31 17:17:24 +01:00
70525fe75e ENH: include file tracking: missed out adding files to list of files to check 2016-01-27 17:35:46 +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
6d383b6c0f ENH: includeEntry: allow ~ expansion; better error message 2013-07-05 09:01:54 +01:00
6dc4de7d3f ENH: dictionary: recursive variable expansion 2012-10-15 16:00:03 +01:00
f17c43948b ENH: #include: allow recursive substitution 2012-10-12 17:37:38 +01:00
0c9d650367 BUG: includeEntry: allow environment variables 2012-10-12 14:45:57 +01:00
dced4a082a ENH: #include: allow dictionary variables in include paths 2012-10-12 12:23:34 +01:00
f763bca42e BUG: #include of empty filename creates confusing error message (Mark Olesen)
When using #include or #includeIfPresent, it is easy to generate an
empty file name. For example,

    #include "~OpenFOAM/missing-path/file"

On error, findEtcFile() returns an empty fileName. This was treated as
a relative name, which meant there was an attempt to open the parent directory
as a file. The resulting error message was confusing:

    --> FOAM FATAL IO ERROR:
    Attempt to put back onto bad stream

    file: /CASE/PATH/system at line 1.

        From function void Istream::putBack(const token&)
        in file db/IOstreams/IOstreams/Istream.C at line 34.

- fix by leaving empty expansions as-is
2012-08-09 15:17:24 +01:00
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
cba7dc8e25 ENH: Removed unnecessary size check when used with isFileAbsolute 2011-07-28 13:06:52 +01:00
c20efb0923 ENH: add 'report' to trace #includeEntry/#includeIfPresentEntry
- used in "expandDictionary -list" to find which files are included by
  any particular dictionary
2011-04-15 13:34:25 +02:00
c3cb632c24 Documentation: converted javadoc @ to LaTeX style \ in Doxygen code docs 2011-02-08 18:22:00 +00:00
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
64fe671850 ENH: Added isAbsolute() function to fileName class 2010-11-02 18:06:27 +00:00
d79237597e STYLE: Fixing code style requirements for all src. 2010-07-28 13:31:46 +01:00
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
4f6f570d6d versatility improvement: #includeIfPresent dictionary directive
- similar to the #include directive, but does not generate an error if the
  file does not exist.

Note: opted for an explicit naming #includeIfPresent rather than #cinclude
2009-07-21 08:44:25 +02:00
28258d11bd Removed Cint support. 2009-06-23 12:13:33 +01:00
6e10b0defd adjusted dictionary #inputMode directive
- #inputMode error
  now issues a FatalError on duplicate entries

- #inputMode warn
  issues a warning on duplicate entries, corresponds to the
  old behaviour of 'error'

- #inputMode protect
  prevents overwriting existing entries

The 'protect' mode provides a simple mechanism for supplying default values.
eg,
    in file1:
        #inputMode  protect
        intensity       0.1;
        mixingLength    0.005;
        #inputMode  merge

        inlet
        {
            type        turbulentIntensityKineticEnergyInlet;
            intensity   $intensity;
        }

    which is included from file2:

        intensity   0.05;
        #include    "file1"
2009-05-05 13:18:29 +02:00
0bada1e31b dictionary cosmetics
- partial revert for commit d21869b580
  * only add extra newlines for a top-level dictionary that is output as such

- make "#inputMode merge" the default instead of "#inputMode error"
  * this corresponds to a very common usage case
2009-03-18 13:15:17 +01:00
28b200bcd9 update copyrights for 2009 2008-12-31 19:01:56 +01:00
02cabc3cf2 updated Copyright (C) \d+-2008 OpenCFD Ltd. 2008-06-25 15:01:46 +02:00
1e8d4b2a82 dictionary functionEntries cleanup
* added '#remove' function
  * changed insert() method name to more general execute()
  * using #inputMode or #remove within a primitiveEntry now provokes an error
  * adjusted the dictionaryTest accordingly
2008-06-13 10:43:31 +02:00
5f3ad4de93 Avoid segfault if a '#directive' is used in the global controlDict 2008-05-23 10:13:53 +02:00
3170c7c0c9 Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00