OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

Pstream.C File Reference

Pstream for GAMMA. More...

Go to the source code of this file.


Namespaces

namespace  Foam
 Namespace for OpenFOAM.

Functions

static void handler (void)
void reduce (scalar &Value, const sumOp< scalar > &bop)

Detailed Description

Pstream for GAMMA.

Original source file Pstream.C

GAMMA has a (polling) receive handler which gets called every time a received message is complete. Ours stores the length of the currently received message and sets up the next buffer to store the next message in. Note that the pattern between two processors can be

  • send
  • receive
  • receive
  • send since the first swap might belong to a local exchange and the second to a reduce. Since gamma has to have the receive buffers already set up we have to allocate them big enough. To prevent excessive amounts needed we dynamically resize them (never shrink) by sending special 'resize' messages before sending a largish message.

Because of this we actually need four receive buffers:

  • send
  • receive resize message
  • receive normal message
  • receive resize message
  • receive normal message
  • send

The special resize message is a message with a special header which (hopefully) should never appear in normal exchanges (it actually checks for this in the OPstream::send)

Definition in file Pstream.C.

Copyright © 2000-2009 OpenCFD Ltd