UPstream.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2015-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::UPstream
29
30Description
31 Inter-processor communications stream
32
33SourceFiles
34 UPstream.C
35 UPstreamCommsStruct.C
36 UPstreamTemplates.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_UPstream_H
41#define Foam_UPstream_H
42
43#include "labelList.H"
44#include "DynamicList.H"
45#include "HashTable.H"
46#include "string.H"
47#include "Enum.H"
48#include "ListOps.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class UPstream Declaration
57\*---------------------------------------------------------------------------*/
59class UPstream
60{
61public:
62
63 //- Int ranges are used for MPI ranks (processes)
65
66 //- Types of communications
67 enum class commsTypes : char
68 {
69 blocking,
70 scheduled,
72 };
73
74 //- Names of the communication types
76
77
78 // Public Classes
79
80 //- Structure for communicating between processors
81 class commsStruct
82 {
83 // Private Data
84
85 //- The procID of the processor directly above
86 label above_;
87
88 //- The procIDs of all processors directly below
89 labelList below_;
90
91 //- procIDs of all processors below (so not just directly below)
92 labelList allBelow_;
93
94 //- procIDs of all processors not below.
95 // Inverse set of allBelow_ without myProcNo.
96 labelList allNotBelow_;
97
98
99 public:
100
101 // Constructors
102
103 //- Default construct. Above == -1
104 commsStruct() noexcept;
105
106 //- Construct from components
108 (
109 const label above,
110 const labelList& below,
111 const labelList& allBelow,
113 );
114
115 //- Construct from components; construct allNotBelow_
117 (
118 const label nProcs,
119 const label myProcID,
120 const label above,
121 const labelList& below,
122 const labelList& allBelow
123 );
124
125
126 // Member Functions
127
128 //- The procID of the processor directly above
129 label above() const noexcept
130 {
131 return above_;
132 }
133
134 //- The procIDs of all processors directly below
135 const labelList& below() const noexcept
136 {
137 return below_;
138 }
139
140 //- The procIDs of all processors below
141 //- (so not just directly below)
142 const labelList& allBelow() const noexcept
143 {
144 return allBelow_;
145 }
146
147 //- The procIDs of all processors that are above.
148 //- The inverse set of allBelow without myProcNo.
149 const labelList& allNotBelow() const noexcept
150 {
151 return allNotBelow_;
152 }
153
154
155 // Member Operators
156
157 bool operator==(const commsStruct&) const;
158 bool operator!=(const commsStruct&) const;
159
160
161 // Ostream Operator
163 friend Ostream& operator<<(Ostream&, const commsStruct&);
164 };
165
166
167 //- combineReduce operator for lists. Used for counting.
168 struct listEq
169 {
170 template<class T>
171 void operator()(T& x, const T& y) const
172 {
173 forAll(y, i)
174 {
175 if (y[i].size())
176 {
177 x[i] = y[i];
178 }
179 }
180 }
181 };
182
183
184private:
185
186 // Private Data
187
188 //- Communications type of this stream
189 commsTypes commsType_;
190
191
192 // Private Static Data
193
194 //- By default this is not a parallel run
195 static bool parRun_;
196
197 //- Have support for threads?
198 static bool haveThreads_;
199
200 //- Standard transfer message type
201 static int msgType_;
202
203 //- Names of all worlds
204 static wordList allWorlds_;
205
206 //- Per processor the name of the world
207 static labelList worldIDs_;
208
209
210 // Communicator specific data
211
212 //- My processor number
213 static DynamicList<int> myProcNo_;
214
215 //- List of process IDs
216 static DynamicList<List<int>> procIDs_;
217
218 //- Parent communicator
219 static DynamicList<label> parentCommunicator_;
220
221 //- Free communicators
222 static DynamicList<label> freeComms_;
223
224 //- Linear communication schedule
225 static DynamicList<List<commsStruct>> linearCommunication_;
226
227 //- Multi level communication schedule
228 static DynamicList<List<commsStruct>> treeCommunication_;
229
230
231 // Private Member Functions
232
233 //- Set data for parallel running
234 static void setParRun(const label nProcs, const bool haveThreads);
235
236 //- Calculate linear communication schedule
237 static List<commsStruct> calcLinearComm(const label nProcs);
238
239 //- Calculate tree communication schedule
240 static List<commsStruct> calcTreeComm(const label nProcs);
241
242 //- Helper function for tree communication schedule determination
243 // Collects all processorIDs below a processor
244 static void collectReceives
245 (
246 const label procID,
247 const List<DynamicList<label>>& receives,
248 DynamicList<label>& allReceives
249 );
250
251 //- Allocate a communicator with index
252 static void allocatePstreamCommunicator
253 (
254 const label parentIndex,
255 const label index
256 );
257
258 //- Free a communicator
259 static void freePstreamCommunicator
260 (
261 const label index
262 );
263
264
265public:
266
267 // Declare name of the class and its debug switch
268 ClassName("UPstream");
269
270
271 // Static Data
272
273 //- Should compact transfer be used in which floats replace doubles
274 //- reducing the bandwidth requirement at the expense of some loss
275 //- in accuracy
276 static bool floatTransfer;
277
278 //- Number of processors to change from linear to tree communication
279 static int nProcsSimpleSum;
280
281 //- Default commsType
283
284 //- Number of polling cycles in processor updates
285 static int nPollProcInterfaces;
286
287 //- Optional maximum message size (bytes)
288 static int maxCommsSize;
289
290 //- MPI buffer-size (bytes)
291 static const int mpiBufferSize;
292
293 //- Default communicator (all processors)
294 static label worldComm;
295
296 //- Debugging: warn for use of any communicator differing from warnComm
297 static label warnComm;
298
299
300 // Constructors
301
302 //- Construct for given communication type
303 explicit UPstream(const commsTypes commsType)
304 :
305 commsType_(commsType)
306 {}
307
308
309 // Member Functions
310
311 //- Allocate a new communicator
312 static label allocateCommunicator
313 (
314 const label parent,
315 const labelList& subRanks,
316 const bool doPstream = true
317 );
318
319 //- Free a previously allocated communicator
320 static void freeCommunicator
321 (
322 const label communicator,
323 const bool doPstream = true
324 );
325
326 //- Free all communicators
327 static void freeCommunicators(const bool doPstream);
328
329 //- Helper class for allocating/freeing communicators
330 class communicator
331 {
332 label comm_;
333
334 //- No copy construct
335 communicator(const communicator&) = delete;
336
337 //- No copy assignment
338 void operator=(const communicator&) = delete;
339
340 public:
343 (
344 const label parent,
345 const labelList& subRanks,
346 const bool doPstream
347 )
348 :
349 comm_(allocateCommunicator(parent, subRanks, doPstream))
350 {}
353 {
354 freeCommunicator(comm_);
355 }
357 operator label() const noexcept
358 {
359 return comm_;
360 }
361 };
362
363 //- Return physical processor number (i.e. processor number in
364 //- worldComm) given communicator and procssor
365 static int baseProcNo(const label myComm, const int procID);
366
367 //- Return processor number in communicator (given physical processor
368 //- number) (= reverse of baseProcNo)
369 static label procNo(const label comm, const int baseProcID);
370
371 //- Return processor number in communicator (given processor number
372 //- and communicator)
373 static label procNo
374 (
375 const label myComm,
376 const label currentComm,
377 const int currentProcID
378 );
379
380 //- Add the valid option this type of communications library
381 //- adds/requires on the command line
382 static void addValidParOptions(HashTable<string>& validParOptions);
383
384 //- Initialisation function called from main
385 // Spawns sub-processes and initialises inter-communication
386 static bool init(int& argc, char**& argv, const bool needsThread);
387
388 //- Special purpose initialisation function.
389 // Performs a basic MPI_Init without any other setup.
390 // Only used for applications that need MPI communication when
391 // OpenFOAM is running in a non-parallel mode.
392 // \note Behaves as a no-op if MPI has already been initialized.
393 // Fatal if MPI has already been finalized.
394 static bool initNull();
395
396
397 // Non-blocking comms
398
399 //- Get number of outstanding requests
400 static label nRequests();
401
402 //- Truncate number of outstanding requests
403 static void resetRequests(const label sz);
404
405 //- Wait until all requests (from start onwards) have finished.
406 static void waitRequests(const label start = 0);
407
408 //- Wait until request i has finished.
409 static void waitRequest(const label i);
410
411 //- Non-blocking comms: has request i finished?
412 static bool finishedRequest(const label i);
413
414 static int allocateTag(const char*);
415
416 static int allocateTag(const std::string&);
417
418 static void freeTag(const char*, const int tag);
419
420 static void freeTag(const std::string&, const int tag);
421
422
423 //- Set as parallel run on/off.
424 // \return the previous value
425 static bool parRun(const bool on) noexcept
426 {
427 bool old(parRun_);
428 parRun_ = on;
429 return old;
430 }
431
432 //- Test if this a parallel run
433 // Modify access is deprecated
434 static bool& parRun() noexcept
435 {
436 return parRun_;
437 }
438
439 //- Have support for threads
440 static bool haveThreads() noexcept
441 {
442 return haveThreads_;
443 }
444
445 //- Number of processes in parallel run, and 1 for serial run
446 static label nProcs(const label communicator = worldComm)
447 {
448 return procIDs_[communicator].size();
449 }
450
451 //- Process index of the master (always 0)
452 static constexpr int masterNo() noexcept
453 {
454 return 0;
455 }
456
457 //- Am I the master process
458 static bool master(const label communicator = worldComm)
459 {
460 return myProcNo_[communicator] == masterNo();
461 }
462
463 //- Number of this process (starting from masterNo() = 0)
464 static int myProcNo(const label communicator = worldComm)
465 {
466 return myProcNo_[communicator];
467 }
469 static label parent(const label communicator)
470 {
471 return parentCommunicator_(communicator);
472 }
473
474 //- Process ID of given process index
475 static List<int>& procID(label communicator)
476 {
477 return procIDs_[communicator];
478 }
479
480
481 // Worlds
482
483 //- All worlds
484 static const wordList& allWorlds() noexcept
485 {
486 return allWorlds_;
487 }
488
489 //- worldID (index in allWorlds) of all processes
490 static const labelList& worldIDs() noexcept
491 {
492 return worldIDs_;
493 }
494
495 //- My worldID
496 static label myWorldID()
497 {
498 return worldIDs_[myProcNo(0)];
499 }
500
501 //- My world
502 static const word& myWorld()
503 {
504 return allWorlds()[myWorldID()];
505 }
506
507
508 //- Range of process indices for all processes
509 static rangeType allProcs(const label communicator = worldComm)
510 {
511 // Proc 0 -> nProcs (int value)
512 return rangeType(static_cast<int>(nProcs(communicator)));
513 }
514
515 //- Range of process indices for sub-processes
516 static rangeType subProcs(const label communicator = worldComm)
517 {
518 // Proc 1 -> nProcs (int value)
519 return rangeType(1, static_cast<int>(nProcs(communicator)-1));
520 }
521
522 //- Communication schedule for linear all-to-master (proc 0)
524 (
525 const label communicator = worldComm
526 )
527 {
528 return linearCommunication_[communicator];
529 }
530
531 //- Communication schedule for tree all-to-master (proc 0)
533 (
534 const label communicator = worldComm
535 )
536 {
537 return treeCommunication_[communicator];
538 }
539
540 //- Communication schedule for linear/tree all-to-master (proc 0).
541 //- Chooses based on the value of UPstream::nProcsSimpleSum
543 (
544 const label communicator = worldComm
545 )
546 {
547 return
548 (
550 ? linearCommunication_[communicator]
551 : treeCommunication_[communicator]
552 );
553 }
554
555
556 //- Message tag of standard messages
557 static int& msgType() noexcept
558 {
559 return msgType_;
560 }
561
562 //- Get the communications type of the stream
564 {
565 return commsType_;
566 }
567
568 //- Set the communications type of the stream
569 // \return the previous value
570 commsTypes commsType(const commsTypes ct) noexcept
571 {
572 commsTypes old(commsType_);
573 commsType_ = ct;
574 return old;
575 }
576
577
578 //- Shutdown (finalize) MPI as required.
579 // Uses MPI_Abort instead of MPI_Finalize if errNo is non-zero
580 static void shutdown(int errNo = 0);
581
582 //- Call MPI_Abort with no other checks or cleanup
583 static void abort();
584
585 //- Shutdown (finalize) MPI as required and exit program with errNo.
586 static void exit(int errNo = 1);
587
588 //- Exchange integer data with all processors (in the communicator).
589 // \c sendData[proci] is the value to send to proci.
590 // After return recvData contains the data from the other processors.
591 static void allToAll
592 (
593 const UList<int32_t>& sendData,
594 UList<int32_t>& recvData,
595 const label communicator = worldComm
596 );
597
598 //- Exchange integer data with all processors (in the communicator).
599 // \c sendData[proci] is the value to send to proci.
600 // After return recvData contains the data from the other processors.
601 static void allToAll
602 (
603 const UList<int64_t>& sendData,
604 UList<int64_t>& recvData,
605 const label communicator = worldComm
606 );
607
608
609 // Low-level gather/scatter routines
610
611 #undef Pstream_CommonRoutines
612 #define Pstream_CommonRoutines(Native) \
613 \
614 \
615 static void mpiGather \
616 ( \
617 const Native* sendData, \
618 int sendCount, \
619 char* recvData, \
620 int recvCount, \
621 const label communicator = worldComm \
622 ); \
623 \
624 \
625 static void mpiScatter \
626 ( \
627 const Native* sendData, \
628 int sendCount, \
629 char* recvData, \
630 int recvCount, \
631 const label communicator = worldComm \
632 ); \
633
635
636
637 #undef Pstream_CommonRoutines
638 #define Pstream_CommonRoutines(Native) \
639 \
640 \
641 static void gather \
642 ( \
643 const Native* sendData, \
644 int sendCount, \
645 Native* recvData, \
646 const UList<int>& recvCounts, \
647 const UList<int>& recvOffsets, \
648 const label communicator = worldComm \
649 ); \
650 \
651 \
652 static void scatter \
653 ( \
654 const Native* sendData, \
655 const UList<int>& sendCounts, \
656 const UList<int>& sendOffsets, \
657 Native* recvData, \
658 int recvCount, \
659 const label communicator = worldComm \
660 );
661
663 Pstream_CommonRoutines(int32_t);
664 Pstream_CommonRoutines(int64_t);
665 Pstream_CommonRoutines(uint32_t);
666 Pstream_CommonRoutines(uint64_t);
669
670 #undef Pstream_CommonRoutines
671
672
673 // Gather single, contiguous value(s)
674
675 //- Gather individual values into list locations.
676 // On master list length == nProcs, otherwise zero length.
677 // If called in non-parallel mode,
678 // the returned list length is 1 with localValue.
679 template<class T>
681 (
682 const T& localValue,
683 const label communicator = worldComm
684 );
685
686 //- Scatter individual values from list locations.
687 // On master input list length == nProcs, ignored on other procs.
688 // If called in non-parallel mode,
689 // returns the first list element (or zero).
690 template<class T>
691 static T listScatterValues
692 (
693 const UList<T>& allValues,
694 const label communicator = worldComm
695 );
696
697
698 // Broadcast Functions
699
700 //- Broadcast buffer contents to all processes in communicator.
701 //- The sizes must match on all processes.
702 // \return True on success
703 static bool broadcast
704 (
705 char* buf,
706 const std::streamsize bufSize,
707 const label communicator = worldComm,
708 const int rootProcNo = masterNo()
709 );
710
711
712 // Housekeeping
713
714 //- Process index of first sub-process
715 // \deprecated(2020-09) use subProcs() method instead
716 static constexpr int firstSlave() noexcept
717 {
718 return 1;
719 }
720
721 //- Process index of last sub-process
722 // \deprecated(2020-09) use subProcs() method instead
723 static int lastSlave(const label communicator = worldComm)
724 {
725 return nProcs(communicator) - 1;
726 }
727};
728
729
730Ostream& operator<<(Ostream&, const UPstream::commsStruct&);
731
732// Template specialisation for access of commsStruct
733template<>
736
737template<>
739UList<UPstream::commsStruct>::operator[](const label procID) const;
740
741
742// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
743
744} // End namespace Foam
745
746// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
747
748#ifdef NoRepository
749 #include "UPstreamTemplates.C"
750#endif
751
752// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
753
754#endif
755
756// ************************************************************************* //
scalar y
Various functions to operate on Lists.
#define Pstream_CommonRoutines(Native)
Definition: UPstream.H:637
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
A HashTable similar to std::unordered_map.
Definition: HashTable.H:123
An interval of (signed) integers defined by a start and a size.
Definition: IntRange.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
T & operator[](const label i)
Return element of UList.
Definition: UListI.H:299
Structure for communicating between processors.
Definition: UPstream.H:81
bool operator!=(const commsStruct &) const
friend Ostream & operator<<(Ostream &, const commsStruct &)
const labelList & allBelow() const noexcept
Definition: UPstream.H:141
bool operator==(const commsStruct &) const
commsStruct() noexcept
Default construct. Above == -1.
const labelList & below() const noexcept
The procIDs of all processors directly below.
Definition: UPstream.H:134
label above() const noexcept
The procID of the processor directly above.
Definition: UPstream.H:128
const labelList & allNotBelow() const noexcept
Definition: UPstream.H:148
Helper class for allocating/freeing communicators.
Definition: UPstream.H:330
communicator(const label parent, const labelList &subRanks, const bool doPstream)
Definition: UPstream.H:342
Inter-processor communications stream.
Definition: UPstream.H:59
ClassName("UPstream")
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:463
static bool init(int &argc, char **&argv, const bool needsThread)
Initialisation function called from main.
Definition: UPstream.C:47
commsTypes
Types of communications.
Definition: UPstream.H:67
@ nonBlocking
"nonBlocking"
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
Definition: UPstream.H:296
static void freeTag(const char *, const int tag)
Definition: UPstream.C:798
static bool initNull()
Special purpose initialisation function.
Definition: UPstream.C:37
static void freeCommunicators(const bool doPstream)
Free all communicators.
Definition: UPstream.C:201
static void shutdown(int errNo=0)
Shutdown (finalize) MPI as required.
Definition: UPstream.C:58
static const Enum< commsTypes > commsTypeNames
Names of the communication types.
Definition: UPstream.H:74
static void freeCommunicator(const label communicator, const bool doPstream=true)
Free a previously allocated communicator.
Definition: UPstream.C:174
static int allocateTag(const char *)
Definition: UPstream.C:754
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:556
static List< T > listGatherValues(const T &localValue, const label communicator=worldComm)
Gather individual values into list locations.
static bool floatTransfer
Definition: UPstream.H:275
static constexpr int masterNo() noexcept
Process index of the master (always 0)
Definition: UPstream.H:451
static const List< commsStruct > & linearCommunication(const label communicator=worldComm)
Communication schedule for linear all-to-master (proc 0)
Definition: UPstream.H:523
UPstream(const commsTypes commsType)
Construct for given communication type.
Definition: UPstream.H:302
static const int mpiBufferSize
MPI buffer-size (bytes)
Definition: UPstream.H:290
static bool master(const label communicator=worldComm)
Am I the master process.
Definition: UPstream.H:457
static const labelList & worldIDs() noexcept
worldID (index in allWorlds) of all processes
Definition: UPstream.H:489
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
Definition: UPstream.C:62
static List< int > & procID(label communicator)
Process ID of given process index.
Definition: UPstream.H:474
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.
Definition: UPstream.H:445
commsTypes commsType() const noexcept
Get the communications type of the stream.
Definition: UPstream.H:562
static constexpr int firstSlave() noexcept
Process index of first sub-process.
Definition: UPstream.H:715
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:293
static label nRequests()
Get number of outstanding requests.
Definition: UPstream.C:90
static const List< commsStruct > & treeCommunication(const label communicator=worldComm)
Communication schedule for tree all-to-master (proc 0)
Definition: UPstream.H:532
static label parent(const label communicator)
Definition: UPstream.H:468
IntRange< int > rangeType
Int ranges are used for MPI ranks (processes)
Definition: UPstream.H:63
static bool haveThreads() noexcept
Have support for threads.
Definition: UPstream.H:439
static label myWorldID()
My worldID.
Definition: UPstream.H:495
static rangeType allProcs(const label communicator=worldComm)
Range of process indices for all processes.
Definition: UPstream.H:508
static rangeType subProcs(const label communicator=worldComm)
Range of process indices for sub-processes.
Definition: UPstream.H:515
static bool broadcast(char *buf, const std::streamsize bufSize, const label communicator=worldComm, const int rootProcNo=masterNo())
static int nProcsSimpleSum
Number of processors to change from linear to tree communication.
Definition: UPstream.H:278
static int nPollProcInterfaces
Number of polling cycles in processor updates.
Definition: UPstream.H:284
static const wordList & allWorlds() noexcept
All worlds.
Definition: UPstream.H:483
static void addValidParOptions(HashTable< string > &validParOptions)
Definition: UPstream.C:33
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
Definition: UPstream.C:100
static label allocateCommunicator(const label parent, const labelList &subRanks, const bool doPstream=true)
Allocate a new communicator.
Definition: UPstream.C:108
static void resetRequests(const label sz)
Truncate number of outstanding requests.
Definition: UPstream.C:96
static void abort()
Call MPI_Abort with no other checks or cleanup.
Definition: UPstream.C:69
static void allToAll(const UList< int32_t > &sendData, UList< int32_t > &recvData, const label communicator=worldComm)
Exchange integer data with all processors (in the communicator).
static const List< commsStruct > & whichCommunication(const label communicator=worldComm)
Definition: UPstream.H:542
static int lastSlave(const label communicator=worldComm)
Process index of last sub-process.
Definition: UPstream.H:722
static int maxCommsSize
Optional maximum message size (bytes)
Definition: UPstream.H:287
static label procNo(const label comm, const int baseProcID)
Definition: UPstream.C:229
static T listScatterValues(const UList< T > &allValues, const label communicator=worldComm)
Scatter individual values from list locations.
static commsTypes defaultCommsType
Default commsType.
Definition: UPstream.H:281
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished?
Definition: UPstream.C:108
static void waitRequest(const label i)
Wait until request i has finished.
Definition: UPstream.C:104
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
static const word & myWorld()
My world.
Definition: UPstream.H:501
static int baseProcNo(const label myComm, const int procID)
Definition: UPstream.C:213
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
const volScalarField & T
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
const direction noexcept
Definition: Scalar.H:223
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
combineReduce operator for lists. Used for counting.
Definition: UPstream.H:168
void operator()(T &x, const T &y) const
Definition: UPstream.H:170