COMP: replace selfComm/globalComm variables with functions instead (#2799)

- with C++11, static constexpr variables apparently also require
  definition in a translation unit and not just as inlined quantities.
  Mostly not an issue, however gcc with -O0 does not do the inlining
  and thus actually requires them to be defined in a translation unit
  as well.

  These variables were provided for symmetry with worldComm, but only
  used in low-level internal code. Changing to inlined functions
  solves the linkage issue and also aligns with the commWorld()
  function naming.

Mnemonics:
   MPI_COMM_SELF           => UPstream::commSelf()
   overall MPI_COMM_WORLD  => UPstream::commGlobal(), sometimes commWorld()
   local COMM_WORLD        => UPstream::commWorld()
This commit is contained in:
Mark Olesen
2023-06-13 18:29:04 +02:00
parent a8cec219c3
commit 9489a5a101
9 changed files with 81 additions and 79 deletions

View File

@ -220,7 +220,7 @@ Foam::UIPstreamBase::UIPstreamBase
Istream(fmt),
fromProcNo_(UPstream::masterNo()), // placeholder
tag_(UPstream::msgType()), // placeholder
comm_(UPstream::selfComm), // placeholder
comm_(UPstream::commSelf()), // placeholder
messageSize_(receiveBuf.size()), // Message == buffer
storedRecvBufPos_(0),
clearAtEnd_(false), // Do not clear recvBuf if at end!!