43 #ifndef DOMI_MDCOMM_HPP
44 #define DOMI_MDCOMM_HPP
47 #include "Teuchos_Comm.hpp"
48 #include "Teuchos_Array.hpp"
49 #include "Teuchos_ArrayView.hpp"
50 #include "Teuchos_ParameterList.hpp"
53 #include "Domi_ConfigDefs.hpp"
58 #include "Epetra_MpiComm.h"
60 #include "Epetra_SerialComm.h"
115 typedef Teuchos::Array< int >::size_type size_type;
122 static const Layout commLayout;
145 MDComm(
const Teuchos::ArrayView< const int > & commDims,
146 const Teuchos::ArrayView< const int > & periodic =
147 Teuchos::ArrayView< const int >());
165 MDComm(
const Teuchos::RCP<
const Teuchos::Comm< int > > teuchosComm,
166 const Teuchos::ArrayView< const int > & commDims,
167 const Teuchos::ArrayView< const int > & periodic =
168 Teuchos::ArrayView< const int >());
181 MDComm(Teuchos::ParameterList & plist);
194 MDComm(
const Teuchos::RCP<
const Teuchos::Comm< int > > teuchosComm,
195 Teuchos::ParameterList & plist);
217 MDComm(
const Teuchos::RCP<
const Teuchos::Comm< int > > teuchosComm,
242 const Teuchos::ArrayView< const int > & commDims,
243 const Teuchos::ArrayView< const int > & periodic =
244 Teuchos::ArrayView< const int >());
267 MDComm(
const Teuchos::RCP<
const Teuchos::Comm< int > > teuchosComm,
269 const Teuchos::ArrayView< const int > & commDims,
270 const Teuchos::ArrayView< const int > & periodic =
271 Teuchos::ArrayView< const int >());
302 const Slice & slice);
313 const Teuchos::ArrayView< Slice > & slices);
350 Teuchos::RCP< const Teuchos::Comm< int > >
getTeuchosComm()
const;
359 Teuchos::RCP< const Epetra_Comm > getEpetraComm()
const;
460 Teuchos::ArrayView< Teuchos::RCP< const MDComm > >
getAxisComms()
const;
471 Teuchos::RCP< const MDComm >
getAxisComm(
int axis)
const;
483 Teuchos::RCP< const Teuchos::Comm< int > > _teuchosComm;
488 mutable Teuchos::RCP< const Epetra_Comm > _epetraComm;
492 Teuchos::Array< int > _commDims;
495 Teuchos::Array< int > _commStrides;
498 Teuchos::Array< int > _commIndex;
501 Teuchos::Array< int > _periodic;
508 mutable Teuchos::Array< Teuchos::RCP< const MDComm > > _axisComms;
int numDims() const
Get the number of dimensions.
int getUpperNeighbor(int axis) const
Get the rank of the upper neighbor.
Teuchos::RCP< const MDComm > getAxisComm(int axis) const
Return an axis communicator for the given axis.
A Slice defines a subset of a container.
Multi-dimensional communicator object.
Definition: Domi_MDComm.hpp:108
int getLowerNeighbor(int axis) const
Get the rank of the lower neighbor.
A Slice contains a start, stop, and step index, describing a subset of an ordered container...
Definition: Domi_Slice.hpp:137
int getCommIndex(int axis) const
Get the comm index along the given axis.
Teuchos::Array< int > getCommDims() const
Get the communicator sizes along each axis.
bool isPeriodic(int axis) const
Return the periodic flag for the given axis.
bool onSubcommunicator() const
Query whether this processor is on the sub-communicator.
Teuchos::RCP< const Teuchos::Comm< int > > getTeuchosComm() const
Get the Teuchos communicator.
int getCommDim(int axis) const
Get the communicator size along the given axis.
Teuchos::ArrayView< Teuchos::RCP< const MDComm > > getAxisComms() const
Return array of all axis communicators.
MDComm & operator=(const MDComm &source)
Assignment operator.