Commit Graph

33 Commits

Author SHA1 Message Date
7a41a9c9c3 collatedFileOperation: preferentially collect all data in the simulation thread
so the write thread does not have to do any parallel communication.  This avoids
the bugs in the threading support in OpenMPI.

Patch contributed by Mattijs Janssens
Resolves bug-report https://bugs.openfoam.org/view.php?id=2669
2017-10-27 17:13:43 +01:00
9c3bef5a99 ENH: improve robustness of MPI start/stop
- warn or fatal if Pstream::init or Pstream::exit are called multiple
  times.

- additional Pstream::initNull method as failsafe to initialize MPI
  when the underlying OpenFOAM process is not running in parallel but
  the application still needs MPI.

- Pstream::exit() can now also be called without having used MPI::init(),
  which means it can be used to cleanup serial process or for
  applications that used the special purpose Pstream::initNull()
  mechanism.
2017-11-17 11:29:26 +01:00
37c6127338 COMP: Pstream: dummy version misses dependency of pthread (needed in OSspecific). Fixes #614. 2017-10-09 12:47:56 +01:00
e453f0bf02 ENH: Pstream: added maxCommsSize setting to do (unstructured) parallel transfers in blocks.
This is controlled by the setting maxCommsSize in etc/controlDict which
specifies the max number of bytes per exchange. If set to <= 0 it
is ignored. This max size of messages is important when doing e.g.
load balancing which can send over whole meshes.
2016-12-12 17:32:24 +00:00
6e573ad7e8 UList: Rationalize assignment (shallow-copy vs deep-copy)
//- Disallow default shallow-copy assignment
    //
    //  Assignment of UList<T> may need to be either shallow (copy pointer)
    //  or deep (copy elements) depending on context or the particular type
    //  of list derived from UList and it is confusing and prone to error
    //  for the default assignment to be either.  The solution is to
    //  disallow default assignment and provide separate 'shallowCopy' and
    //  'deepCopy' member functions.
    void operator=(const UList<T>&) = delete;

    //- Copy the pointer held by the given UList.
    inline void shallowCopy(const UList<T>&);

    //- Copy elements of the given UList.
    void deepCopy(const UList<T>&);
2016-04-03 10:26:05 +01:00
88bd912374 Pstream: optimisation of data exchange
Contributed by Mattijs Janssens.

1. Any non-blocking data exchange needs to know in advance the sizes to
   receive so it can size the buffer.  For "halo" exchanges this is not
   a problem since the sizes are known in advance but or all other data
   exchanges these sizes need to be exchanged in advance.

   This was previously done by having all processors send the sizes of data to
   send to the master and send it back such that all processors
   - had the same information
   - all could work out who was sending what to where and hence what needed to
     be received.

   This is now changed such that we only send the size to the
   destination processor (instead of to all as previously). This means
   that
   - the list of sizes to send is now of size nProcs v.s. nProcs*nProcs before
   - we cut out the route to the master and back by using a native MPI
     call

   It causes a small change to the API of exchange and PstreamBuffers -
   they now return the sizes of the local buffers only (a labelList) and
   not the sizes of the buffers on all processors (labelListList)

2. Reversing the order of the way in which the sending is done when
   scattering information from the master processor to the other
   processors. This is done in a tree like fashion. Each processor has a
   set of processors to receive from/ send to. When receiving it will
   first receive from the processors with the least amount of
   sub-processors (i.e. the ones which return first). When sending it
   needs to do the opposite: start sending to the processor with the
   most amount of sub-tree since this is the critical path.
2016-04-02 18:32:11 +01:00
c4d5f65a10 Completed update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-11 09:03:39 +00:00
42fb1b9e8e Updated notImplemented -> NotImplemented
The new NotImplemented macro uses __PRETTY_FUNCTION__ for GNU compatible
compilers otherwise __func__ to provide the function name string.
2015-11-01 10:26:37 +00:00
c4a4611b0f Merge remote-tracking branch 'origin/feature/procAgglom'
Conflicts:
	src/OpenFOAM/meshes/lduMesh/lduMesh.H
2013-05-02 14:44:59 +01:00
ea8d290191 ENH: communicators: initial version - extended Pstream API 2013-02-04 10:17:37 +00:00
927fc0a313 ENH: mpi/Pstream: encapsulate mpi_reduce calls 2012-06-07 17:27:02 +01:00
7605c01260 ENH: gAverage: (used in normFactor) : use single reduction 2012-03-22 12:39:59 +00:00
3febf2314b ENH: non-blocking reduce with sumOp<scalar> 2012-02-22 12:34:01 +00:00
9420dd7bfe ENH: reduce: specialisation for reduce of vector2D (used in gamg) 2012-02-14 18:23:12 +00:00
2516d984b4 ENH: fvPatchField: support for polling. Support for zero-copy transfer. 2012-01-16 15:59:03 +00:00
f5573332a8 BUG: UIPread: missing constructor 2011-10-06 15:15:29 +01:00
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
537a916dff ENH: Pstream: expose tag 2011-07-29 18:12:48 +01:00
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
d79237597e STYLE: Fixing code style requirements for all src. 2010-07-28 13:31:46 +01:00
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
e4b4bf2bf0 ENH: UIPstream when reaches eof deletes the underlying buffer.
Only in PstreamBuffers mode. This makes sure that data from other processors
already handled gets deleted.
2010-03-04 15:03:10 +00:00
e794f35c86 ENH: moved read index out of UIPstream into PstreamBuffers
So now we can read multiple times (using UIPstream) from PstreamBuffers
    PstreamBuffers pBufs
    UIPstream str1(procI, pBufs);
    str1>> ..
    UIPstream str2(procI, pBufs);
    str1>> ..
2010-02-19 12:49:48 +00:00
7e200aecbf optional no wait on Pstream::exchange 2009-10-27 13:09:08 +00:00
46f1df810c unallocated Pstream 2009-10-26 09:59:07 +00:00
0b51b764d6 bundle outstanding send and receive requests 2009-08-25 23:03:33 +01:00
28b200bcd9 update copyrights for 2009 2008-12-31 19:01:56 +01:00
02cabc3cf2 updated Copyright (C) \d+-2008 OpenCFD Ltd. 2008-06-25 15:01:46 +02:00
763cc5e4ab Pstream : avoid compiler warnings, doxygen ignore file-scope variables 2008-06-13 19:47:04 +02:00
93d1f74d8c dummy Pstream update and typo in Time.C comment. Sorry for mixup. 2008-06-02 19:16:12 +01:00
3170c7c0c9 Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00