Commit 2ae29183 authored by Dave Moxey's avatar Dave Moxey
Browse files

Fix some whitespace, fix serial comm issue with boundary conditions

parent 58f6a28e
......@@ -63,7 +63,7 @@ namespace Nektar
LIB_UTILITIES_EXPORT CommFactory& GetCommFactory();
/// Type of operation to perform in AllReduce.
/// Type of operation to perform in AllReduce.
enum ReduceOperator
{
ReduceSum,
......@@ -87,9 +87,9 @@ namespace Nektar
/// Block execution until all processes reach this point
LIB_UTILITIES_EXPORT inline void Block();
/// Return the time in seconds
LIB_UTILITIES_EXPORT inline double Wtime();
/// Return the time in seconds
LIB_UTILITIES_EXPORT inline NekDouble Wtime();
template<class T>
void Send(int pProc, T& pData);
......@@ -113,7 +113,7 @@ namespace Nektar
Array<OneD, T>& pRecvData,
Array<OneD, int>& pRecvDataSizeMap,
Array<OneD, int>& pRecvDataOffsetMap);
template<class T>
void Bcast(T& data, int rootProc);
......@@ -146,7 +146,7 @@ namespace Nektar
virtual void v_Finalise() = 0;
virtual int v_GetRank() = 0;
virtual void v_Block() = 0;
virtual double v_Wtime() = 0;
virtual NekDouble v_Wtime() = 0;
virtual void v_Send(void* buf, int count, CommDataType dt, int dest) = 0;
virtual void v_Recv(void* buf, int count, CommDataType dt, int source) = 0;
virtual void v_SendRecv(void *sendbuf, int sendcount, CommDataType sendtype, int dest,
......@@ -214,7 +214,7 @@ namespace Nektar
v_Block();
}
/**
/**
*
*/
inline double Comm::Wtime()
......@@ -258,8 +258,8 @@ namespace Nektar
CommDataTypeTraits<T>::GetDataType(),
pRecvProc);
}
/**
/**
*
*/
template <class T>
......@@ -272,7 +272,7 @@ namespace Nektar
CommDataTypeTraits<T>::GetDataType(),
pSendProc, pRecvProc);
}
/**
*
*/
......@@ -306,8 +306,8 @@ namespace Nektar
count,
CommDataTypeTraits<T>::GetDataType());
}
/**
/**
*
*/
template<class T>
......@@ -327,17 +327,18 @@ namespace Nektar
pRecvDataOffsetMap.get(),
CommDataTypeTraits<T>::GetDataType());
}
/**
*
*/
template<class T>
void Comm::Bcast(T& pData, int pRoot)
{
v_Bcast(CommDataTypeTraits<T>::GetPointer(pData),
CommDataTypeTraits<T>::GetCount(pData),
CommDataTypeTraits<T>::GetDataType(),
pRoot);
}
template<class T>
void Comm::Bcast(T& pData, int pRoot)
{
v_Bcast(CommDataTypeTraits<T>::GetPointer(pData),
CommDataTypeTraits<T>::GetCount(pData),
CommDataTypeTraits<T>::GetDataType(),
pRoot);
}
template<class T>
void Comm::Exscan(T& pData, const enum ReduceOperator pOp, T& ans)
......@@ -392,13 +393,13 @@ namespace Nektar
return ans;
}
/**
* @brief If the flag is non-zero create a new communicator.
*/
inline CommSharedPtr Comm::CommCreateIf(int flag)
{
return v_CommCreateIf(flag);
}
/**
* @brief If the flag is non-zero create a new communicator.
*/
inline CommSharedPtr Comm::CommCreateIf(int flag)
{
return v_CommCreateIf(flag);
}
/**
* @brief Splits this communicator into a grid of size pRows*pColumns
......
......@@ -102,9 +102,9 @@ namespace Nektar
/**
*
*/
double CommSerial::v_Wtime()
NekDouble CommSerial::v_Wtime()
{
return 0;
return 0;
}
/**
......@@ -130,15 +130,14 @@ namespace Nektar
{
}
/**
/**
*
*/
void CommSerial::v_SendRecvReplace(void* buf, int count, CommDataType dt,
int pSendProc, int pRecvProc)
{
}
{
}
/**
*
*/
......@@ -155,8 +154,8 @@ namespace Nektar
{
}
/**
/**
*
*/
void CommSerial::v_AlltoAllv(void *sendbuf, int sendcounts[], int sensdispls[], CommDataType sendtype,
......@@ -165,10 +164,10 @@ namespace Nektar
}
void CommSerial::v_Bcast(void* buffer, int count, CommDataType dt, int root)
{
void CommSerial::v_Bcast(void* buffer, int count, CommDataType dt, int root)
{
}
}
void CommSerial::v_Exscan(Array<OneD, unsigned long long>& pData, const enum ReduceOperator pOp, Array<OneD, unsigned long long>& ans)
{
......@@ -193,14 +192,14 @@ namespace Nektar
{
ASSERTL0(false, "Cannot split a serial process.");
}
/**
*
*/
CommSharedPtr CommSerial::v_CommCreateIf(int flag)
{
ASSERTL0(false, "Cannot split a serial process.");
return CommSharedPtr();
ASSERTL0(flag, "Serial process must always be split");
return shared_from_this();
}
}
}
......@@ -37,6 +37,8 @@
#include <string>
#include <boost/enable_shared_from_this.hpp>
#include <LibUtilities/Communication/Comm.h>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <LibUtilities/LibUtilitiesDeclspec.h>
......@@ -73,7 +75,7 @@ namespace Nektar
LIB_UTILITIES_EXPORT virtual bool v_TreatAsRankZero(void);
LIB_UTILITIES_EXPORT virtual void v_Block();
LIB_UTILITIES_EXPORT virtual double v_Wtime();
LIB_UTILITIES_EXPORT virtual NekDouble v_Wtime();
LIB_UTILITIES_EXPORT virtual void v_Send(void* buf, int count, CommDataType dt, int dest);
LIB_UTILITIES_EXPORT virtual void v_Recv(void* buf, int count, CommDataType dt, int source);
LIB_UTILITIES_EXPORT virtual void v_SendRecv(void *sendbuf, int sendcount, CommDataType sendtype, int dest,
......
......@@ -188,12 +188,14 @@ namespace Nektar
this_rank_participates);
ASSERTL0(bool(comm_region) == bool(this_rank_participates),
"Rank should be in communicator but wasn't or is in communicator but shouldn't be.");
"Rank should be in communicator but wasn't or is in "
"communicator but shouldn't be.");
if (this_rank_participates)
{
m_boundaryCommunicators[reg_it->first] = comm_region;
}
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment