| ... | ... | @@ -5,31 +5,274 @@ |
|
|
|
[][upgrade-guide]
|
|
|
|
[][code-patterns]
|
|
|
|
|
|
|
|
***Preview information, subject to change at any time !!!***
|
|
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
## Deprecation and Removal
|
|
|
|
|
|
|
|
### Deprecated Methods
|
|
|
|
### Removed Items
|
|
|
|
|
|
|
|
### Removed Methods
|
|
|
|
- The `faMesh::operator()` has been removed in favour of `mesh()` or
|
|
|
|
`thisDb()` instead.
|
|
|
|
- The `typeGlobal()` global function has been replaced with an
|
|
|
|
`is_globalIOobject<Type>` traits structure for more consistent and easier
|
|
|
|
overriding. The ancillary `typeFilePath()` global function has been
|
|
|
|
superseded by global function as a member of `IOobject::typeFilePath`
|
|
|
|
for consistency with `IOobject::typeHeaderOk`
|
|
|
|
|
|
|
|
### Removed Items
|
|
|
|
|
|
|
|
## Changes in definition
|
|
|
|
|
|
|
|
## Changes in behaviour
|
|
|
|
- `ReadFields` now uses a `DynamicList` to implement its LIFO for handling
|
|
|
|
stored objects. The older `LIFOStack` interface is marked as
|
|
|
|
_deprecated_ since it requires more allocations and overhead.
|
|
|
|
- Deprecate some `IOobjectList::sorted()` const-access methods in favour
|
|
|
|
of the new `csorted()` methods. This provides method name consistency
|
|
|
|
with `HashTable` and ensures an unambiguous return type.
|
|
|
|
- The internal dictionary separator has changed from `'.'` to `'/'`,
|
|
|
|
which simplifies internal handling (like a fileName) and allows the
|
|
|
|
dictionary name to be used with unambiguous addressing.
|
|
|
|
No particular side-effects of this change are expected, except if
|
|
|
|
the raw dictionary names have been directly reparsed within code.
|
|
|
|
|
|
|
|
|
|
|
|
## Changes in inheritance
|
|
|
|
|
|
|
|
The `data` class used by `fvMesh` has been replaced by member data at
|
|
|
|
the `polyMesh` level. For a developer, this means that the following
|
|
|
|
(fragile and ugly) code will now most certainly break!
|
|
|
|
```
|
|
|
|
obr.lookupObject<fvMesh>("data") // This was never a good idea
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Relocated Methods
|
|
|
|
|
|
|
|
Promote `ListOps::identity` to `Foam::identity` this becoming more
|
|
|
|
frequently used and there is no ambiguity in calling parameters.
|
|
|
|
Handles both int32 and int64 versions.
|
|
|
|
|
|
|
|
|
|
|
|
## Container improvements / changes
|
|
|
|
|
|
|
|
As with some many releases, the underlying OpenFOAM containers have
|
|
|
|
been upgraded and tweaked in a variety of ways. Some of the focus has
|
|
|
|
been on modernizing internal copying, filling, moving data by
|
|
|
|
harnessing using C++ algorithms in more places. Apart from general
|
|
|
|
code reduction, the shift to algorithms helps provision for different
|
|
|
|
execution models (eg, `std::execution::parallel_unsequenced_policy`)
|
|
|
|
in the future.
|
|
|
|
|
|
|
|
|
|
|
|
### HashTable construct
|
|
|
|
|
|
|
|
The default constructors for `HashTable` and `HashSet` now truly
|
|
|
|
correspond to a zero-size construct (ie, they invoke no allocations)
|
|
|
|
and are also `noexcept`. This is particularly convenient and useful
|
|
|
|
when managing lists of hash sets etc. The move constructors are also
|
|
|
|
now noexcept as well.
|
|
|
|
|
|
|
|
- removed unused `HashTable(Istream&, label)` constructor.
|
|
|
|
|
|
|
|
|
|
|
|
### HashTable sizing improvements
|
|
|
|
|
|
|
|
- earlier deletion of unpopulated HashTable on resizing: <br>
|
|
|
|
If the table is already clear (ie, has no entries), can immediately
|
|
|
|
remove the old internal table before reallocating the newly sized
|
|
|
|
table, which may avoid a needless memory spike.
|
|
|
|
|
|
|
|
- reserve() method: <br>
|
|
|
|
Naming and general behaviour as per `std::unordered_map`.
|
|
|
|
It behaves similarly to the `resize()` method but is supplied the number
|
|
|
|
of elements instead of the capacity, which can be a more natural way of
|
|
|
|
specifying the storage requirements. Additionally, `reserve()` will
|
|
|
|
only increase the table capacity for behaviour similar to
|
|
|
|
`DynamicList` and `std::vector`, `std::string` etc.
|
|
|
|
```
|
|
|
|
// old:
|
|
|
|
labelHashSet set;
|
|
|
|
set.resize(2*nElems);
|
|
|
|
|
|
|
|
// now:
|
|
|
|
labelHashSet set;
|
|
|
|
set.reserve(nElems);
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### List construction / assignment
|
|
|
|
|
|
|
|
Construct or assignment of `List` or `FixedList` from a `SLList`
|
|
|
|
(a singly-linked list) has been removed. The move construct or assignment
|
|
|
|
is still retained, but expected to have outlived its usefulness by
|
|
|
|
the next version.
|
|
|
|
|
|
|
|
|
|
|
|
### List reading / writing
|
|
|
|
|
|
|
|
When reading a List without an known input size, these bracket lists
|
|
|
|
are now read chunk-wise instead of using a singly-linked list. For
|
|
|
|
integral and vector-space types (eg, scalar, vector, etc) this avoids
|
|
|
|
intermediate allocations for each element.
|
|
|
|
|
|
|
|
The `DynamicList::readList()` method is now fully implemented instead
|
|
|
|
of simply redirecting to `List::readList()` for better retention of
|
|
|
|
the list capacity.
|
|
|
|
|
|
|
|
|
|
|
|
## Changes in IOstreams
|
|
|
|
|
|
|
|
The `Ostream` write method `write(const string&)` has been changed to
|
|
|
|
`write(const std::string&)`, which allows writing of `std::string`
|
|
|
|
without an intermediate copy. It does, however, mean that any classes
|
|
|
|
derived from `Ostream` may need adjustment.
|
|
|
|
|
|
|
|
The `Ostream` class also received a new
|
|
|
|
`writeQuoted(const char* str, std::streamsize len, bool)` method to
|
|
|
|
help future support of spans and string_view.
|
|
|
|
|
|
|
|
|
|
|
|
### Update and enhancement of memory-streams
|
|
|
|
|
|
|
|
Extending coverage to include all std stream variants, and simply
|
|
|
|
rewrap them for OpenFOAM IOstream types. This simplifies the
|
|
|
|
inheritance patterns and allows reuse of icharstream/ocharstream as a
|
|
|
|
drop-in replace for istringstream/ostringstream in other wrappers.
|
|
|
|
|
|
|
|
- Classes
|
|
|
|
* icharstream / ICharStream [old: none / IListStream]
|
|
|
|
* ocharstream / OCharStream [old: none / OListStream]
|
|
|
|
* ispanstream / ISpanStream [old: uiliststream / UIListStream]
|
|
|
|
* ospanstream / OSpanStream [old: none / UOListStream]
|
|
|
|
|
|
|
|
Supports `std::string_view` (c++17) or span view (older c++) of stream
|
|
|
|
buffer contents. This simplifies formatting + reparsing.
|
|
|
|
|
|
|
|
|
|
|
|
## Changes in parallel (MPI) handling
|
|
|
|
|
|
|
|
### Removed functions/functionality
|
|
|
|
|
|
|
|
The experimental full-NBX PstreamBuffers algorithm (added in
|
|
|
|
OpenFOAM-v2306) has been dropped since no advantage could be seen
|
|
|
|
compared to the hybrid NBX/PEX approach.
|
|
|
|
|
|
|
|
Similarly, the experimental "double non-blocking" NBX version has also
|
|
|
|
been removed. The idea was to avoid blocking receives for very large
|
|
|
|
data transfers, but that is usually better accomplished with a hybrid
|
|
|
|
NBX/PEX approach like PstreamBuffers allows.
|
|
|
|
|
|
|
|
|
|
|
|
### New functions
|
|
|
|
|
|
|
|
#### broadcastList
|
|
|
|
|
|
|
|
The new `Pstream::broadcastList()` method broadcasts contiguous
|
|
|
|
content as a two-step process:
|
|
|
|
|
|
|
|
1. broadcast the size, and resize for receiver list
|
|
|
|
2. broadcast contiguous contents (if non-empty)
|
|
|
|
|
|
|
|
This avoids serialization/de-serialization memory overhead but at
|
|
|
|
the expense of an additional broadcast call.
|
|
|
|
The trade-off of the extra broadcast of the size will be less
|
|
|
|
important than avoiding a memory peak for large contiguous mesh data.
|
|
|
|
|
|
|
|
|
|
|
|
#### mpiAllGather
|
|
|
|
|
|
|
|
The `mpiAllGather` functions have be extended to include integer and
|
|
|
|
float types instead of being limited to `char` only.
|
|
|
|
|
|
|
|
|
|
|
|
#### allToAllConsensus
|
|
|
|
|
|
|
|
The `allToAllConsensus` function taking a `Map` now also returns a
|
|
|
|
`Map`, which simplifies use and avoids ambiguities in the send/recv
|
|
|
|
parameters. This version will now also transmit zero value data if
|
|
|
|
they exist in the Map, since the connectivity is now described by the
|
|
|
|
Map keys instead of the content.
|
|
|
|
|
|
|
|
|
|
|
|
#### PstreamBuffers
|
|
|
|
|
|
|
|
Added support for _"registered"_ sends to properly handle reduced
|
|
|
|
communication, but also handle speculative sends. These arise when
|
|
|
|
there may be processor-processor communication within an algorithm,
|
|
|
|
but it is not known a priori if the sends will all be necessary. In
|
|
|
|
this case, the sends occur as usual, but only the "real" sends are
|
|
|
|
registered. After all of the sends are done, it can be determined
|
|
|
|
which information (if any) actually needs to be transmitted.
|
|
|
|
|
|
|
|
For example,
|
|
|
|
```
|
|
|
|
PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking);
|
|
|
|
|
|
|
|
pBufs.initRegisterSend();
|
|
|
|
|
|
|
|
for (const polyPatch& pp : patches)
|
|
|
|
{
|
|
|
|
const auto* ppp = isA<processorPolyPatch>(pp);
|
|
|
|
if (ppp)
|
|
|
|
{
|
|
|
|
const label nbrProci = ppp->neighbProcNo();
|
|
|
|
|
|
|
|
// Gather some patch information...
|
|
|
|
UOPstream toNbr(nbrProci, pBufs);
|
|
|
|
toNbr << patchInfo;
|
|
|
|
|
|
|
|
// The send is needed if patchInfo is non-empty
|
|
|
|
pBufs.registerSend(nbrProci, !patchInfo.empty());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pBufs.finishedSends();
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Added a new `PstreamBuffers::finishedSendsNBX()` method that allows
|
|
|
|
for specifying NBX (non-blocking transfer) of the buffer sizes instead
|
|
|
|
of all-to-all irrespective of any default configuration parameters.
|
|
|
|
|
|
|
|
|
|
|
|
### extend MPI native bitOrOp
|
|
|
|
|
|
|
|
- The `bitOrOp` can now handle multiple values as well. This can
|
|
|
|
be used, for 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>()
|
|
|
|
);
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Improvements for MPI request handling
|
|
|
|
|
|
|
|
- slice/range support for `UPstream::waitSomeRequests()`,
|
|
|
|
which simplifies polling receives and allows separation from the sends
|
|
|
|
- `UPstream::removeRequests(pos, len)` to cancel/free of outstanding
|
|
|
|
requests and remove segment from the internal list of outstanding requests
|
|
|
|
- improved request handling within `mapDistribute`
|
|
|
|
* receive before sending
|
|
|
|
* direct copy of self-send into receive buffers
|
|
|
|
* void unnecessary reallocations with PtrList of send/recv buffers
|
|
|
|
|
|
|
|
## Namespace changes
|
|
|
|
|
|
|
|
## Rename
|
|
|
|
### globalIndex
|
|
|
|
|
|
|
|
### Function object: `WeberNumberReacting`
|
|
|
|
Various improvements, including the new `findProc()` method as
|
|
|
|
a non-failing alternative to `whichProcID()`.
|
|
|
|
|
|
|
|
The Lagrangian function-object class `WeberNumberReacting` is renamed
|
|
|
|
as `ReactingWeberNumber` to ensure the consistency with the new Lagrangian
|
|
|
|
cloud function object `KinematicWeberNumber`.
|
|
|
|
|
|
|
|
----
|
|
|
|
|
| ... | ... | |