Commit Graph

27425 Commits

Author SHA1 Message Date
a9863d9a3f ENH: add size_type to Matrix and VectorSpace
- easier to create type-specific looping in templated code

STYLE: pass 'direction' and 'label' by value instead of reference

COMP: qualify Foam::min() in dense matrix classes
2025-03-31 15:58:55 +02:00
bdb890d4e2 COMP: disambiguate pTraits for long/unsigned long on Darwin 2025-03-25 16:02:42 +01:00
707db0b65b COMP: avoid deprecated headers for CGAL-6.0 2025-03-24 16:27:02 +01:00
8716795d86 COMP: more int/label consistency for communicator parameter 2025-03-24 16:27:02 +01:00
8bbfe6eb44 Merge branch 'remove-posix-regex' into 'develop'
DEFEATURE: remove POSIX regex interface (#3343)

See merge request Development/openfoam!733
2025-03-24 10:33:15 +00:00
aaa9af9ee8 DEFEATURE: remove POSIX regex interface (#3343)
- compiler versions are now sufficient that only the C++ regex
  interface is now being used. Can remove the old POSIX code
  accordingly.

  This change also removes any dependency on the SubStrings class to
  manage the matching results.

ENH: remove OpenFOAM dependencies from MacOS addr2line utility
2025-03-21 14:41:43 +01:00
4de0b84c2f Merge branch 'pstream-topo-aware' into 'develop'
additional topology-aware handling for Pstream

See merge request Development/openfoam!731
2025-03-20 12:02:45 +00:00
db871856c0 CONFIG: add named topoControls 2025-03-20 10:51:43 +00:00
a01f3ed8b7 ENH: add node-based gatherList() 2025-03-20 10:51:43 +00:00
c4b261c615 ENH: add node-based gather(), listGather(), mapGather() 2025-03-20 10:51:43 +00:00
7b0ab0dbb3 ENH: add node-based broadcasting and reduction 2025-03-20 10:51:43 +00:00
b9b0d1b3aa STYLE: use weighted average/sum in a few places
- minor adjustments to some BCs construction:
  * ensure origin/axis are zero-initialized
  * use dictionary get<> instead of lookup
2025-03-20 11:14:39 +01:00
034a0524af ENH: add weighted average and weighted sum functions (local and global)
- convenience, avoids creating intermediate fields and for
  gWeightedAverage() requires one fewer reduction

ENH: combine loops for FieldField averaging

STYLE: remove clip() function, superseded by clamp_range() - JAN-2023
2025-03-19 12:10:27 +01:00
eaa65913f4 CONFIG: combine flex/flex++ rules (minor cleanup)
- generate .cc (instead of .C) intermediate files, consistent with how
  we manage other generated code and makes them less case sensitive
2025-03-19 12:10:12 +01:00
6dd8804acb BUG: fixup. See #3334 2025-03-17 15:07:25 +00:00
a77aaa7582 BUG: AMIInterpolation: reset cached data. Fixes #3334 2025-03-17 14:11:38 +00:00
5cc36dc5b7 Merge branch 'issue-3211-fan-jumpCyclic' into 'develop'
BUG: fan: bc value not updated. See #3211

See merge request Development/openfoam!701
2025-03-17 14:11:12 +00:00
d4a959a93f BUG: fan: bc value not updated. See #3211 2025-03-17 14:11:12 +00:00
09e04003c4 CONFIG: support Allwmake with -bear-output-dir (#3322) 2025-03-17 11:58:25 +01:00
dcbd546d51 FIX: incorrect parameters for IN_PLACE MPI_Gather, MPI_Scatter
STYLE: mark Pstream::scatterList() as deprecated

- this entry point is not directly used anywhere, only the
  scatterList_algorithm backend is actually used.

  The scatterList() routine is misnomer since it actually works like a
  broadcast that skips overwriting the local rank, but only if used in
  combination with the gatherList() manual implementation that uses
  the same walk pattern.
2025-03-14 17:55:12 +01:00
d64c6371f1 ENH: foamDictionary now respects header format [ascii/binary] (#3329) 2025-03-14 09:08:04 +01:00
2d246cd5d1 ENH: add token::read(Istream&) method
- can be used to simplify some logic. For example,

      if
      (
          (tok.read(is) && tok.isWord("FoamFile"))
       && (tok.read(is) && tok.isPunctuation(token::BEGIN_BLOCK))
      )
      ...
  vs
      if
      (
          (is.good() && (is >> tok) && tok.isWord("FoamFile")) ...
       && (is.good() && (is >> tok) && tok.isPunctuation(token::BEGIN_BLOCK))
      ) ...
2025-03-12 20:09:00 +01:00
51bb06764a ENH: add polyBoundaryMesh::nNonProcessorFaces()
- the number boundary faces before the first processor patch.
  This approximately equals the 'real' number of boundary faces
2025-03-12 19:14:48 +01:00
795bce4519 COMP: suppress old-style cast warning (boost/cgal) 2025-03-12 12:14:58 +01:00
db0709f957 ENH: use DynamicList to SLList for ansysToFoam, kivaToFoam
- also fixes a compilation issue introduced by f13be4f62c
  (where the direct assignment from SLList to List was removed)
2025-03-12 11:50:58 +01:00
38e08fc092 COMP: avoid constructor ambiguity for ISpanStream
- compiler cannot decide between std::string and std::string_view
  when creating from 'const char*' without also supplying the size,
  so also supply a 'const char*' constructor.

ENH: additional string_view handling for ITstream and SubStrings
2025-03-12 10:04:43 +01:00
36ae93d017 ENH: components to support one-sided communication 2025-03-10 16:32:35 +01:00
ab7cfdcf49 ENH: add UList move construct and move assignment (shallow copy)
- the 'move' treatment performs a shallow copy but does not alter
  the passed parameter. Identical semantics as per std::span.

ENH: constexpr for basic HashTable constructors

STYLE: 'Foam::zero' instead of 'const Foam::zero' for containers

- this is simply a compiler dispatch flag, so the additional 'const'
  qualifier is unnecessary
2025-03-10 16:32:23 +01:00
f13be4f62c DEFEATURE: remove old/unused SLList -> List construct/assignment
- should ideally avoid SLList in most cases, since it is allocation
  intensive and most places can easily use DynamicList or
  CircularBuffer instead.

STYLE: use push_uniq instead of deprecated appendUniq method

- mark with a 'normal' deprecation instead of 'strict' deprecation
2025-03-10 16:32:22 +01:00
ae638c2b9c CONFIG: improvements to mpirunDebug
- the '-no-core' to limit coredumps to zero size
- the '-quick' option, which changes valgrind --leak-check from "full"
  to "summary", and implies -no-core as well.
- enforce tcp libfabrics provider under valgrind since valgrind
  does not otherwie work nicely with RMA
2025-03-10 16:29:47 +01:00
9cd0aa8816 COMP: avoid in-place reduce for OPEN-MPI as well (#3331)
- fails with MPI_ARG_ERR.
  Do not assume that any vendors actually support in-place handling
  for MPI_Reduce(), regardless of what their documentation may claim.
2025-03-07 09:29:28 +01:00
939ca03495 Merge branch 'pstream-typed-handling' into 'develop'
increased use of intrinsic data types and ops for communication

See merge request Development/openfoam!730
2025-03-06 16:16:01 +00:00
28818c73f9 COMP: workaround for broken in-place reduce INTEL-MPI (#3331)
- since that particular vendor version of MPI_Reduce() does not work
  with MPI_IN_PLACE, create a local copy of the data to pass into the
  routine.
2025-03-06 16:54:32 +01:00
20b2f46315 STYLE: prefer listReduce() to using listCombineReduce() when possible
- potentially allows access into the builtin MPI operations
2025-03-06 16:54:31 +01:00
5d9f8e9a9d ENH: remove gatherv/scatterv direct coding
- includes intrinsic MPI types, but no component aggregates since we
  barely wish to use gatherv/scatterv (slow!) in the first place
  and it makes no sense to recalculate the list of counts for
  component aggregates which we will never use.
2025-03-06 16:54:31 +01:00
3bf1399098 ENH: generalize mpiGather/mpiScatter/mpiAllGather
- include MPI and component aggregates
2025-03-06 16:54:31 +01:00
20b6aeb4dd ENH: generalize reduce/all-reduce to include MPI types
- for known data types (and component aggregates),
  and intrisic reduction operation can now use

     UPstream::mpiReduce(), UPstream::mpiAllReduce().

  This change permits more operations to use MPI calls directly.
  eg,

      reduce(vec, sumOp<vector>);

   now calls mpiAllReduce(..., op_sum) instead of point-to-point,
   followed by a broadcast.

   Similarly, when called as a simple reduction (not all-reduce)

      Pstream::gather(vec, sumOp<vector>);

   now calls mpiReduce(..., op_sum) instead of point-to-point

- extend use of MPI calls to list-wise reductions as well

- extend sumReduce() to bundle/unbundle vector-space types,
  which lowers overall communication.

  Before:
    1) send/recv + binary op through a communication tree
    2) broadcast
    3) all-reduce of the count

  Now:
    1) pack into a local bundle
    2) all-reduce
    3) unpack the bundle
2025-03-06 16:54:31 +01:00
c7fc9d4ddc ENH: extend MPI send/recv types
- support send/recv of basic types (int32, float, double, ...) in
  addition to common OpenFOAM vectorspace types (floatVector,
  doubleVector, ...)

  This permits sending NUM items of the given types instead of sending
  NUM sizeof() bytes.
  For a vector (as double): 1 item instead of 24 items (3*8 bytes).
  For a tensor (as double): 1 item instead of 72 items (9*8 bytes).
2025-03-06 16:54:31 +01:00
f0b844eb47 ENH: generalize MPI broadcast to basic and user-defined MPI types
- simplify and rationalize some of the broadcast methods for more code
  reuse.

  The bottom level UPstream::broadcast is now always to/from "root=0".
  This was previously passed as a default parameter, but never used
  anything other than '0' in the code. Fixing it as '0' makes it
  consistent with the 'top-down' logical for node-based broadcast.
2025-03-06 16:54:31 +01:00
151f4df546 ENH: add opaque data types to UPstream bridge code
- permits more flexible handling at the caller level
2025-03-06 16:54:31 +01:00
7ac83f22c7 ENH: refine the dataTypes handling
- now distinguish between basic MPI types and user-defined types.

  The new front-facing trait UPstream_basic_dataType unwinds components
  and other types, but only for MPI fundamental types
  (including any aliases)

- additional helper to combine a test for binary operator validity and
  basic data type validity, which better expresses intent:

     template<class BinaryOp, class T>
     UPstream_data_opType;

- relax bit-wise operators to also accept signed integrals
  and 'void' generic
2025-03-06 16:54:31 +01:00
8c395357f3 STYLE: more consistency in communicator types (int vs label) 2025-03-06 16:54:31 +01:00
d4b5280742 ENH: cleanup broadcast streams
- remove unused/unusable broadcast stream constructors/methods

- provide OPBstream::sends() and IPBstream::recvs() methods,
  refactored from Pstream::broadcasts. These will always use
  serializations, even for contiguous content.

- additional methods to support special handling of zero-sized lists.
  For example,

    if (UPstream::master(comm))
    {
        if (list.empty()) OPBstream::send(Foam::zero, comm);
        else              OPBstream::send(list, comm);
    }
    else
    {
        IPBstream is(comm);
        if (is.remaining()) { is >> list; }
        else { list.clear(); }
    }

   This avoids serialization of an empty list and the resulting double
   broadcast (size + content), using instead a single broadcast (size).

STYLE: more consistency in communicator types (int vs label)
2025-03-06 16:54:31 +01:00
be30598e3d ENH: add UPstream::localNode_parentProcs() method
- returns the (start/size) range of the commLocalNode ranks in terms
  of the (const) world communicator processors. This allows mapping
  back into lists defined in terms of the world ranks.
2025-03-06 16:54:30 +01:00
d64682a7af ENH: expand VectorSpaceOps to include copy_n/fill_n methods
- similar to what std::copy_n and std::fill_n would do, except with
  templated loops. This allows compile-time transcribing with loop
  unrolling. For example,

     vector vec1 = ..., vec2 = ...;

     FixedList<scalar, 6> values;

     VectorSpaceOps<3>::copy_n(vec1.begin(), values.begin());
     VectorSpaceOps<3>::copy_n(vec2.begin(), values.begin(3))

     // do something with all of these values

STYLE: make start index of VectorSpaceOps optional

ENH: add clamped begin(int) versions to FixedList as per UList
2025-03-06 16:54:30 +01:00
cf9fa16788 COMP: add pTraits for int16/uint16 types (simplifies messages) 2025-03-06 16:54:30 +01:00
9437e8d068 ENH: simplify operator calls for error, messageStream
- use move semantics for string parameters and reuse more code
2025-03-06 16:54:30 +01:00
dd09aa1289 ENH: PatchTools: version with supplied local points 2025-03-06 13:05:20 +00:00
56c52fd69e COMP: fix up merg e 2025-02-27 12:04:58 +00:00
34c933c1ce ENH: AMIInterpolation: use local communicator
- allocate communicator with only those ranks that have
patch faces
- use this communicator everywhere
- communicator preserved during mesh motion
2025-02-27 12:04:58 +00:00