Simpatico  v1.10
List of all members | Public Member Functions | Friends
DdMd::Plan Class Reference

Detailed Description

Communication plan.

A plan contains intructions for a communication pattern for exchanging atoms, ghosts, or Groups.

A Plan has an exchange flag and storage flag for each of the directions in the Plimpton communication scheme. Each direction is indexed by a Cartesian index i=0,..,Dim-1 and j=0,1, where Dim is the dimensionality of space (i.e., normally Dim=3).

When used as a plan for an atom, each exchange flag should be set true in directions for which an atom should be communicated to exchange ownership, and each ghost flag should be set true for directions in which the atom must be sent as a ghost in order to provide position information to other processors.

When used as a plan for a Group, exchange flags are used to denote directions in which the Group must be sent, and ghost flags to denote directions in which the atoms of the Group must be sent as ghosts when the Group is divided among two or more processors.

Implementation: These 12 flags are stored in different bits of a single unsigned int that can also be accessed or set directly.

Definition at line 45 of file Plan.h.

#include <Plan.h>

Public Member Functions

 Plan ()
 Constructor. More...
 
void setExchange (int i, int j)
 Set exchange flag for direction i, j (set true). More...
 
void clearExchange (int i, int j)
 Clear exchange flag for direction i, j (set false). More...
 
void setGhost (int i, int j)
 Set ghost flag for direction i, j (set true). More...
 
void clearGhost (int i, int j)
 Clear ghost flag for direction i, j (set false). More...
 
void setFlags (unsigned int flags)
 Set all flags (contains all bits). More...
 
void clearFlags ()
 Clear all flags (set all to false, set flags_ = 0). More...
 
bool exchange (int i, int j) const
 Get bool exchange flag for direction i, j. More...
 
bool ghost (int i, int j) const
 Get ghost flag for direction i, j. More...
 
unsigned int flags () const
 Return raw flags unsigned int. More...
 

Friends

std::istream & operator>> (std::istream &in, Plan &plan)
 istream extractor (>>) for a Plan. More...
 
std::ostream & operator<< (std::ostream &out, const Plan &plan)
 ostream inserter (<<) for a Plan. More...
 

Constructor & Destructor Documentation

DdMd::Plan::Plan ( )
inline

Constructor.

All flags cleared upon construction.

Definition at line 55 of file Plan.h.

Member Function Documentation

void DdMd::Plan::setExchange ( int  i,
int  j 
)
inline

Set exchange flag for direction i, j (set true).

Parameters
iCartesian axis index i=0,1,2=x,y,z
jbinary direction index j=0, 1

Definition at line 65 of file Plan.h.

Referenced by DdMd::Exchanger::exchange(), and DdMd::operator>>().

void DdMd::Plan::clearExchange ( int  i,
int  j 
)
inline

Clear exchange flag for direction i, j (set false).

Parameters
iCartesian axis index i=0,1,2=x,y,z
jbinary direction index j=0 (up) 1 (down)

Definition at line 74 of file Plan.h.

Referenced by DdMd::operator>>().

void DdMd::Plan::setGhost ( int  i,
int  j 
)
inline

Set ghost flag for direction i, j (set true).

Parameters
iCartesian axis index i=0,1,2=x,y,z
jbinary direction index j=0 (up) 1 (down)

Definition at line 83 of file Plan.h.

Referenced by DdMd::Exchanger::exchange(), DdMd::GroupStorage< N >::markGhosts(), and DdMd::operator>>().

void DdMd::Plan::clearGhost ( int  i,
int  j 
)
inline

Clear ghost flag for direction i, j (set false).

Parameters
iCartesian axis index i=0,1,2=x,y,z
jbinary direction index j=0 (up) 1 (down)

Definition at line 92 of file Plan.h.

Referenced by DdMd::Exchanger::exchange(), and DdMd::operator>>().

void DdMd::Plan::setFlags ( unsigned int  flags)
inline

Set all flags (contains all bits).

Definition at line 98 of file Plan.h.

References flags().

Referenced by DdMd::Exchanger::exchange(), and DdMd::Group< N >::unpack().

void DdMd::Plan::clearFlags ( )
inline

Clear all flags (set all to false, set flags_ = 0).

Definition at line 104 of file Plan.h.

Referenced by DdMd::Group< N >::clear(), DdMd::Exchanger::exchange(), and DdMd::Group< N >::Group().

bool DdMd::Plan::exchange ( int  i,
int  j 
) const
inline

Get bool exchange flag for direction i, j.

Parameters
iCartesian axis index i=0,1,2=x,y,z
jbinary direction index j=0 (up) 1 (down)

Definition at line 113 of file Plan.h.

Referenced by DdMd::Exchanger::exchange(), DdMd::GroupStorage< N >::markSpanningGroups(), DdMd::operator<<(), and DdMd::GroupStorage< N >::pack().

bool DdMd::Plan::ghost ( int  i,
int  j 
) const
inline

Get ghost flag for direction i, j.

Parameters
iCartesian axis index i=0,1,2=x,y,z
jbinary direction index j=0 (up) 1 (down)

Definition at line 122 of file Plan.h.

Referenced by DdMd::Exchanger::exchange(), and DdMd::operator<<().

unsigned int DdMd::Plan::flags ( ) const
inline

Return raw flags unsigned int.

Definition at line 128 of file Plan.h.

References operator<<, and operator>>.

Referenced by DdMd::Atom::copyLocalGhost(), DdMd::Exchanger::exchange(), DdMd::Group< N >::pack(), and setFlags().

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
Plan plan 
)
friend

istream extractor (>>) for a Plan.

Parameters
ininput stream
planPlan to be read from stream
Returns
modified input stream

Definition at line 22 of file Plan.cpp.

Referenced by flags().

std::ostream& operator<< ( std::ostream &  out,
const Plan plan 
)
friend

ostream inserter (<<) for a Plan.

Format, one one line with no line break:

Parameters
outoutput stream
planPlan to be written to stream
Returns
modified output stream

Definition at line 58 of file Plan.cpp.

Referenced by flags().


The documentation for this class was generated from the following files: