Pstream.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-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2024 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::Pstream
29 
30 Description
31  Inter-processor communications stream.
32 
33 SourceFiles
34  Pstream.C
35  PstreamBroadcast.C
36  PstreamGather.C
37  PstreamCombineGather.C
38  PstreamGatherList.C
39  PstreamExchangeConsensus.C
40  PstreamExchange.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Foam_Pstream_H
45 #define Foam_Pstream_H
46 
47 #include "UPstream.H"
48 #include "DynamicList.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class Pstream Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class Pstream
60 :
61  public UPstream
62 {
63 protected:
64 
65  // Protected Data
66 
67  //- Allocated transfer buffer (can be used for send or receive)
69 
70 
71 public:
72 
73  //- Declare name of the class and its debug switch
74  ClassName("Pstream");
75 
76 
77  // Constructors
78 
79  //- Construct for given communication type, with optional buffer size
80  explicit Pstream
81  (
83  const label bufSize = 0
84  )
85  :
87  {
88  if (bufSize > 0)
89  {
90  transferBuf_.setCapacity(bufSize + 2*sizeof(scalar) + 1);
91  }
92  }
93 
94 
95  // Static Functions
96 
97  // Broadcast
98 
99  //- Broadcast buffer content to all processes in communicator.
100  using UPstream::broadcast;
101 
102  //- Broadcast content (contiguous or non-contiguous) to all
103  //- communicator ranks. Does nothing in \b non-parallel.
104  template<class Type>
105  static void broadcast
106  (
107  Type& value,
108  const label comm = UPstream::worldComm
109  );
110 
111  //- Broadcast multiple items to all communicator ranks.
112  //- Does nothing in \b non-parallel.
113  template<class Type, class... Args>
114  static void broadcasts(const label comm, Type& arg1, Args&&... args);
115 
116  //- Broadcast list content (contiguous or non-contiguous) to all
117  //- communicator ranks. Does nothing in \b non-parallel.
118  // For contiguous list data, this avoids serialization overhead,
119  // but at the expense of an additional broadcast call.
120  template<class ListType>
121  static void broadcastList
122  (
123  ListType& list,
124  const label comm = UPstream::worldComm
125  );
126 
127 
128  // Gather
129 
130  //- Gather (reduce) data, applying \c bop to combine \c value
131  //- from different processors. The basis for Foam::reduce().
132  // Uses linear/tree communication (with parallel guard).
133  template<class T, class BinaryOp>
134  static void gather
135  (
136  T& value,
137  const BinaryOp& bop,
138  const int tag = UPstream::msgType(),
139  const label comm = UPstream::worldComm
140  );
141 
142  //- Gather individual values into list locations.
143  // On master list length == nProcs, otherwise zero length.
144  // \n
145  // For \b non-parallel :
146  // the returned list length is 1 with localValue.
147  template<class T>
149  (
150  const T& localValue,
151  const label comm = UPstream::worldComm,
153  const int tag = UPstream::msgType()
154  );
155 
156  //- Scatter individual values from list locations.
157  // On master input list length == nProcs, ignored on other procs.
158  // \n
159  // For \b non-parallel :
160  // returns the first list element (or default initialized).
161  template<class T>
162  static T listScatterValues
163  (
164  const UList<T>& allValues,
165  const label comm = UPstream::worldComm,
167  const int tag = UPstream::msgType()
168  );
169 
170 
171  // Gather/combine data
172  // Inplace combine values from processors.
173  // (Uses construct from Istream instead of \c << operator)
174 
175  //- Gather data, applying \c cop to inplace combine \c value
176  //- from different processors.
177  // Uses linear/tree communication (with parallel guard).
178  template<class T, class CombineOp>
179  static void combineGather
180  (
182  T& value,
183  const CombineOp& cop,
184  const int tag = UPstream::msgType(),
185  const label comm = UPstream::worldComm
186  );
187 
188  //- Reduce inplace (cf. MPI Allreduce)
189  //- applying \c cop to inplace combine \c value
190  //- from different processors.
191  //- After completion all processors have the same data.
192  // Uses linear/tree communication.
193  // Wraps combineGather/broadcast (may change in the future).
194  template<class T, class CombineOp>
195  static void combineReduce
196  (
198  T& value,
199  const CombineOp& cop,
200  const int tag = UPstream::msgType(),
201  const label comm = UPstream::worldComm
202  );
203 
204  //- Same as Pstream::combineReduce
205  template<class T, class CombineOp>
206  static void combineAllGather
207  (
208  T& value,
209  const CombineOp& cop,
210  const int tag = UPstream::msgType(),
211  const label comm = UPstream::worldComm
212  )
213  {
214  Pstream::combineReduce(value, cop, tag, comm);
215  }
216 
217 
218  // Combine variants working on whole List at a time.
219 
220  //- Combines List elements.
221  // Uses linear/tree communication (with parallel guard).
222  template<class T, class CombineOp>
223  static void listCombineGather
224  (
226  UList<T>& values,
227  const CombineOp& cop,
228  const int tag = UPstream::msgType(),
229  const label comm = UPstream::worldComm
230  );
231 
232  //- Combines List elements.
233  //- After completion all processors have the same data.
234  // Uses linear/tree communication (with parallel guard).
235  template<class T, class CombineOp>
236  static void listCombineReduce
237  (
239  List<T>& values,
240  const CombineOp& cop,
241  const int tag = UPstream::msgType(),
242  const label comm = UPstream::worldComm
243  );
244 
245  //- Same as Pstream::listCombineReduce
246  template<class T, class CombineOp>
247  static void listCombineAllGather
248  (
250  List<T>& values,
251  const CombineOp& cop,
252  const int tag = UPstream::msgType(),
253  const label comm = UPstream::worldComm
254  )
255  {
256  Pstream::listCombineReduce(values, cop, tag, comm);
257  }
258 
259 
260  // Combine variants working on whole map at a time.
261  // Container needs iterators, find() and insert methods defined.
262 
263  //- Combine Map elements.
264  // Uses linear/tree communication (with parallel guard).
265  template<class Container, class CombineOp>
266  static void mapCombineGather
267  (
268  Container& values,
269  const CombineOp& cop,
270  const int tag = UPstream::msgType(),
271  const label comm = UPstream::worldComm
272  );
273 
274  //- Reduce inplace (cf. MPI Allreduce)
275  //- applying \c cop to inplace combine map \c values
276  //- from different processors.
277  //- After completion all processors have the same data.
278  // Uses the specified communication schedule.
279  // Wraps mapCombineGather/broadcast (may change in the future).
280  //- After completion all processors have the same data.
281  template<class Container, class CombineOp>
282  static void mapCombineReduce
283  (
284  Container& values,
285  const CombineOp& cop,
286  const int tag = UPstream::msgType(),
287  const label comm = UPstream::worldComm
288  );
289 
290  //- Same as Pstream::mapCombineReduce
291  template<class Container, class CombineOp>
292  static void mapCombineAllGather
293  (
294  Container& values,
295  const CombineOp& cop,
296  const int tag = UPstream::msgType(),
297  const label comm = UPstream::worldComm
298  )
299  {
300  Pstream::mapCombineReduce(values, cop, tag, comm);
301  }
302 
303 
304  // Gather/scatter keeping the individual processor data separate.
305  // The values is a List of size UPstream::nProcs() where
306  // values[UPstream::myProcNo()] is the data for the current processor.
307 
308  //- Gather data, but keep individual values separate.
309  //- Uses the specified communication schedule.
310  template<class T>
311  static void gatherList
312  (
313  const UList<commsStruct>& comms,
315  UList<T>& values,
316  const int tag,
317  const label comm
318  );
319 
320  //- Gather data, but keep individual values separate.
321  //- Uses linear/tree communication.
322  template<class T>
323  static void gatherList
324  (
326  UList<T>& values,
327  const int tag = UPstream::msgType(),
328  const label comm = UPstream::worldComm
329  );
330 
331  //- Gather data, but keep individual values separate.
332  //- Uses MPI_Allgather or manual linear/tree communication.
333  // After completion all processors have the same data.
334  // Wraps gatherList/scatterList (may change in the future).
335  template<class T>
336  static void allGatherList
337  (
339  UList<T>& values,
340  const int tag = UPstream::msgType(),
341  const label comm = UPstream::worldComm
342  );
343 
344 
345  // Scatter
346 
347  //- Inverse of gatherList.
348  //- Uses the specified communication schedule.
349  template<class T>
350  static void scatterList
351  (
352  const UList<commsStruct>& comms,
353  UList<T>& values,
354  const int tag,
355  const label comm
356  );
357 
358  //- Inverse of gatherList.
359  //- Uses linear/tree communication.
360  template<class T>
361  static void scatterList
362  (
363  UList<T>& values,
364  const int tag = UPstream::msgType(),
365  const label comm = UPstream::worldComm
366  );
367 
368 
369  // Exchange
370 
371  //- Helper: exchange sizes of sendBufs for specified send/recv ranks
372  template<class Container>
373  static void exchangeSizes
374  (
375  const labelUList& sendProcs,
376  const labelUList& recvProcs,
377  const Container& sendBufs,
378  labelList& sizes,
379  const label tag = UPstream::msgType(),
380  const label comm = UPstream::worldComm
381  );
382 
383  //- Helper: exchange sizes of sendBufs for specified neighbour ranks
384  template<class Container>
385  static void exchangeSizes
386  (
387  const labelUList& neighProcs,
388  const Container& sendBufs,
389  labelList& sizes,
390  const label tag = UPstream::msgType(),
391  const label comm = UPstream::worldComm
392  );
393 
394  //- Helper: exchange sizes of sendBufs.
395  //- The sendBufs is the data per processor (in the communicator).
396  // Returns sizes of sendBufs on the sending processor.
397  // \n
398  // For \b non-parallel : copy sizes from sendBufs directly.
399  template<class Container>
400  static void exchangeSizes
401  (
402  const Container& sendBufs,
403  labelList& recvSizes,
404  const label comm = UPstream::worldComm
405  );
406 
407  //- Exchange the \b non-zero sizes of sendBufs entries (sparse map)
408  //- with other ranks in the communicator
409  //- using non-blocking consensus exchange.
410  //
411  // Since the recvData map always cleared before receipt and sizes
412  // of zero are never transmitted, a simple check
413  // of its keys is sufficient to determine connectivity.
414  //
415  // For \b non-parallel : copy size of rank (if it exists and non-empty)
416  // from sendBufs to recvSizes.
417  //
418  // \note The message tag is adjusted internally to improve uniqueness
419  template<class Container>
420  static void exchangeSizes
421  (
422  const Map<Container>& sendBufs,
423  Map<label>& recvSizes,
424  const label tag = UPstream::msgType(),
425  const label comm = UPstream::worldComm
426  );
427 
428  //- Helper: exchange \em contiguous data.
429  //- Sends sendBufs, receives into recvBufs using predetermined receive
430  //- sizing.
431  // If wait=true will wait for all transfers to finish.
432  template<class Container, class Type>
433  static void exchange
434  (
435  const UList<Container>& sendBufs,
436  const labelUList& recvSizes,
437  List<Container>& recvBufs,
438  const int tag = UPstream::msgType(),
439  const label comm = UPstream::worldComm,
440  const bool wait = true
441  );
442 
443  //- Exchange \em contiguous data.
444  //- Sends sendBufs, receives into recvBufs.
445  // Data provided and received as container.
446  //
447  // No internal guards or resizing.
448  template<class Container, class Type>
449  static void exchange
450  (
451  const Map<Container>& sendBufs,
452  const Map<label>& recvSizes,
453  Map<Container>& recvBufs,
454  const int tag = UPstream::msgType(),
455  const label comm = UPstream::worldComm,
456  const bool wait = true
457  );
458 
459  //- Exchange \em contiguous data.
460  //- Sends sendBufs, receives into recvBufs.
461  //- Determines sizes to receive.
462  // If wait=true will wait for all transfers to finish.
463  template<class Container, class Type>
464  static void exchange
465  (
466  const UList<Container>& sendBufs,
467  List<Container>& recvBufs,
468  const int tag = UPstream::msgType(),
469  const label comm = UPstream::worldComm,
470  const bool wait = true
471  );
472 
473  //- Exchange \em contiguous data.
474  //- Sends sendBufs, receives into recvBufs.
475  //- Determines sizes to receive.
476  // If wait=true will wait for all transfers to finish.
477  template<class Container, class Type>
478  static void exchange
479  (
480  const Map<Container>& sendBufs,
481  Map<Container>& recvBufs,
482  const int tag = UPstream::msgType(),
483  const label comm = UPstream::worldComm,
484  const bool wait = true
485  );
486 
487 
488  // Non-blocking exchange
489 
490  //- Exchange \em contiguous data using non-blocking consensus (NBX)
491  //- Sends sendData, receives into recvData.
492  //
493  // Each entry of the recvBufs list is cleared before receipt.
494  // For \b non-parallel : copy own rank from sendBufs to recvBufs.
495  //
496  // \note The message tag should be chosen to be a unique value
497  // since the implementation uses probing with ANY_SOURCE !!
498  template<class Container, class Type>
499  static void exchangeConsensus
500  (
501  const UList<Container>& sendBufs,
502  List<Container>& recvBufs,
503  const int tag,
504  const label comm,
505  const bool wait = true
506  );
507 
508  //- Exchange \em contiguous data using non-blocking consensus (NBX)
509  //- Sends sendData, receives into recvData.
510  //
511  // Each \em entry of the recvBufs map is cleared before receipt,
512  // but the map itself if not cleared. This allows the map to preserve
513  // allocated space (eg DynamicList entries) between calls.
514  //
515  // For \b non-parallel : copy own rank (if it exists and non-empty)
516  // from sendBufs to recvBufs.
517  //
518  // \note The message tag should be chosen to be a unique value
519  // since the implementation uses probing with ANY_SOURCE !!
520  template<class Container, class Type>
521  static void exchangeConsensus
522  (
523  const Map<Container>& sendBufs,
524  Map<Container>& recvBufs,
525  const int tag,
526  const label comm,
527  const bool wait = true
528  );
529 
530  //- Exchange \em contiguous data using non-blocking consensus (NBX)
531  //- Sends sendData returns receive information.
532  //
533  // For \b non-parallel : copy own rank (if it exists and non-empty)
534  //
535  // \note The message tag should be chosen to be a unique value
536  // since the implementation uses probing with ANY_SOURCE !!
537  template<class Container, class Type>
539  (
540  const Map<Container>& sendBufs,
541  const int tag,
542  const label comm,
543  const bool wait = true
544  );
545 
546 
547  // Housekeeping
548 
549  //- \deprecated(2024-01) Broadcast data
550  template<class T>
551  FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()")
552  static void scatter
553  (
554  T& value,
555  const int tag = UPstream::msgType(),
556  const label comm = UPstream::worldComm
557  )
558  {
559  Pstream::broadcast(value, comm);
560  }
561 
562  //- \deprecated(2024-01) Broadcast data
563  template<class T>
564  FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()")
565  static void combineScatter
566  (
567  T& value,
568  const int tag = UPstream::msgType(),
569  const label comm = UPstream::worldComm
570  )
571  {
572  Pstream::broadcast(value, comm);
573  }
574 
575  //- \deprecated(2024-01) Broadcast data
576  template<class T>
577  FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()")
578  static void listCombineScatter
579  (
580  List<T>& value,
581  const int tag = UPstream::msgType(),
582  const label comm = UPstream::worldComm
583  )
584  {
585  Pstream::broadcast(value, comm);
586  }
587 
588  //- \deprecated(2024-01) Broadcast data
589  template<class Container>
590  FOAM_DEPRECATED_FOR(2024-01, "Pstream::broadcast()")
591  static void mapCombineScatter
592  (
593  Container& values,
594  const int tag = UPstream::msgType(),
595  const label comm = UPstream::worldComm
596  )
597  {
598  Pstream::broadcast(values, comm);
599  }
600 };
601 
602 
603 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
604 
605 } // End namespace Foam
606 
607 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
608 
609 #ifdef NoRepository
610  #include "PstreamBroadcast.C"
611  #include "PstreamGather.C"
612  #include "PstreamCombineGather.C"
613  #include "PstreamGatherList.C"
614  #include "PstreamExchange.C"
615 #endif
616 
617 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
618 
619 #endif
620 
621 // ************************************************************************* //
static void listCombineGather(UList< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combines List elements.
static void mapCombineGather(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combine Map elements.
static T listScatterValues(const UList< T > &allValues, const label comm=UPstream::worldComm, const int tag=UPstream::msgType())
Scatter individual values from list locations.
Gather data from all processors onto single processor according to some communication schedule (usual...
static void combineScatter(T &value, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Definition: Pstream.H:655
static void scatter(T &value, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Definition: Pstream.H:640
static void mapCombineAllGather(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Same as Pstream::mapCombineReduce.
Definition: Pstream.H:336
commsTypes
Communications types.
Definition: UPstream.H:77
Pstream(const UPstream::commsTypes commsType, const label bufSize=0)
Construct for given communication type, with optional buffer size.
Definition: Pstream.H:82
static void broadcastList(ListType &list, const label comm=UPstream::worldComm)
Broadcast list content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
static void scatterList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Inverse of gatherList. Uses the specified communication schedule.
static void gatherList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
void setCapacity(const label len)
Alter the size of the underlying storage.
Definition: DynamicListI.H:303
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:1252
Gather data from all processors onto single processor according to some communication schedule (usual...
static List< T > listGatherValues(const T &localValue, const label comm=UPstream::worldComm, const int tag=UPstream::msgType())
Gather individual values into list locations.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
Definition: UPstream.H:421
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:65
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:164
static void gather(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather (reduce) data, applying bop to combine value from different processors. The basis for Foam::re...
Definition: PstreamGather.C:37
Inter-processor communications stream.
Definition: Pstream.H:54
static void combineReduce(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
static void combineGather(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, applying cop to inplace combine value from different processors.
Variant of gather. Normal gather uses:
static void listCombineAllGather(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Same as Pstream::listCombineReduce.
Definition: Pstream.H:283
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:105
commsTypes commsType() const noexcept
Get the communications type of the stream.
Definition: UPstream.H:1284
static void exchange(const UList< Container > &sendBufs, const labelUList &recvSizes, List< Container > &recvBufs, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool wait=true)
Helper: exchange contiguous data. Sends sendBufs, receives into recvBufs using predetermined receive ...
UPstream(const commsTypes commsType) noexcept
Construct for given communication type.
Definition: UPstream.H:507
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
ClassName("Pstream")
Declare name of the class and its debug switch.
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all communicator ranks. Does nothing in non-parallel. ...
static void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual linear/tree communicat...
static bool broadcast(char *buf, const std::streamsize bufSize, const label communicator, const int rootProcNo=masterNo())
Broadcast buffer contents to all processes in given communicator. The sizes must match on all process...
static void exchangeSizes(const labelUList &sendProcs, const labelUList &recvProcs, const Container &sendBufs, labelList &sizes, const label tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Helper: exchange sizes of sendBufs for specified send/recv ranks.
static void combineAllGather(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Same as Pstream::combineReduce.
Definition: Pstream.H:234
static void exchangeConsensus(const UList< Container > &sendBufs, List< Container > &recvBufs, const int tag, const label comm, const bool wait=true)
Exchange contiguous data using non-blocking consensus (NBX) Sends sendData, receives into recvData...
DynamicList< char > transferBuf_
Allocated transfer buffer (can be used for send or receive)
Definition: Pstream.H:65
static void listCombineScatter(List< T > &value, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Definition: Pstream.H:670
static void mapCombineReduce(Container &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine map values from different processo...
Foam::argList args(argc, argv)
Inter-processor communications stream.
Definition: UPstream.H:65
static void mapCombineScatter(Container &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Definition: Pstream.H:685
Namespace for OpenFOAM.
A HashTable to objects of type <T> with a label key.
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combines List elements. After completion all processors have the same data.