Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::LibUtilities::CommMpi Class Reference

A global linear system. More...

#include <CommMpi.h>

Inheritance diagram for Nektar::LibUtilities::CommMpi:
Inheritance graph
[legend]
Collaboration diagram for Nektar::LibUtilities::CommMpi:
Collaboration graph
[legend]

Public Member Functions

 CommMpi (int narg, char *arg[])
virtual ~CommMpi ()
MPI_Comm GetComm ()
- Public Member Functions inherited from Nektar::LibUtilities::Comm
 Comm (int narg, char *arg[])
virtual ~Comm ()
void Finalise ()
int GetSize ()
 Returns number of processes.
int GetRank ()
const std::string & GetType () const
void Block ()
 Block execution until all processes reach this point.
void Send (int pProc, Array< OneD, NekDouble > &pData)
void Send (int pProc, Array< OneD, int > &pData)
void Send (int pProc, std::vector< unsigned int > &pData)
void Recv (int pProc, Array< OneD, NekDouble > &pData)
void Recv (int pProc, Array< OneD, int > &pData)
void Recv (int pProc, std::vector< unsigned int > &pData)
void SendRecv (int pSendProc, Array< OneD, NekDouble > &pSendData, int pRecvProc, Array< OneD, NekDouble > &pRecvData)
void SendRecv (int pSendProc, Array< OneD, int > &pSendData, int pRecvProc, Array< OneD, int > &pRecvData)
void SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, NekDouble > &pSendData)
void SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, int > &pSendData)
void AllReduce (NekDouble &pData, enum ReduceOperator pOp)
void AllReduce (int &pData, enum ReduceOperator pOp)
void AllReduce (Array< OneD, NekDouble > &pData, enum ReduceOperator pOp)
void AllReduce (Array< OneD, int > &pData, enum ReduceOperator pOp)
void AllReduce (std::vector< unsigned int > &pData, enum ReduceOperator pOp)
void AlltoAll (Array< OneD, NekDouble > &pSendData, Array< OneD, NekDouble > &pRecvData)
void AlltoAll (Array< OneD, int > &pSendData, Array< OneD, int > &pRecvData)
void AlltoAllv (Array< OneD, NekDouble > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, NekDouble > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
void AlltoAllv (Array< OneD, int > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, int > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
void SplitComm (int pRows, int pColumns)
 Splits this communicator into a grid of size pRows*pColumns and creates row and column communicators. By default the communicator is a single row.
CommSharedPtr GetRowComm ()
 Retrieve the row communicator to which this process belongs.
CommSharedPtr GetColumnComm ()
 Retrieve the column communicator to which this process belongs.
bool TreatAsRankZero (void)
bool RemoveExistingFiles (void)

Static Public Member Functions

static CommSharedPtr create (int narg, char *arg[])
 Creates an instance of this class.

Static Public Attributes

static std::string className
 Name of class.

Protected Member Functions

virtual void v_Finalise ()
virtual int v_GetRank ()
virtual void v_Block ()
virtual bool v_TreatAsRankZero (void)
virtual void v_Send (int pProc, Array< OneD, NekDouble > &pData)
virtual void v_Send (int pProc, Array< OneD, int > &pData)
virtual void v_Send (int pProc, std::vector< unsigned int > &pData)
virtual void v_Recv (int pProc, Array< OneD, NekDouble > &pData)
virtual void v_Recv (int pProc, Array< OneD, int > &pData)
virtual void v_Recv (int pProc, std::vector< unsigned int > &pData)
virtual void v_SendRecv (int pSendProc, Array< OneD, NekDouble > &pSendData, int pRecvProc, Array< OneD, NekDouble > &pRecvData)
virtual void v_SendRecv (int pSendProc, Array< OneD, int > &pSendData, int pRecvProc, Array< OneD, int > &pRecvData)
virtual void v_SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, NekDouble > &pSendData)
virtual void v_SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, int > &pSendData)
virtual void v_AllReduce (NekDouble &pData, enum ReduceOperator pOp)
virtual void v_AllReduce (int &pData, enum ReduceOperator pOp)
virtual void v_AllReduce (Array< OneD, NekDouble > &pData, enum ReduceOperator pOp)
virtual void v_AllReduce (Array< OneD, int > &pData, enum ReduceOperator pOp)
virtual void v_AllReduce (std::vector< unsigned int > &pData, enum ReduceOperator pOp)
virtual void v_AlltoAll (Array< OneD, NekDouble > &pSendData, Array< OneD, NekDouble > &pRecvData)
virtual void v_AlltoAll (Array< OneD, int > &pSendData, Array< OneD, int > &pRecvData)
virtual void v_AlltoAllv (Array< OneD, NekDouble > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, NekDouble > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
virtual void v_AlltoAllv (Array< OneD, int > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, int > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
virtual void v_SplitComm (int pRows, int pColumns)
- Protected Member Functions inherited from Nektar::LibUtilities::Comm
 Comm ()
virtual bool v_RemoveExistingFiles (void)

Private Member Functions

 CommMpi (MPI_Comm pComm)

Private Attributes

MPI_Comm m_comm
int m_rank

Additional Inherited Members

- Protected Attributes inherited from Nektar::LibUtilities::Comm
int m_size
 Number of processes.
std::string m_type
 Type of communication.
CommSharedPtr m_commRow
 Row communicator.
CommSharedPtr m_commColumn
 Column communicator.

Detailed Description

A global linear system.

Definition at line 61 of file CommMpi.h.

Constructor & Destructor Documentation

Nektar::LibUtilities::CommMpi::CommMpi ( int  narg,
char *  arg[] 
)

Definition at line 52 of file CommMpi.cpp.

References ASSERTL0, m_comm, m_rank, Nektar::LibUtilities::Comm::m_size, and Nektar::LibUtilities::Comm::m_type.

Referenced by v_SplitComm().

: Comm(narg,arg)
{
int init = 0;
MPI_Initialized(&init);
ASSERTL0(!init, "MPI has already been initialised.");
int retval = MPI_Init(&narg, &arg);
if (retval != MPI_SUCCESS)
{
ASSERTL0(false, "Failed to initialise MPI");
}
m_comm = MPI_COMM_WORLD;
MPI_Comm_size( m_comm, &m_size );
MPI_Comm_rank( m_comm, &m_rank );
m_type = "Parallel MPI";
}
Nektar::LibUtilities::CommMpi::~CommMpi ( )
virtual

Definition at line 90 of file CommMpi.cpp.

{
}
Nektar::LibUtilities::CommMpi::CommMpi ( MPI_Comm  pComm)
private

Definition at line 76 of file CommMpi.cpp.

References m_comm, m_rank, Nektar::LibUtilities::Comm::m_size, and Nektar::LibUtilities::Comm::m_type.

: Comm()
{
m_comm = pComm;
MPI_Comm_size( m_comm, &m_size );
MPI_Comm_rank( m_comm, &m_rank );
m_type = "Parallel MPI";
}

Member Function Documentation

static CommSharedPtr Nektar::LibUtilities::CommMpi::create ( int  narg,
char *  arg[] 
)
inlinestatic

Creates an instance of this class.

Definition at line 65 of file CommMpi.h.

{
return MemoryManager<CommMpi>::AllocateSharedPtr(narg,arg);
}
MPI_Comm Nektar::LibUtilities::CommMpi::GetComm ( )

Definition at line 99 of file CommMpi.cpp.

References m_comm.

{
return m_comm;
}
void Nektar::LibUtilities::CommMpi::v_AllReduce ( NekDouble pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 385 of file CommMpi.cpp.

References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), m_comm, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, and Nektar::LibUtilities::ReduceSum.

{
if (GetSize() == 1)
{
return;
}
MPI_Op vOp;
switch (pOp)
{
case ReduceMax: vOp = MPI_MAX; break;
case ReduceMin: vOp = MPI_MIN; break;
case ReduceSum:
default: vOp = MPI_SUM; break;
}
int retval = MPI_Allreduce( MPI_IN_PLACE,
&pData,
1,
MPI_DOUBLE,
vOp,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-reduce.");
}
void Nektar::LibUtilities::CommMpi::v_AllReduce ( int &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 415 of file CommMpi.cpp.

References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), m_comm, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, and Nektar::LibUtilities::ReduceSum.

{
if (GetSize() == 1)
{
return;
}
MPI_Op vOp;
switch (pOp)
{
case ReduceMax: vOp = MPI_MAX; break;
case ReduceMin: vOp = MPI_MIN; break;
case ReduceSum:
default: vOp = MPI_SUM; break;
}
int retval = MPI_Allreduce( MPI_IN_PLACE,
&pData,
1,
MPI_INT,
vOp,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-reduce.");
}
void Nektar::LibUtilities::CommMpi::v_AllReduce ( Array< OneD, NekDouble > &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 445 of file CommMpi.cpp.

References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), m_comm, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, and Nektar::LibUtilities::ReduceSum.

{
if (GetSize() == 1)
{
return;
}
MPI_Op vOp;
switch (pOp)
{
case ReduceMax: vOp = MPI_MAX; break;
case ReduceMin: vOp = MPI_MIN; break;
case ReduceSum:
default: vOp = MPI_SUM; break;
}
int retval = MPI_Allreduce( MPI_IN_PLACE,
pData.get(),
(int) pData.num_elements(),
MPI_DOUBLE,
vOp,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-reduce.");
}
void Nektar::LibUtilities::CommMpi::v_AllReduce ( Array< OneD, int > &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 475 of file CommMpi.cpp.

References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), m_comm, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, and Nektar::LibUtilities::ReduceSum.

{
if (GetSize() == 1)
{
return;
}
MPI_Op vOp;
switch (pOp)
{
case ReduceMax: vOp = MPI_MAX; break;
case ReduceMin: vOp = MPI_MIN; break;
case ReduceSum:
default: vOp = MPI_SUM; break;
}
int retval = MPI_Allreduce( MPI_IN_PLACE,
pData.get(),
(int) pData.num_elements(),
MPI_INT,
vOp,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-reduce.");
}
void Nektar::LibUtilities::CommMpi::v_AllReduce ( std::vector< unsigned int > &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 505 of file CommMpi.cpp.

References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), m_comm, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, and Nektar::LibUtilities::ReduceSum.

{
if (GetSize() == 1)
{
return;
}
MPI_Op vOp;
switch (pOp)
{
case ReduceMax: vOp = MPI_MAX; break;
case ReduceMin: vOp = MPI_MIN; break;
case ReduceSum:
default: vOp = MPI_SUM; break;
}
int retval = MPI_Allreduce( MPI_IN_PLACE,
&pData[0],
(int) pData.size(),
MPI_INT,
vOp,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-reduce.");
}
void Nektar::LibUtilities::CommMpi::v_AlltoAll ( Array< OneD, NekDouble > &  pSendData,
Array< OneD, NekDouble > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 535 of file CommMpi.cpp.

References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), and m_comm.

{
int retval = MPI_Alltoall(pSendData.get(),
(int) pSendData.num_elements()/GetSize(),
MPI_DOUBLE,
pRecvData.get(),
(int) pRecvData.num_elements()/GetSize(),
MPI_DOUBLE,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-to-All.");
}
void Nektar::LibUtilities::CommMpi::v_AlltoAll ( Array< OneD, int > &  pSendData,
Array< OneD, int > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 553 of file CommMpi.cpp.

References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), and m_comm.

{
int retval = MPI_Alltoall(pSendData.get(),
(int) pSendData.num_elements()/GetSize(),
MPI_INT,
pRecvData.get(),
(int) pRecvData.num_elements()/GetSize(),
MPI_INT,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-to-All.");
}
void Nektar::LibUtilities::CommMpi::v_AlltoAllv ( Array< OneD, NekDouble > &  pSendData,
Array< OneD, int > &  pSendDataSizeMap,
Array< OneD, int > &  pSendDataOffsetMap,
Array< OneD, NekDouble > &  pRecvData,
Array< OneD, int > &  pRecvDataSizeMap,
Array< OneD, int > &  pRecvDataOffsetMap 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 571 of file CommMpi.cpp.

References ASSERTL0, and m_comm.

{
int retval = MPI_Alltoallv(pSendData.get(),
pSendDataSizeMap.get(),
pSendDataOffsetMap.get(),
MPI_DOUBLE,
pRecvData.get(),
pRecvDataSizeMap.get(),
pRecvDataOffsetMap.get(),
MPI_DOUBLE,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-to-All-v.");
}
void Nektar::LibUtilities::CommMpi::v_AlltoAllv ( Array< OneD, int > &  pSendData,
Array< OneD, int > &  pSendDataSizeMap,
Array< OneD, int > &  pSendDataOffsetMap,
Array< OneD, int > &  pRecvData,
Array< OneD, int > &  pRecvDataSizeMap,
Array< OneD, int > &  pRecvDataOffsetMap 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 595 of file CommMpi.cpp.

References ASSERTL0, and m_comm.

{
int retval = MPI_Alltoallv(pSendData.get(),
pSendDataSizeMap.get(),
pSendDataOffsetMap.get(),
MPI_INT,
pRecvData.get(),
pRecvDataSizeMap.get(),
pRecvDataOffsetMap.get(),
MPI_INT,
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing All-to-All-v.");
}
void Nektar::LibUtilities::CommMpi::v_Block ( )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 141 of file CommMpi.cpp.

References m_comm.

{
MPI_Barrier(m_comm);
}
void Nektar::LibUtilities::CommMpi::v_Finalise ( )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 108 of file CommMpi.cpp.

{
MPI_Finalize();
}
int Nektar::LibUtilities::CommMpi::v_GetRank ( void  )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 117 of file CommMpi.cpp.

References m_rank.

{
return m_rank;
}
void Nektar::LibUtilities::CommMpi::v_Recv ( int  pProc,
Array< OneD, NekDouble > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 176 of file CommMpi.cpp.

References m_comm.

{
MPI_Status status;
MPI_Recv( pData.get(),
(int) pData.num_elements(),
MPI_DOUBLE,
pProc,
0,
&status);
//ASSERTL0(status.MPI_ERROR == MPI_SUCCESS,
// "MPI error receiving data.");
}
void Nektar::LibUtilities::CommMpi::v_Recv ( int  pProc,
Array< OneD, int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 221 of file CommMpi.cpp.

References m_comm.

{
MPI_Status status;
MPI_Recv( pData.get(),
(int) pData.num_elements(),
MPI_INT,
pProc,
0,
&status);
//ASSERTL0(status.MPI_ERROR == MPI_SUCCESS,
// "MPI error receiving data.");
}
void Nektar::LibUtilities::CommMpi::v_Recv ( int  pProc,
std::vector< unsigned int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 266 of file CommMpi.cpp.

References m_comm.

{
MPI_Status status;
MPI_Recv( &pData[0],
(int) pData.size(),
MPI_UNSIGNED,
pProc,
0,
&status);
//ASSERTL0(status.MPI_ERROR == MPI_SUCCESS,
// "MPI error receiving data.");
}
void Nektar::LibUtilities::CommMpi::v_Send ( int  pProc,
Array< OneD, NekDouble > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 150 of file CommMpi.cpp.

References m_comm, and MPISYNC.

{
if (MPISYNC)
{
MPI_Ssend( pData.get(),
(int) pData.num_elements(),
MPI_DOUBLE,
pProc,
0,
}
else
{
MPI_Send( pData.get(),
(int) pData.num_elements(),
MPI_DOUBLE,
pProc,
0,
}
}
void Nektar::LibUtilities::CommMpi::v_Send ( int  pProc,
Array< OneD, int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 195 of file CommMpi.cpp.

References m_comm, and MPISYNC.

{
if (MPISYNC)
{
MPI_Ssend( pData.get(),
(int) pData.num_elements(),
MPI_INT,
pProc,
0,
}
else
{
MPI_Send( pData.get(),
(int) pData.num_elements(),
MPI_INT,
pProc,
0,
}
}
void Nektar::LibUtilities::CommMpi::v_Send ( int  pProc,
std::vector< unsigned int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 240 of file CommMpi.cpp.

References m_comm, and MPISYNC.

{
if (MPISYNC)
{
MPI_Ssend( &pData[0],
(int) pData.size(),
MPI_UNSIGNED,
pProc,
0,
}
else
{
MPI_Send( &pData[0],
(int) pData.size(),
MPI_UNSIGNED,
pProc,
0,
}
}
void Nektar::LibUtilities::CommMpi::v_SendRecv ( int  pSendProc,
Array< OneD, NekDouble > &  pSendData,
int  pRecvProc,
Array< OneD, NekDouble > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 285 of file CommMpi.cpp.

References ASSERTL0, and m_comm.

{
MPI_Status status;
int retval = MPI_Sendrecv(pSendData.get(),
(int) pSendData.num_elements(),
MPI_DOUBLE,
pRecvProc,
0,
pRecvData.get(),
(int) pRecvData.num_elements(),
MPI_DOUBLE,
pSendProc,
0,
&status);
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing send-receive of data.");
}
void Nektar::LibUtilities::CommMpi::v_SendRecv ( int  pSendProc,
Array< OneD, int > &  pSendData,
int  pRecvProc,
Array< OneD, int > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 312 of file CommMpi.cpp.

References ASSERTL0, and m_comm.

{
MPI_Status status;
int retval = MPI_Sendrecv(pSendData.get(),
(int) pSendData.num_elements(),
MPI_INT,
pRecvProc,
0,
pRecvData.get(),
(int) pRecvData.num_elements(),
MPI_INT,
pSendProc,
0,
&status);
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing send-receive of data.");
}
void Nektar::LibUtilities::CommMpi::v_SendRecvReplace ( int  pSendProc,
int  pRecvProc,
Array< OneD, NekDouble > &  pSendData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 338 of file CommMpi.cpp.

References ASSERTL0, and m_comm.

{
MPI_Status status;
int retval = MPI_Sendrecv_replace(pSendData.get(),
(int) pSendData.num_elements(),
MPI_DOUBLE,
pRecvProc,
0,
pSendProc,
0,
&status);
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing Send-Receive-Replace of data.");
}
void Nektar::LibUtilities::CommMpi::v_SendRecvReplace ( int  pSendProc,
int  pRecvProc,
Array< OneD, int > &  pSendData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 361 of file CommMpi.cpp.

References ASSERTL0, and m_comm.

{
MPI_Status status;
int retval = MPI_Sendrecv_replace(pSendData.get(),
(int) pSendData.num_elements(),
MPI_INT,
pRecvProc,
0,
pSendProc,
0,
&status);
ASSERTL0(retval == MPI_SUCCESS,
"MPI error performing Send-Receive-Replace of data.");
}
void Nektar::LibUtilities::CommMpi::v_SplitComm ( int  pRows,
int  pColumns 
)
protectedvirtual

Processes are considered as a grid of size pRows*pColumns. Comm objects are created corresponding to the rows and columns of this grid. The row and column to which this process belongs is stored in m_commRow and m_commColumn.

Implements Nektar::LibUtilities::Comm.

Definition at line 623 of file CommMpi.cpp.

References ASSERTL0, CommMpi(), m_comm, Nektar::LibUtilities::Comm::m_commColumn, Nektar::LibUtilities::Comm::m_commRow, m_rank, and Nektar::LibUtilities::Comm::m_size.

{
ASSERTL0(pRows*pColumns == m_size,
"Rows/Columns do not match comm size.");
MPI_Comm newComm;
// Compute row and column in grid.
int myCol = m_rank % pColumns;
int myRow = (m_rank - myCol) / pColumns;
// Split Comm into rows - all processes with same myRow are put in
// the same communicator. The rank within this communicator is the
// column index.
MPI_Comm_split(m_comm, myRow, myCol, &newComm);
m_commRow = boost::shared_ptr<Comm>(new CommMpi(newComm));
// Split Comm into columns - all processes with same myCol are put
// in the same communicator. The rank within this communicator is
// the row index.
MPI_Comm_split(m_comm, myCol, myRow, &newComm);
m_commColumn = boost::shared_ptr<Comm>(new CommMpi(newComm));
}
bool Nektar::LibUtilities::CommMpi::v_TreatAsRankZero ( void  )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 125 of file CommMpi.cpp.

References m_rank.

{
if(m_rank == 0)
{
return true;
}
else
{
return false;
}
return true;
}

Member Data Documentation

std::string Nektar::LibUtilities::CommMpi::className
static
Initial value:
"ParallelMPI",
"Parallel communication using MPI.")

Name of class.

Definition at line 71 of file CommMpi.h.

MPI_Comm Nektar::LibUtilities::CommMpi::m_comm
private
int Nektar::LibUtilities::CommMpi::m_rank
private

Definition at line 133 of file CommMpi.h.

Referenced by CommMpi(), v_GetRank(), v_SplitComm(), and v_TreatAsRankZero().