mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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))
This commit is contained in:
@ -52,8 +52,8 @@ void rankInfo(const label comm)
|
||||
<< "(parent:" << UPstream::parent(comm) << ')'
|
||||
<< " rank:" << ranki
|
||||
<< "(sub:" << UPstream::is_subrank(comm)
|
||||
<< ") nProcs:" << UPstream::nProcs(comm)
|
||||
<< " baseProcNo:" << UPstream::baseProcNo(comm, ranki);
|
||||
<< ") nProcs:" << UPstream::nProcs(comm);
|
||||
// << " baseProcNo:" << UPstream::baseProcNo(comm, ranki);
|
||||
}
|
||||
|
||||
|
||||
@ -82,8 +82,10 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
|
||||
Info<< nl
|
||||
<< "parallel:" << UPstream::parRun()
|
||||
<< "nProcs = " << UPstream::nProcs()
|
||||
<< " with " << UPstream::nComms() << " predefined comm(s)" << nl;
|
||||
<< " with " << UPstream::nComms() << " predefined comm(s)."
|
||||
<< " proc:" << UPstream::myProcNo() << nl;
|
||||
|
||||
Info<< nl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user