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 >());
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);
359 Teuchos::RCP< const Epetra_Comm > getEpetraComm()
const;
460 Teuchos::ArrayView< Teuchos::RCP< const MDComm > >
getAxisComms()
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;
A Slice defines a subset of a container.
Multi-dimensional communicator object.
Definition: Domi_MDComm.hpp:109
MDComm & operator=(const MDComm &source)
Assignment operator.
MDComm(const Teuchos::RCP< const Teuchos::Comm< int > > teuchosComm, Teuchos::ParameterList &plist)
Constructor with Teuchos Comm and ParameterList.
Teuchos::Array< int > getCommDims() const
Get the communicator sizes along each axis.
MDComm(const Teuchos::RCP< const Teuchos::Comm< int > > teuchosComm, int numDims, const Teuchos::ArrayView< const int > &commDims, const Teuchos::ArrayView< const int > &periodic=Teuchos::ArrayView< const int >())
Constructor with Teuchos Comm, number of dimensions and axis sizes.
int getLowerNeighbor(int axis) const
Get the rank of the lower neighbor.
Teuchos::ArrayView< Teuchos::RCP< const MDComm > > getAxisComms() const
Return array of all axis communicators.
MDComm(int numDims, const Teuchos::ArrayView< const int > &commDims, const Teuchos::ArrayView< const int > &periodic=Teuchos::ArrayView< const int >())
Constructor with number of dimensions and axis sizes.
int getUpperNeighbor(int axis) const
Get the rank of the upper neighbor.
MDComm(const Teuchos::RCP< const Teuchos::Comm< int > > teuchosComm, const Teuchos::ArrayView< const int > &commDims, const Teuchos::ArrayView< const int > &periodic=Teuchos::ArrayView< const int >())
Constructor with Teuchos Comm and axis sizes.
MDComm(const MDComm &source)
Copy constructor.
MDComm(Teuchos::ParameterList &plist)
Constructor with ParameterList.
Teuchos::RCP< const MDComm > getAxisComm(int axis) const
Return an axis communicator for the given axis.
int getCommIndex(int axis) const
Get the comm index along the given axis.
MDComm(int numDims)
Constructor with number of dimensions.
MDComm(const Teuchos::RCP< const Teuchos::Comm< int > > teuchosComm, int numDims)
Constructor with number of dimensions.
MDComm(const MDComm &parent, int axis, int axisRank)
Axis rank sub-communicator constructor.
bool onSubcommunicator() const
Query whether this processor is on the sub-communicator.
bool isPeriodic(int axis) const
Return the periodic flag for the given axis.
Teuchos::RCP< const Teuchos::Comm< int > > getTeuchosComm() const
Get the Teuchos communicator.
int numDims() const
Get the number of dimensions.
MDComm(const Teuchos::ArrayView< const int > &commDims, const Teuchos::ArrayView< const int > &periodic=Teuchos::ArrayView< const int >())
Constructor with default Teuchos comm and axis sizes.
MDComm(const MDComm &parent, int axis, const Slice &slice)
Slice sub-communicator constructor.
int getCommDim(int axis) const
Get the communicator size along the given axis.
MDComm(const MDComm &parent, const Teuchos::ArrayView< Slice > &slices)
Array of Slices sub-communicator constructor.
A Slice contains a start, stop, and step index, describing a subset of an ordered container.
Definition: Domi_Slice.hpp:138