Commit Graph

7530 Commits

Author SHA1 Message Date
Mark Olesen
8ee4b52560 ENH: provide MPI native bitOrOp reduce with single/multiple values
- can be used, for example, to track global states:

      // Encode as 0:empty, 1:uniform, 2:nonuniform, 3:mixed
      PackedList<2> uniformity(fields.size());

      forAll(fields, i)
      {
          uniformity.set(i, fields[i].whichUniformity());
      }

      reduce
      (
          uniformity.data(),
          uniformity.size_data(),
          bitOrOp<unsigned>()
      );
2023-07-05 15:14:26 +02:00
Mark Olesen
a1e34bb251 ENH: use mapDistribute linear construct order in a few places
- simplifies code by avoiding code duplication:
  * parLagrangianDistributor
  * meshToMesh (processorLOD and AABBTree methods)

BUG: inconsistent mapping when using processorLOD boxes (fixes #2932)

- internally the processorLODs createMap() method used a 'localFirst'
  layout whereas a 'linear' order is what is actually expected for the
  meshToMesh mapping. This will cause of incorrect behaviour
  if using processorLOD instead of AABBTree.
  A dormant bug since processorLOD is not currently selectable.
2023-07-04 20:29:07 +02:00
Mark Olesen
5635e14f81 ENH: add low-level polymorphic/boxed exprValue
- primarily for handling expression results,
  but can also be used as a universal value holder.

  Has some characteristics suitable for type-less IO:
  eg, is_integral(), nComponents()

ENH: add is_pointer() check for expression scanToken
2023-07-04 17:25:26 +02:00
Mark Olesen
d5a0eaeeee STYLE: changes to Time and TimeState
- update TimeState access methods

- use writeTime() instead of old method name outputTime()

- use deltaTValue() instead of deltaT().value()
  to avoids pointless construct of intermediate
2023-07-04 17:25:25 +02:00
Andrew Heather
763bf4674d RELEASE: Updated headers to v2306 2023-06-28 16:35:48 +01:00
mattijs
2d145e070e COMP: chtMultiRegionTwoPhaseEulerFoam: compile local files only 2023-06-28 16:35:47 +01:00
mattijs
4d7c827bd7 ENH: checkMesh: report on processor patch if non-parallel. Fixes #698 2023-06-26 12:14:30 +01:00
Mark Olesen
642d8a9dfa COMP: guards around #define OMPI_SKIP_MPICXX (avoids compiler warnings) 2023-06-23 16:05:19 +02:00
mattijs
09edb23c1d BUG: collated fails with controlDict watch files
- files might have been set during token reading so only on
  known on master processor.
  Broadcast names to all processors (even alhough they are only
  checked on master) so that the watched states remain synchronised
2023-06-21 14:56:06 +02:00
Mark Olesen
fc86e52451 ENH: extrapolateInternal() method for patch fields
- provides a more succinct way of writing

      {fa,fv}PatchField<Type>::patchInternalField(*this)

  as well as a consistent naming that can be used for patches derived
  from valuePointPatchField

ENH: readGradientEntry helper method for fixedGradient conditions

- simplifies coding and logic.
- support different read construct modes for fixedGradient
2023-06-19 17:47:03 +02:00
Mark Olesen
f9d0895707 ENH: avoid spurious library loading for decomposePar, redistributePar
- individual processor Time databases are purely for internal logistics
  and should not be introducing any new library symbols: these will
  already have been loaded in the outer loop.
2023-06-19 17:05:45 +02:00
Mark Olesen
4412566c58 ENH: support command-line specification of MPI threads (#2791)
- MPI_THREAD_MULTIPLE is usually undesirable for performance reasons,
  but in some cases may be necessary if a linked library expects it.
  Provide a '-mpi-threads' option to explicitly request it.

ENH: consolidate some looping logic within argList
2023-06-19 17:05:45 +02:00
Mark Olesen
1cdba9b269 ENH: make checkMesh writing of bad edges optional (#2771)
- primarily relevant for finite-area meshes, in which case they can be
  considered to be an additional, detailed diagnositic that is
  normally not needed (clutters the file system).

  Writing can be enabled with the `-write-edges` option.
2023-06-13 20:41:53 +02:00
Andrew Heather
b87db82c05 ENH: particleTracks - reinstated label field output 2023-06-13 14:13:58 +01:00
Mark Olesen
1c9ea038d0 MISC: additional -repeat option for testing MPI_Comm leakage (#1598) 2023-06-12 13:59:47 +02:00
mattijs
adc38d55ac ENH: coupled: enforce consistency. See #2783 2023-06-01 08:14:42 +00:00
mattijs
fcbfa40b0b ENH: checkMesh: small message change 2023-05-30 10:41:15 +01:00
Mark Olesen
8d2bf3fc2e ENH: soft update of autoPtr<fileOperation> to refPtr<fileOperation>
Co-authored-by: mattijs <mattijs>
2023-05-23 15:03:23 +02:00
Mark Olesen
8a060e87cb ENH: fileHandler support for faMeshDistributor and field distributors
- fatten the interface to continue allowing write control with a bool
  or with a dedicated file handler. This may slim down in the future.

Co-authored-by: mattijs <mattijs>
2023-05-23 15:01:09 +02:00
Mark Olesen
d34dfbe0b7 ENH: dummy fileOperation: placeholder for interfaces taking a reference
STYLE: align readOnProc/writeOnProc naming within masterUncollated
2023-05-23 11:12:37 +02:00
Mark Olesen
a34262966b STYLE: use fileOperation nProcs() instead of setNProcs() 2023-05-22 18:04:21 +02:00
Mark Olesen
821d395259 ENH: use refPtr fileHandler in decomposeFaFields, faMeshReconstructor 2023-05-22 17:59:33 +02:00
Mark Olesen
06147dabe7 ENH: more flexible handling of FOAM_IORANKS
- accept plain lists (space or comma separated) as well as the
  traditional OpenFOAM lists. This simplifies argument handling
  with job scripts.

  For example,
     simpleFoam -ioRanks 0,4,8 ...
  vs
     simpleFoam -ioRanks '(0 4 8)'  ...

  It is also possible to select the IO ranks on a per-host basis:

     simpleFoam -ioRanks host  ...

- expose rank/subrank handling as static fileOperation methods
2023-05-22 17:59:30 +02:00
Mark Olesen
11742301f1 ENH: add support for file/directory broadcasting
Co-authored-by: mattijs <mattijs>
2023-05-22 17:48:09 +02:00
Mark Olesen
9cd14bc8b0 STYLE: remove unused isWriteProc() methods from distribute fields 2023-05-22 17:46:16 +02:00
Mark Olesen
5eebc75845 ENH: improved UPstream gather/scatter functionality
- added UPstream::allGatherValues() with a direct call to MPI_Allgather.
  This enables possible benefit from a variety of internal algorithms
  and simplifies the caller

    Old:
        labelList nPerProc
        (
            UPstream::listGatherValues<label>(patch_.size(), myComm)
        );
        Pstream::broadcast(nPerProc, myComm);

    New:

        const labelList nPerProc
        (
            UPstream::allGatherValues<label>(patch_.size(), myComm)
        );

- Pstream::allGatherList uses MPI_Allgather for contiguous values
  instead of the hand-rolled tree walking involved with
  gatherList/scatterList.

-
- simplified the calling parameters for mpiGather/mpiScatter.

  Since send/recv data types are identical, the send/recv count
  is also always identical. Eliminates the possibility of any
  discrepancies.

  Since this is a low-level call, it does not affect much code.
  Currently just Foam::profilingPstream and a UPstream internal.

BUG: call to MPI_Allgather had hard-coded MPI_BYTE (not the data type)

- a latent bug since it is currently only passed char data anyhow
2023-05-22 17:18:35 +02:00
Mark Olesen
302eb7b560 REGRESSION: createBaffles : incorrect dictionary lookup
- was introduced with f7a7f1c14c, only affected very recent develop
2023-05-20 18:59:20 +02:00
Mark Olesen
bc51caac32 ENH: remove sign from SHA1Digest cdata_bytes(), data_bytes()
- this refinement of commit 81807646ca makes these methods
  consistent with other objects/containers.

  The 'unsigned char' access is still available via cdata()
2023-05-19 15:54:23 +02:00
Mark Olesen
f41d1879b9 STYLE: prefer isHeaderClass<Type>() check instead of Type::typeName
- use typeHeaderOk<regIOobject>(false) for some generic file existence
  checks. Often had something like labelIOField as a placeholder, but
  that may be construed to have a particular something.
2023-05-19 00:48:14 +02:00
Mark Olesen
87cb811db2 COMP: fix library linkage (#2784), silence some unused variable warnings 2023-05-19 00:46:52 +02:00
Mark Olesen
a5d9ad3a5c STYLE: use noexcept creation of InfoProxy and dereference as '*iproxy'
- this removes the 'magic' use of the exposed t_ member in favour
  of a generic dereference
2023-05-18 18:23:46 +02:00
Mark Olesen
f7a7f1c14c ENH: reduced warnings about createBaffles on processor patches (#2781)
- coupled patches are treated distinctly and independently of
  internalFacesOnly, it makes little sense to report them with a
  warning about turning off boundary faces (which would not work
  anyhow).

STYLE: update code style for createBaffles
2023-05-17 11:46:57 +02:00
Mark Olesen
a581a8cb8d ENH: disallow implicit cast of autoPtr to non-const pointer
- permitting a cast to a non-const pointer adds uncertainty of
  ownership.

- adjust PtrDynList transfer. Remove the unused 'PtrDynList::remove()'
  method, which is better handled with pop().
2023-05-17 11:46:57 +02:00
Kutalmis Bercin
59b1cf080e ENH: Tensor/SymmTensor: add devSymm and devTwoSymm funcs to avoid intermediates 2023-05-15 17:05:10 +01:00
Mark Olesen
783934ccad ENH: add global topology check in checkMesh and makeFaMesh (#2771)
- detect when boundary patches are multiply connected across edges

STYLE: initialize some faMesh values
2023-05-09 19:30:58 +02:00
Mark Olesen
31600c96d4 ENH: output finiteArea patchID with foamToVTK -with-ids
- can be quite useful for debugging/orientation with complex
  geometries
2023-05-09 19:30:58 +02:00
Mark Olesen
f462a850ce ENH: added polyBoundaryMesh patchID(meshFacei) method
- this complements the whichPatch(meshFacei) method [binary search]
  and the list of patchID() by adding internal range checks.

  eg,
     Before
     ~~~~~~
     if (facei >= mesh.nInternalFaces() && facei < mesh.nFaces())
     {
         patchi = pbm.patchID()[facei - mesh.nInternalFaces()];
         ...
     }

     After
     ~~~~~
     patchi = pbm.patchID(facei);

     if (patchi >= 0)
     {
         ...
     }
2023-05-09 19:30:58 +02:00
Mark Olesen
8e32db2b5f STYLE: more explicit use of REGISTER when storing fields
ENH: add phaseScopedName convenience method

- unites IOobject::scopedName + phasePropertyName
2023-05-09 19:30:57 +02:00
Mark Olesen
16591012e9 ENH: add -verbose option to surface conversion, cleanup
- by default, reduce the amount of output

ENH: support default text description for -verbose option

- simplifies use in more places.
2023-05-09 19:30:57 +02:00
Mark Olesen
2eb1f5678d ENH: use Improbe/Mrecv for NBX size exchange
- retains the queried message without secondary polling.
  Purported to be slightly faster. Better thread-safety.
2023-05-09 14:51:43 +02:00
Mark Olesen
639b800049 ENH: clearer separation of MPI initialize/finalize stages (#2774)
ENH: support transfer from a wrapped MPI request to global list

- allows coding with a list UPstream::Request and subsequently either
  retain that list or transfer into the global list.
2023-05-09 14:51:43 +02:00
Mark Olesen
e967305ef2 STYLE: use calculatedType() and zeroGradientType() methods 2023-05-02 13:34:12 +02:00
Mark Olesen
ee39e3d276 STYLE: use explicit REGISTER option when storing fields 2023-04-25 13:45:08 +02:00
Mark Olesen
ce282dfbbf ENH: correct the selfComm procNo relative to world communicator
STYLE: qualify worldComm as UPstream instead Pstream

STYLE: PPCG::gSumMagProd() as static function
2023-04-24 15:46:04 +02:00
Mark Olesen
5042d1296f ENH: consistent UniformDimensionedField naming
- construct from components, or use word::null to ensure
  consistent avoid naming between IOobject vs dimensioned type.

- support construct with parameter ordering as per DimensionedField

ENH: instantiate a uniformDimensionedLabelField

- eg, for registering standalone integer counters
2023-04-24 15:46:04 +02:00
Mark Olesen
2b1061420c STYLE: remove trailing space, tabs 2023-04-24 15:37:33 +02:00
Mark Olesen
7bef18a274 STYLE: document const-ness of isA, refCast 2023-04-21 15:49:27 +02:00
Mark Olesen
80bc1db5b7 ENH: provide UPstream intra-host and inter-host communicators
- simplifies communication structuring with intra-host communication.
  Can be used for IO only, or for specialised communication.

  Demand-driven construction. Gathers the SHA1 of host names when
  determining the connectivity. Internally uses an MPI_Gather of the
  digests and a MPI_Bcast of the unique host indices.

  NOTE:
    does not use MPI_Comm_splt or MPI_Comm_splt_type since these
    return MPI_COMM_NULL on non-participating process which does not
    easily fit into the OpenFOAM framework.

    Additionally, if using the caching version of
    UPstream::commInterHost() and UPstream::commIntraHost()
    the topology is determined simultaneously
    (ie, equivalent or potentially lower communication).
2023-04-18 14:08:39 +02:00
Mark Olesen
9d3427e0b4 ENH: consolidate UPstream::commsStruct code
- make sizing of commsStruct List demand-driven as well
  for more robustness, fewer unneeded allocations.

- fix potential latent bug with allBelow/allNotBelow for proc 0
  (linear communication).

ENH: remove unused/unusable UPstream::communicator optional parameter

- had constructor option to avoid constructing the MPI backend,
  but this is not useful and inconsistent with what the reset or
  destructor expect.

STYLE: local use of UPstream::communicator

- automatically frees communicator when it leaves scope
2023-04-18 14:08:39 +02:00
Mark Olesen
b277b913cf ENH: add guards for partially populated communicators
- these are primarily when encountering sparse (eg, inter-host)
  communicators. Additional UPstream convenience methods:

  is_rank(comm)
    => True if process corresponds to a rank in the communicators.
       Can be a master rank or a sub-rank.

  is_parallel(comm)
    => True if parallel algorithm or exchange is used on the process.
       same as

           (parRun() && (nProcs(comm) > 1) && is_rank(comm))
2023-04-18 14:08:39 +02:00