ug4

the Process Communication Layer More...

Classes

class  pcl::BasicInterface< TType, TContainer, TAlloc >
 You may add elements to this interface and iterate over them. More...
 
class  pcl::DataTypeDirectlySupported
 
class  pcl::DataTypeIndirectlySupported
 
class  pcl::DataTypeTraits< T >
 
class  pcl::DataTypeTraits< char >
 
class  pcl::DataTypeTraits< double >
 
class  pcl::DataTypeTraits< float >
 
class  pcl::DataTypeTraits< int >
 
class  pcl::DataTypeTraits< long >
 
class  pcl::DataTypeTraits< unsigned char >
 
class  pcl::DataTypeTraits< unsigned long >
 
class  pcl::DataTypeTraits< unsigned long long >
 
class  pcl::ICommunicationPolicy< TLayout >
 specializations are responsible to pack and unpack interface data during communication. More...
 
class  pcl::IDomainDecompositionInfo
 
class  pcl::InterfaceCommunicator< TLayout >
 Performs communication between interfaces on different processes. More...
 
class  pcl::MultiLevelLayout< TInterface >
 the standard multi-level-layout implementation More...
 
class  pcl::OrderedInterface< TType, TContainer, TAlloc >
 You may add elements to this interface and iterate over them. More...
 
class  pcl::ProcessCommunicator
 
class  pcl::SelectionCommPol< TLayout, TSelectorIn, TSelectorOut >
 communicates selection-status of interface elements More...
 
class  pcl::SingleLevelLayout< TInterface >
 the standard single-level-layout implementation More...
 
class  pcl::StandardDomainDecompositionInfo
 
struct  pcl::type_traits< TType >
 associate internally used types with an external typename More...
 

Macros

#define DEBUG_TESTLAYOUT(processCommunicator, com, master, slave)   TESTLAYOUT(processCommunicator, com, master, slave)
 
#define DEBUG_TESTLAYOUTS(layout)   DEBUG_TESTLAYOUT(layout->proc_comm(), layout->comm(), layout->master(), layout->slave())
 
#define PCL_DT_BYTE   MPI_BYTE
 
#define PCL_DT_CHAR   MPI_CHAR
 
#define PCL_DT_DOUBLE   MPI_DOUBLE
 
#define PCL_DT_FLOAT   MPI_FLOAT
 
#define PCL_DT_INT   MPI_INT
 
#define PCL_DT_LONG   MPI_LONG
 
#define PCL_DT_LONG_DOUBLE   MPI_LONG_DOUBLE
 
#define PCL_DT_LONG_LONG_INT   MPI_LONG_LONG_INT
 
#define PCL_DT_NULL   MPI_DATATYPE_NULL
 
#define PCL_DT_PACKED   MPI_PACKED
 
#define PCL_DT_SHORT   MPI_SHORT
 
#define PCL_DT_UNSIGNED_CHAR   MPI_UNSIGNED_CHAR
 
#define PCL_DT_UNSIGNED_LONG   MPI_UNSIGNED_LONG
 
#define PCL_DT_UNSIGNED_LONG_LONG   MPI_UNSIGNED_LONG_LONG
 
#define PCL_RO_BAND   MPI_BAND
 
#define PCL_RO_BOR   MPI_BOR
 
#define PCL_RO_BXOR   MPI_BXOR
 
#define PCL_RO_LAND   MPI_LAND
 
#define PCL_RO_LOR   MPI_LOR
 
#define PCL_RO_LXOR   MPI_LXOR
 
#define PCL_RO_MAX   MPI_MAX
 
#define PCL_RO_MAXLOC   MPI_MAXLOC
 
#define PCL_RO_MIN   MPI_MIN
 
#define PCL_RO_MINLOC   MPI_MINLOC
 
#define PCL_RO_PROD   MPI_PROD
 
#define PCL_RO_SUM   MPI_SUM
 
#define PRINTPC(com)   UG_LOG(__FUNCTION__ << " : " << __LINE__ << "\n"); PrintPC(com)
 
#define TESTLAYOUT(processCommunicator, com, master, slave)
 
#define TESTLAYOUTS(layout)   TESTLAYOUT(layout->proc_comm(), layout->comm(), layout->master(), layout->slave())
 

Typedefs

typedef MPI_Datatype pcl::DataType
 
typedef int pcl::ProcID
 
typedef MPI_Op pcl::ReduceOperation
 

Enumerations

enum  pcl::ProcessCommunicatorDefaults { pcl::PCD_EMPTY = 0 , pcl::PCD_WORLD = 1 , pcl::PCD_LOCAL = 2 }
 values that can be passed to a ProcessCommunicators constructor. More...
 

Functions

void pcl::Abort (int errorcode=1)
 call this method to abort all mpi processes More...
 
template<typename TLayout >
void pcl::AddLayout (TLayout &destLayout, const TLayout &sourceLayout)
 
bool pcl::AllProcsTrue (bool bFlag, ProcessCommunicator comm)
 
void pcl::AllReduce (void *sendBuf, void *recBuf, int count, DataType type, ReduceOperation op)
 reduces the data to a single buffer using the specified ReduceOperation and distributes the result to all processes. More...
 
template<class TLayout >
size_t pcl::CollectAssociatedProcesses (std::vector< int > &procIDsOut, TLayout &layout)
 collects the ids of all processes to which interfaces exist. More...
 
void pcl::CollectData (ProcID thisProcID, int firstSendProc, int numSendProcs, void *pBuffer, int bufferSizePerProc, int tag)
 collect the data send with send_data from proc firstSendProc to numSendProcs excluding destProc. More...
 
template<class TLayout >
void pcl::CollectElements (std::vector< typename TLayout::Element > &elemsOut, TLayout &layout, bool clearContainer=true)
 writes all elements in the interfaces into the vector. More...
 
template<class TLayout >
void pcl::CollectUniqueElements (std::vector< typename TLayout::Element > &elemsOut, const TLayout &layout)
 writes all elements in the interfaces into the resulting vector. avoids doubles. More...
 
void pcl::CommunicateInvolvedProcesses (std::vector< int > &vReceiveFromRanksOut, const std::vector< int > &vSendToRanks, const ProcessCommunicator &procComm=ProcessCommunicator())
 exchanges information about which process wants to communicate with which other process. More...
 
void pcl::DisableMPIInit ()
 call this method before 'Init' to avoid a call to MPI_Init. More...
 
void pcl::DistributeData (ProcID thisProcID, int *pRecProcMap, int numRecProcs, void *pBuffer, int *pBufferSegSizes, int tag)
 sends the data in the different sections of the buffer to the specified processes. More...
 
void pcl::DistributeData (ProcID thisProcID, int firstRecProc, int numRecProcs, void *pBuffer, int *pBufferSegSizes, int tag)
 sends the data in the different sections of the buffer to the specified processes. More...
 
void pcl::Finalize ()
 call this method right before quitting your application More...
 
size_t pcl::GetSize (const DataType &t)
 
void pcl::Init (int *argcp, char ***argvp)
 call this method before any other pcl-operations. More...
 
template<class TType , class TLayoutMap >
void pcl::LogLayoutMapStructure (TLayoutMap &lm)
 Logs the internals of a layout-map for a given type. More...
 
template<class TLayout >
void pcl::LogLayoutStructure (TLayout &layout, const char *prefix="")
 Logs the internals of a layout. More...
 
template<typename TKey , typename TValue , typename Compare >
void pcl::MinimalKeyValuePairAcrossAllProcs (TKey &keyInOut, TValue &valInOut, const Compare &cmp=Compare())
 Find minimal key/value pair across processes This function will receive one key/value pair from each process. They will be gathered on proc 0, where the minimal key (w.r.t. given Compare object, e.g., std::less<TKey> ) and corresponding value will be determined. The minimal pair will be made known to all procs and returned. More...
 
int pcl::MPI_Wait (MPI_Request *request, MPI_Status *status=MPI_STATUS_IGNORE)
 
void pcl::MPI_Waitall (int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses)
 
int pcl::NumProcs ()
 returns the number of processes More...
 
bool pcl::OneProcTrue (bool bFlag, ProcessCommunicator comm)
 
std::ostream & pcl::operator<< (std::ostream &out, const ProcessCommunicator &processCommunicator)
 
bool pcl::ParallelReadFile (std::string &filename, std::vector< char > &file, bool bText, bool bDistributedLoad, const ProcessCommunicator &pc=ProcessCommunicator())
 util function to read a file in parallel. More...
 
template<typename TLayout >
bool pcl::PrintLayout (const pcl::ProcessCommunicator &processCommunicator, pcl::InterfaceCommunicator< TLayout > &com, const TLayout &masterLayout, const TLayout &slaveLayout)
 
template<typename TLayout , typename TValue >
bool pcl::PrintLayout (const pcl::ProcessCommunicator &processCommunicator, pcl::InterfaceCommunicator< TLayout > &com, const TLayout &masterLayout, const TLayout &slaveLayout, boost::function< TValue(typename TLayout::Element)> cbToValue=TrivialToValue< typename TLayout::Element >)
 
template<typename TLayout >
void pcl::PrintLayout (const TLayout &layout)
 
void pcl::PrintPC (const pcl::ProcessCommunicator &processCommunicator)
 
int pcl::ProcRank ()
 returns the rank of the process More...
 
void pcl::ReceiveData (void *pBuffOut, ProcID srcProc, int bufferSize, int tag)
 receives the data that was send with More...
 
template<class TLayout >
void pcl::RemoveEmptyInterfaces (TLayout &layout)
 removes all empty interfaces from the given layout. More...
 
template<class TLayout , class TSelector >
bool pcl::RemoveUnselectedInterfaceEntries (TLayout &layout, TSelector &sel)
 
template<class TType , class TLayoutMap , class TSelector >
bool pcl::RemoveUnselectedInterfaceEntries (TLayoutMap &lm, TSelector &sel)
 
void pcl::SendData (ProcID destProc, void *pBuffer, int bufferSize, int tag)
 sends data to another process. data may be received using More...
 
bool pcl::SendRecvBuffersMatch (const std::vector< int > &recvFrom, const std::vector< int > &recvBufSizes, const std::vector< int > &sendTo, const std::vector< int > &sendBufSizes, const ProcessCommunicator &involvedProcs=ProcessCommunicator())
 checks whether matching buffers in send- and recv-lists have the same size More...
 
bool pcl::SendRecvListsMatch (const std::vector< int > &recvFrom, const std::vector< int > &sendTo, const ProcessCommunicator &involvedProcs=ProcessCommunicator())
 checks whether proc-entries in send- and recv-lists on participating processes match More...
 
void pcl::SetErrHandler ()
 sets error handler More...
 
void pcl::SynchronizeProcesses ()
 
template<typename TLayout >
bool pcl::TestLayout (const pcl::ProcessCommunicator &processCommunicator, pcl::InterfaceCommunicator< TLayout > &com, const TLayout &masterLayout, const TLayout &slaveLayout, bool bPrint=false, bool compareValues=false)
 
template<typename TLayout , typename TValue >
bool pcl::TestLayout (const pcl::ProcessCommunicator &processCommunicator, pcl::InterfaceCommunicator< TLayout > &com, const TLayout &masterLayout, const TLayout &slaveLayout, bool bPrint=false, boost::function< TValue(typename TLayout::Element)> cbToValue=TrivialToValue< typename TLayout::Element >, bool compareValues=false)
 Checks whether the given layouts are consistent. More...
 
template<typename TLayout >
bool pcl::TestLayoutIsDoubleEnded (const pcl::ProcessCommunicator processCommunicator, pcl::InterfaceCommunicator< TLayout > &com, const TLayout &masterLayout, const TLayout &slaveLayout)
 tests if masterLayouts proc id's find a match in corresponding slaveLayouts proc ids. More...
 
template<typename TLayout , typename TValue >
bool pcl::TestSizeOfInterfacesInLayoutsMatch (pcl::InterfaceCommunicator< TLayout > &com, const TLayout &masterLayout, const TLayout &slaveLayout, bool bPrint=false, boost::function< TValue(typename TLayout::Element)> cbToValue=TrivialToValue< typename TLayout::Element >, bool compareValues=false)
 if processor P1 has a interface to P2, then the size of the interface P1->P2 has to be the same as the size of interface P2->P1 More...
 
double pcl::Time ()
 returns the time in seconds More...
 
std::string pcl::ToString (const ProcessCommunicator &pc)
 
template<class TElem >
TElem pcl::TrivialToValue (TElem e)
 Trivial implementation of a to-value callback. More...
 
void pcl::Waitall (std::vector< MPI_Request > &requests)
 
void pcl::Waitall (std::vector< MPI_Request > &requests, std::vector< MPI_Request > &requests2)
 
void pcl::Waitall (std::vector< MPI_Request > &requests, std::vector< MPI_Status > &statuses)
 

Detailed Description

the Process Communication Layer

Macro Definition Documentation

◆ DEBUG_TESTLAYOUT

#define DEBUG_TESTLAYOUT (   processCommunicator,
  com,
  master,
  slave 
)    TESTLAYOUT(processCommunicator, com, master, slave)

◆ DEBUG_TESTLAYOUTS

#define DEBUG_TESTLAYOUTS (   layout)    DEBUG_TESTLAYOUT(layout->proc_comm(), layout->comm(), layout->master(), layout->slave())

◆ PCL_DT_BYTE

#define PCL_DT_BYTE   MPI_BYTE

◆ PCL_DT_CHAR

#define PCL_DT_CHAR   MPI_CHAR

◆ PCL_DT_DOUBLE

#define PCL_DT_DOUBLE   MPI_DOUBLE

◆ PCL_DT_FLOAT

#define PCL_DT_FLOAT   MPI_FLOAT

◆ PCL_DT_INT

#define PCL_DT_INT   MPI_INT

◆ PCL_DT_LONG

#define PCL_DT_LONG   MPI_LONG

◆ PCL_DT_LONG_DOUBLE

#define PCL_DT_LONG_DOUBLE   MPI_LONG_DOUBLE

◆ PCL_DT_LONG_LONG_INT

#define PCL_DT_LONG_LONG_INT   MPI_LONG_LONG_INT

◆ PCL_DT_NULL

#define PCL_DT_NULL   MPI_DATATYPE_NULL

◆ PCL_DT_PACKED

#define PCL_DT_PACKED   MPI_PACKED

◆ PCL_DT_SHORT

#define PCL_DT_SHORT   MPI_SHORT

◆ PCL_DT_UNSIGNED_CHAR

#define PCL_DT_UNSIGNED_CHAR   MPI_UNSIGNED_CHAR

◆ PCL_DT_UNSIGNED_LONG

#define PCL_DT_UNSIGNED_LONG   MPI_UNSIGNED_LONG

◆ PCL_DT_UNSIGNED_LONG_LONG

#define PCL_DT_UNSIGNED_LONG_LONG   MPI_UNSIGNED_LONG_LONG

◆ PCL_RO_BAND

#define PCL_RO_BAND   MPI_BAND

◆ PCL_RO_BOR

#define PCL_RO_BOR   MPI_BOR

◆ PCL_RO_BXOR

#define PCL_RO_BXOR   MPI_BXOR

◆ PCL_RO_LAND

#define PCL_RO_LAND   MPI_LAND

◆ PCL_RO_LOR

#define PCL_RO_LOR   MPI_LOR

◆ PCL_RO_LXOR

#define PCL_RO_LXOR   MPI_LXOR

◆ PCL_RO_MAX

#define PCL_RO_MAX   MPI_MAX

◆ PCL_RO_MAXLOC

#define PCL_RO_MAXLOC   MPI_MAXLOC

◆ PCL_RO_MIN

#define PCL_RO_MIN   MPI_MIN

◆ PCL_RO_MINLOC

#define PCL_RO_MINLOC   MPI_MINLOC

◆ PCL_RO_PROD

#define PCL_RO_PROD   MPI_PROD

◆ PCL_RO_SUM

#define PCL_RO_SUM   MPI_SUM

◆ PRINTPC

#define PRINTPC (   com)    UG_LOG(__FUNCTION__ << " : " << __LINE__ << "\n"); PrintPC(com)

◆ TESTLAYOUT

#define TESTLAYOUT (   processCommunicator,
  com,
  master,
  slave 
)
Value:
{ if(TestLayout(processCommunicator,\
com, master, slave) == false) { PrintLayout(processCommunicator, com, master, slave); UG_COND_THROW(true, "layout broken"); } }
bool TestLayout(const pcl::ProcessCommunicator &processCommunicator, pcl::InterfaceCommunicator< TLayout > &com, const TLayout &masterLayout, const TLayout &slaveLayout, bool bPrint=false, bool compareValues=false)
Definition: pcl_layout_tests.h:333
void PrintLayout(const TLayout &layout)
Definition: pcl_layout_tests.h:366
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61

◆ TESTLAYOUTS

#define TESTLAYOUTS (   layout)    TESTLAYOUT(layout->proc_comm(), layout->comm(), layout->master(), layout->slave())

Typedef Documentation

◆ DataType

typedef MPI_Datatype pcl::DataType

◆ ProcID

typedef int pcl::ProcID

◆ ReduceOperation

typedef MPI_Op pcl::ReduceOperation

Enumeration Type Documentation

◆ ProcessCommunicatorDefaults

values that can be passed to a ProcessCommunicators constructor.

Enumerator
PCD_EMPTY 
PCD_WORLD 
PCD_LOCAL 

Function Documentation

◆ Abort()

void pcl::Abort ( int  errorcode)

call this method to abort all mpi processes

References PCL_COMM_WORLD, and PCL_PROFILE.

Referenced by MPIErrorHandler(), quit_all_mpi_procs_in_parallel(), ug_assert_failed(), and ug::UGForceExit().

◆ AddLayout()

template<typename TLayout >
void pcl::AddLayout ( TLayout &  destLayout,
const TLayout &  sourceLayout 
)

◆ AllProcsTrue()

◆ AllReduce()

void pcl::AllReduce ( void *  sendBuf,
void *  recBuf,
int  count,
DataType  type,
ReduceOperation  op 
)

reduces the data to a single buffer using the specified ReduceOperation and distributes the result to all processes.

Both, sendBuf and recBuf have to hold count elements of the specified type.

Parameters
sendBufSending buffer
recBufRecieve buffer
count
typeData type
ophas to be one of the

References PCL_COMM_WORLD, and UG_LOG.

◆ CollectAssociatedProcesses()

template<class TLayout >
size_t pcl::CollectAssociatedProcesses ( std::vector< int > &  procIDsOut,
TLayout &  layout 
)

collects the ids of all processes to which interfaces exist.

Fills a vector with the process-ids, to which interfaces exist in the given layout.

TLayout has to be compatible with pcl::Layout or pcl::MultiLevelLayout.

Returns
the number of associated processes.

References ug::find().

◆ CollectData()

void pcl::CollectData ( ProcID  thisProcID,
int  firstSendProc,
int  numSendProcs,
void *  pBuffer,
int  bufferSizePerProc,
int  tag 
)

collect the data send with send_data from proc firstSendProc to numSendProcs excluding destProc.

References PCL_COMM_WORLD, UG_LOG, and Waitall().

◆ CollectElements()

template<class TLayout >
void pcl::CollectElements ( std::vector< typename TLayout::Element > &  elemsOut,
TLayout &  layout,
bool  clearContainer = true 
)

writes all elements in the interfaces into the vector.

This function extracts all elements from a layout and stores them into a std::vector. Doubles may occur and are not removed. The container is clear as default, before extracting.

Referenced by ug::FetiLayouts< TAlgebra >::create_layouts().

◆ CollectUniqueElements()

◆ CommunicateInvolvedProcesses()

void pcl::CommunicateInvolvedProcesses ( std::vector< int > &  vReceiveFromRanksOut,
const std::vector< int > &  vSendToRanks,
const ProcessCommunicator procComm = ProcessCommunicator() 
)

exchanges information about which process wants to communicate with which other process.

If processes want to send data to other processes, but the target processes do not know from where to receive their data, then this method can be used to notify each process from where he has to receive data.

Each process has to call this method, passing an array of process-ids to where it will send data (vSendToRanks).

The processes from which it has to receive data are then collected in vReceiveFromRanksOut.

Note that this method involves global communication (with respect to the used process-communicator) and should thus be rarely used - at least if the used process communicator is big.

References pcl::ProcessCommunicator::allgather(), pcl::ProcessCommunicator::allgatherv(), pcl::ProcessCommunicator::get_proc_id(), ug::GetDataPtr(), PCL_DT_INT, PCL_PROFILE, ProcRank(), and pcl::ProcessCommunicator::size().

Referenced by ug::DistributeGrid(), and SendRecvListsMatch().

◆ DisableMPIInit()

void pcl::DisableMPIInit ( )

call this method before 'Init' to avoid a call to MPI_Init.

This method may be useful if you use this program together with another program which calls MPI_Init.

Note
This will also stop MPI_Finalize from being called.

References PERFORM_MPI_INITIALIZATION.

Referenced by ug::bridge::RegisterBridge_PCL().

◆ DistributeData() [1/2]

void pcl::DistributeData ( ProcID  thisProcID,
int *  pRecProcMap,
int  numRecProcs,
void *  pBuffer,
int *  pBufferSegSizes,
int  tag 
)

sends the data in the different sections of the buffer to the specified processes.

pRecProcMap and pBufferSegSizes have to contain numRecProcs elements. Entries in pRecProcMap specify the target-process of the i-th buffer segment.

References PCL_COMM_WORLD, UG_LOG, and Waitall().

◆ DistributeData() [2/2]

void pcl::DistributeData ( ProcID  thisProcID,
int  firstRecProc,
int  numRecProcs,
void *  pBuffer,
int *  pBufferSegSizes,
int  tag 
)

sends the data in the different sections of the buffer to the specified processes.

pBufferSegSizes has to contain numRecProcs elements. Buffer-Segments are send to the processes firstRecProc, ..., firstRecProc + numRecProcs. If thisProcID lies in this range, then the buffer-segments are sent to firstRecProc, ..., firstRecProc + numRecProcs + 1, excluding thisProcID.

References PCL_COMM_WORLD, UG_LOG, and Waitall().

◆ Finalize()

void pcl::Finalize ( )

call this method right before quitting your application

References PCL_PROFILE, and PERFORM_MPI_INITIALIZATION.

Referenced by ug::UGFinalize().

◆ GetSize()

◆ Init()

void pcl::Init ( int *  argcp,
char ***  argvp 
)

call this method before any other pcl-operations.

References PCL_COMM_WORLD, PCL_PROFILE, PERFORM_MPI_INITIALIZATION, and SetErrHandler().

Referenced by ug::UGInit(), and ugshell_main().

◆ LogLayoutMapStructure()

template<class TType , class TLayoutMap >
void pcl::LogLayoutMapStructure ( TLayoutMap &  lm)

Logs the internals of a layout-map for a given type.

Supported layouts are pcl::SingleLevelLayout and pcl::MultiLevelLayout.

References LogLayoutStructure(), and PCLLOG.

◆ LogLayoutStructure()

template<class TLayout >
void pcl::LogLayoutStructure ( TLayout &  layout,
const char *  prefix = "" 
)

Logs the internals of a layout.

Supported layouts are pcl::SingleLevelLayout and pcl::MultiLevelLayout.

References PCLLOG.

Referenced by LogLayoutMapStructure().

◆ MinimalKeyValuePairAcrossAllProcs()

template<typename TKey , typename TValue , typename Compare >
void pcl::MinimalKeyValuePairAcrossAllProcs ( TKey &  keyInOut,
TValue &  valInOut,
const Compare &  cmp = Compare() 
)

Find minimal key/value pair across processes This function will receive one key/value pair from each process. They will be gathered on proc 0, where the minimal key (w.r.t. given Compare object, e.g., std::less<TKey> ) and corresponding value will be determined. The minimal pair will be made known to all procs and returned.

This is a procedure that is required fairly often, e.g., when position-attached data is to be located by a nearest-neighbor search.

Key and value types must be serializable in a binary buffer.

Parameters
keyInOuteach proc's key (used as input and as output)
valInOuteach proc's value (used as input and as output)
cmpobject to use for key comparison (typically std::less<Key>)

References pcl::ProcessCommunicator::broadcast(), ug::BinaryBuffer::clear(), ug::Deserialize(), pcl::ProcessCommunicator::gather(), NumProcs(), ProcRank(), and ug::Serialize().

◆ MPI_Wait()

int pcl::MPI_Wait ( MPI_Request *  request,
MPI_Status *  status = MPI_STATUS_IGNORE 
)
inline

◆ MPI_Waitall()

void pcl::MPI_Waitall ( int  count,
MPI_Request *  array_of_requests,
MPI_Status *  array_of_statuses 
)
inline

References PROFILE_FUNC_GROUP.

Referenced by Waitall().

◆ NumProcs()

int pcl::NumProcs ( )

returns the number of processes

References PCL_COMM_WORLD.

Referenced by ug::ApplySmoothManifoldPosToTopLevelButterflyScheme(), ug::ApplySmoothManifoldPosToTopLevelLoopScheme(), ug::ApplySmoothSubdivisionSurfacesToTopLevel(), ug::ApplySmoothSubdivisionVolumesToTopLevel(), ug::CalculateNumManifoldEdgesVertexAttachmentInParentLevel(), ug::CalculateSmoothCreaseManifoldPosInParentLevelLoopScheme(), ug::CalculateSmoothManifoldPosInParentLevelButterflyScheme(), ug::CalculateSmoothManifoldPosInParentLevelLoopScheme(), CheckCheckpointData(), ug::CheckGFValuesWithinBounds(), ug::MemInfo::communicate_process_values(), ug::ComputeAvg(), ug::ComputeMinMax(), pcl::ProcessCommunicator::create_sub_communicator(), ug::CreateGlobalFracturedDomainRefiner(), ug::CreateLayoutsFromDistInfos(), ug::bridge::DebugShell(), ug::GridFunctionComponentSpace< TGridFunction >::distance2(), ug::GlobalGridFunctionNumberData< TGridFunction, elemDim >::evaluate_global(), pcl::InterfaceCommunicator< TLayout >::ExtractorInfo::ExtractorInfo(), ug::ConnectionViewer::GetParallelName(), ug::GlobalDomainRefiner(), ug::GlobalSubdivisionDomainRefiner(), ug::HangingNodeDomainRefiner(), ug::AssembledMultiGridCycle< TDomain, TAlgebra >::ignore_init_for_base_solver(), ug::bridge::InitUG(), ug::Integral(), ug::IntegralNormalComponentOnManifoldSubsets(), ug::IntegrateDiscFlux(), ug::IntegrateNormalComponentOnManifold(), ug::IntegrateNormalGradientOnManifold(), ug::IntegrateSubsets(), pcl::InterfaceCommunicator< pcl::MultiLevelLayout >::InterfaceCommunicator(), ug::script::LoadUGScript(), ug::LogIndexLayoutOnAllProcs(), ug::ExpectedErrorMarkingStrategy< TDomain >::mark(), ug::MeanValueMarking< TDomain >::mark(), ug::AbsoluteMarking< TDomain >::mark(), ug::VarianceMarking< TDomain >::mark(), ug::VarianceMarkingEta< TDomain >::mark(), ug::MaximumMarking< TDomain >::mark(), ug::APosterioriCoarsening< TDomain >::mark(), ug::SurfaceView::mark_shadowing(), ug::MarkElements(), ug::MarkElementsAbsolute(), ug::MarkElementsForCoarsening(), ug::MarkElementsForRefinement(), ug::MarkOutOfRangeElems(), MinimalKeyValuePairAcrossAllProcs(), ug::GridFunctionComponentSpace< TGridFunction >::norm2(), ug::GaussSeidelBase< TAlgebra >::preprocess(), ug::Vanka< TAlgebra >::preprocess(), ug::DiagVanka< TAlgebra >::preprocess(), ug::ComponentGaussSeidel< TDomain, TAlgebra >::preprocess(), ug::ElementGaussSeidel< TDomain, TAlgebra >::preprocess(), ug::SequentialSubspaceCorrection< TDomain, TAlgebra >::preprocess(), ug::UzawaBase< TDomain, TAlgebra >::preprocess(), ug::LineGaussSeidel< TDomain, TAlgebra >::preprocess(), ug::LineVanka< TDomain, TAlgebra >::preprocess(), ug::IApproximationSpace::print_layout_statistic(), ug::IApproximationSpace::print_statistic(), ug::LocalSchurComplement< TAlgebra >::print_statistic_of_inner_solver(), ug::PrimalSubassembledMatrixInverse< TAlgebra >::print_statistic_of_inner_solver(), ug::VTKOutput< TDim >::print_subset(), ug::VTKOutput< TDim >::print_subsets(), ug::ProjectHierarchyToSubdivisionLimit(), ug::CopyAttachmentHandler< TElem, TAttachment >::propagate_to_level(), quit_all_mpi_procs_in_parallel(), ReadCombinedParallelFile(), ug::ReceiveMatrix(), ug::bridge::RegisterBridge_PCL(), pcl::InterfaceCommunicator< TLayout >::send_raw(), ug::SerializeRow(), pcl::StandardDomainDecompositionInfo::set_num_subdomains(), ug::LogAssistant::set_output_process(), pcl::StandardDomainDecompositionInfo::StandardDomainDecompositionInfo(), ug::GaussSeidelBase< TAlgebra >::step(), ug::Vanka< TAlgebra >::step(), ug::DiagVanka< TAlgebra >::step(), ug::ComponentGaussSeidel< TDomain, TAlgebra >::step(), ug::ElementGaussSeidel< TDomain, TAlgebra >::step(), ug::SequentialSubspaceCorrection< TDomain, TAlgebra >::step(), ug::UzawaBase< TDomain, TAlgebra >::step(), ug::LineGaussSeidel< TDomain, TAlgebra >::step(), ug::LineVanka< TDomain, TAlgebra >::step(), ug::UGForceExit(), ugshell_main(), ug::VTKOutput< TDim >::vtu_filename(), ug::VTKOutput< TDim >::write_pvtu(), ug::VTKOutput< TDim >::write_subset_pvd(), ug::VTKOutput< TDim >::write_time_processwise_pvd(), ug::VTKOutput< TDim >::write_time_pvd(), ug::VTKOutput< TDim >::write_time_pvd_subset(), WriteCombinedParallelFile(), and ug::ConnectionViewer::WriteMatrixPar().

◆ OneProcTrue()

◆ operator<<()

◆ ParallelReadFile()

bool pcl::ParallelReadFile ( std::string &  filename,
std::vector< char > &  file,
bool  bText,
bool  bDistributedLoad,
const ProcessCommunicator pc = ProcessCommunicator() 
)

util function to read a file in parallel.

See also
ReadFile in serial
Parameters
filenamefilename (in/out!)
filethe file
iftrue, use r instead of rb for file functions
bDistributedLoadif false, just use ReadFile.
rankwhich should open files. core with rank pc.get_proc_id(0) reads this filename. status, filename, and file are transmitted to other cores
Returns
false on all cores if

◆ PrintLayout() [1/3]

template<typename TLayout >
bool pcl::PrintLayout ( const pcl::ProcessCommunicator processCommunicator,
pcl::InterfaceCommunicator< TLayout > &  com,
const TLayout &  masterLayout,
const TLayout &  slaveLayout 
)
inline

References TestLayout().

◆ PrintLayout() [2/3]

template<typename TLayout , typename TValue >
bool pcl::PrintLayout ( const pcl::ProcessCommunicator processCommunicator,
pcl::InterfaceCommunicator< TLayout > &  com,
const TLayout &  masterLayout,
const TLayout &  slaveLayout,
boost::function< TValue(typename TLayout::Element)>  cbToValue = TrivialToValue<typename TLayout::Element> 
)

◆ PrintLayout() [3/3]

template<typename TLayout >
void pcl::PrintLayout ( const TLayout &  layout)
inline

References UG_LOG.

◆ PrintPC()

void pcl::PrintPC ( const pcl::ProcessCommunicator processCommunicator)
inline

◆ ProcRank()

int pcl::ProcRank ( )

returns the rank of the process

References PCL_COMM_WORLD.

Referenced by ug::AddConnectionsBetweenSlaves(), ug::AddEntriesToIndexLayout_DomainDecomposition(), ug::AddExtraProcessEntriesToSubdomainLayout(), ug::ParallelNodes::append_nodes_without_comm(), ug::LocalSchurComplement< TAlgebra >::apply(), ug::SchurComplementOperator< TAlgebra >::apply(), ug::PrimalSubassembledMatrixInverse< TAlgebra >::apply_return_defect(), available_terminals(), pcl::ProcessCommunicator::broadcast(), ug::IDomain< TGrid, TSubsetHandler >::broadcast_refinement_projector(), ug::BroadcastGrid(), ug::BroadcastVectorFromOne(), ug::BuildDomainDecompositionLayouts(), ug::BuildOneToManyLayout(), ug::CollectMatrixOnOneProc(), ug::ParallelColoring::color(), ug::CommunicateConnections(), CommunicateInvolvedProcesses(), ug::ContinuousDebugSave(), ug::CopyInterfaceEntrysToDomainDecompositionLayouts(), ug::ComPol_NewConstrainedVerticals< TLayout >::create_initial_hash_entry(), ug::FetiLayouts< TAlgebra >::create_layouts(), ug::DistributedGridManager::create_missing_constrained_h_interfaces(), ug::NewLayoutCreator::create_node(), ug::ParallelNodes::create_node(), ug::CreateAndDistributeGlobalIDs(), ug::CreateLayoutsFromDistInfos(), ug::HangingNodeRefiner_MultiGrid::debug_save(), ug::DistributeGrid(), ug::ComPol_NewConstrainedVerticals< TLayout >::exchange_data(), ug::ComPol_NewConstrainedVerticals< TLayout >::extract(), ug::FillDistInfos(), pcl::ProcessCommunicator::gather(), ug::GatherVectorOnOne(), ug::GenerateGlobalAlgebraIDs(), ug::ParallelNodes::get_local_index_if_available(), ug::ParallelNodes::get_local_index_or_create_new(), pcl::ProcessCommunicator::get_local_proc_id(), pcl::ProcessCommunicator::get_proc_id(), ug::LogAssistant::get_process_rank(), ug::ConnectionViewer::GetParallelName(), ug::IApproximationSpace::grid_changed_callback(), ug::IApproximationSpace::grid_distribution_callback(), ug::PrimalSubassembledMatrixInverse< TAlgebra >::init(), ug::ProcessHierarchy::init_cluster_procs(), ug::AgglomeratingBase< TBase, TAlgebra >::init_mat(), ug::bridge::Evaluate::PointEvaluatorBase< TDomain, TAlgebra >::initialize(), ug::AlgebraID::is_master(), ug::LogAssistant::is_output_process(), pcl::ProcessCommunicator::is_proc_id(), ug::AlgebraID::is_slave(), ug::LoadGrid(), ug::script::LoadUGScript(), ug::LogIndexLayoutOnAllProcs(), ug::ExpectedErrorMarkingStrategy< TDomain >::mark(), ug::MarkElements(), ug::MarkElementsAbsolute(), ug::MergeGlobalLayout(), MinimalKeyValuePairAcrossAllProcs(), ug::ParallelLayoutDebugSave(), ug::ParallelNodes::ParallelNodes(), ParallelReadFile(), ug::Partitioner_DynamicBisection< TElem, dim >::partition(), ug::PartitionDomain_MetisKWay(), ug::PartitionDomain_RegularGrid(), ug::PartitionMultiGridLevel_MetisKway(), ug::PartitionMultiGridLevel_ParmetisKway(), ug::ParallelHangingNodeRefiner_MultiGrid::post_coarsen(), ug::ParallelHangingNodeRefiner_MultiGrid::post_refine(), ug::ParallelHangingNodeRefiner_MultiGrid::pre_coarsen(), ug::ParallelHangingNodeRefiner_MultiGrid::pre_refine(), ug::VTKOutput< TDim >::print(), ug::IApproximationSpace::print_statistic(), ug::VTKOutput< TDim >::print_subset(), ug::VTKOutput< TDim >::print_subsets(), ug::NewLayoutCreator::process(), ug::ParallelNodes::process(), ReadCombinedParallelFile(), ug::ConsistencyCheckClass< TVec, TValue >::receive(), ug::ReceiveMatrix(), ug::bridge::RegisterBridge_PCL(), ug::MGStats< TDomain, TAlgebra >::save_stats_to_file(), ug::SaveGrid(), ug::SendMatrix(), SendRecvBuffersMatch(), SendRecvListsMatch(), ug::SchurComplementOperator< TAlgebra >::set_debug_dim(), ug::ParallelProgress::start(), ug::bridge::Evaluate::PointEvaluatorBase< TDomain, TAlgebra >::step_process(), TestLayout(), TestLayoutIsDoubleEnded(), TestSizeOfInterfacesInLayoutsMatch(), ug::IDomain< TGrid, TSubsetHandler >::update_subset_infos(), ug::VTKOutput< TDim >::write_cell_proc_ranks(), ug::VTKOutput< TDim >::write_subset_pvd(), WriteCombinedParallelFile(), ug::ConnectionViewer::WriteMatrixPar(), WriteParallelArchive(), and ug::WriteVectorCSV().

◆ ReceiveData()

void pcl::ReceiveData ( void *  pBuffOut,
ProcID  srcProc,
int  bufferSize,
int  tag 
)

receives the data that was send with

See also
SendData or
DistributeData.

References MPI_Wait(), PCL_COMM_WORLD, and UG_LOG.

◆ RemoveEmptyInterfaces()

template<class TLayout >
void pcl::RemoveEmptyInterfaces ( TLayout &  layout)

removes all empty interfaces from the given layout.

Referenced by ug::AddEntriesToLevelIndexLayout(), ug::AddEntriesToSurfaceIndexLayout(), and ug::DoFDistribution::reinit_index_layout().

◆ RemoveUnselectedInterfaceEntries() [1/2]

template<class TLayout , class TSelector >
bool pcl::RemoveUnselectedInterfaceEntries ( TLayout &  layout,
TSelector &  sel 
)

Removes unselected entries from the interfaces in the given layout. Empty interfaces are removed from the layout, too.

TLayout has to be compatible with pcl::Layout or pcl::MultiLevelLayout.

bool TSelector::is_selected(TType* t);
Returns
: true, if the layout has changed, false if not.

Referenced by RemoveUnselectedInterfaceEntries().

◆ RemoveUnselectedInterfaceEntries() [2/2]

template<class TType , class TLayoutMap , class TSelector >
bool pcl::RemoveUnselectedInterfaceEntries ( TLayoutMap &  lm,
TSelector &  sel 
)

Removes interface-entries, empty interfaces and empty layouts from the given layoutMap for the given type.

TLayoutMap has to be compatible with pcl::LayoutMap.

TSelector has to feature a method

bool TSelector::is_selected(TType* t);
Returns
: true, if the layout-map has changed, false if not.

References RemoveUnselectedInterfaceEntries().

◆ SendData()

void pcl::SendData ( ProcID  destProc,
void *  pBuffer,
int  bufferSize,
int  tag 
)

sends data to another process. data may be received using

See also
ReceiveData or
CollectData.

References MPI_Wait(), PCL_COMM_WORLD, and UG_LOG.

◆ SendRecvBuffersMatch()

bool pcl::SendRecvBuffersMatch ( const std::vector< int > &  recvFrom,
const std::vector< int > &  recvBufSizes,
const std::vector< int > &  sendTo,
const std::vector< int > &  sendBufSizes,
const ProcessCommunicator involvedProcs = ProcessCommunicator() 
)

checks whether matching buffers in send- and recv-lists have the same size

Note that this method does not check whether matching buffers exist. This is assumed. Checks are only performed on the sizes of associated buffers.

Make sure that recvBufSizes specifies the buffer size for each entry in recvFrom. Same for sendBufSizes and sendTo.

The return value is the same for all participating processes.

See also
pcl::SendRecvMapsMatch

References AllProcsTrue(), pcl::ProcessCommunicator::gather(), ug::LogAssistant::get_output_process(), pcl::ProcessCommunicator::get_proc_id(), ug::GetLogAssistant(), PCL_COMM_WORLD, PCL_DT_INT, PCL_PROFILE_FUNC, ProcRank(), s, pcl::ProcessCommunicator::size(), UG_LOG, and Waitall().

Referenced by pcl::InterfaceCommunicator< TLayout >::communicate_and_resume().

◆ SendRecvListsMatch()

bool pcl::SendRecvListsMatch ( const std::vector< int > &  recvFrom,
const std::vector< int > &  sendTo,
const ProcessCommunicator involvedProcs = ProcessCommunicator() 
)

◆ SetErrHandler()

void pcl::SetErrHandler ( )

sets error handler

References MPIErrorHandler(), and PCL_COMM_WORLD.

Referenced by Init().

◆ SynchronizeProcesses()

void pcl::SynchronizeProcesses ( )

synchronizes all processes. This is just a shortcut if all processes have to be synchronized. This is equivalent to calling pcl::ProcessCommunicator()::barrier().

See also
pcl::ProcessCommunicator::barrier

References pcl::ProcessCommunicator::barrier().

Referenced by ug::LogIndexLayoutOnAllProcs(), and ug::bridge::RegisterBridge_PCL().

◆ TestLayout() [1/2]

template<typename TLayout >
bool pcl::TestLayout ( const pcl::ProcessCommunicator processCommunicator,
pcl::InterfaceCommunicator< TLayout > &  com,
const TLayout &  masterLayout,
const TLayout &  slaveLayout,
bool  bPrint = false,
bool  compareValues = false 
)

◆ TestLayout() [2/2]

template<typename TLayout , typename TValue >
bool pcl::TestLayout ( const pcl::ProcessCommunicator processCommunicator,
pcl::InterfaceCommunicator< TLayout > &  com,
const TLayout &  masterLayout,
const TLayout &  slaveLayout,
bool  bPrint = false,
boost::function< TValue(typename TLayout::Element)>  cbToValue = TrivialToValue<typename TLayout::Element>,
bool  compareValues = false 
)

Checks whether the given layouts are consistent.

Checks whether the given master and slave layout have the same number of elements and prints associated elements if bPrint = true. If the callback cbToValue is specified, then it is used during printing to print values associated with the elements in the layouts instead of printing the elements directly.

If compareValues = true is specified, then all entries supplied by cbToValue are compared between connected interface entries and mismatches are reported.

The methods returns true if all interfaces match and false if not. The return values are consistent among all processes.

References AllProcsTrue(), ProcRank(), PROFILE_FUNC_GROUP, TestLayoutIsDoubleEnded(), and UG_LOG.

Referenced by ug::GenerateOverlapClass< matrix_type >::calculate(), ug::GenerateOverlapClass< matrix_type >::communicate(), ug::PrimalSubassembledMatrixInverse< TAlgebra >::init(), PrintLayout(), ug::PrintLayouts(), and ug::FetiLayouts< TAlgebra >::test_layouts().

◆ TestLayoutIsDoubleEnded()

template<typename TLayout >
bool pcl::TestLayoutIsDoubleEnded ( const pcl::ProcessCommunicator  processCommunicator,
pcl::InterfaceCommunicator< TLayout > &  com,
const TLayout &  masterLayout,
const TLayout &  slaveLayout 
)

tests if masterLayouts proc id's find a match in corresponding slaveLayouts proc ids.

that is, iff processor P1 has processor P2 in his masterLayout, then processor P2 needs to have P1 in his slaveLayout

References pcl::InterfaceCommunicator< TLayout >::communicate(), ug::Deserialize(), pcl::ProcessCommunicator::get_local_proc_id(), pcl::ProcessCommunicator::get_proc_id(), ProcRank(), PROFILE_FUNC_GROUP, pcl::InterfaceCommunicator< TLayout >::receive_raw(), pcl::InterfaceCommunicator< TLayout >::send_raw(), pcl::ProcessCommunicator::size(), and UG_LOG.

Referenced by TestLayout().

◆ TestSizeOfInterfacesInLayoutsMatch()

template<typename TLayout , typename TValue >
bool pcl::TestSizeOfInterfacesInLayoutsMatch ( pcl::InterfaceCommunicator< TLayout > &  com,
const TLayout &  masterLayout,
const TLayout &  slaveLayout,
bool  bPrint = false,
boost::function< TValue(typename TLayout::Element)>  cbToValue = TrivialToValue<typename TLayout::Element>,
bool  compareValues = false 
)

if processor P1 has a interface to P2, then the size of the interface P1->P2 has to be the same as the size of interface P2->P1

You may specify a callback, which allows to print not the elements in the interfaces directly, but to print associated values. This is useful, if e.g. pointers are stored in the layouts.

If compareValues = true is specified, then all entries supplied by cbToValue are compared between connected interface entries and mismatches are reported.

The callback-method takes a parameter of type TLayout::Element and has to return a value of type TValue (TValue = TLayout::Element by default).

References ug::BinaryBuffer::buffer(), pcl::InterfaceCommunicator< TLayout >::communicate(), ug::Deserialize(), ug::BinaryBuffer::eof(), ProcRank(), PROFILE_FUNC_GROUP, pcl::InterfaceCommunicator< TLayout >::receive_raw(), pcl::InterfaceCommunicator< TLayout >::send_raw(), ug::Serialize(), UG_LOG, and ug::BinaryBuffer::write_pos().

◆ Time()

double pcl::Time ( )

returns the time in seconds

◆ ToString()

◆ TrivialToValue()

template<class TElem >
TElem pcl::TrivialToValue ( TElem  e)

Trivial implementation of a to-value callback.

TValue has to be constructable from TElem.

◆ Waitall() [1/3]

void pcl::Waitall ( std::vector< MPI_Request > &  requests)
inline

◆ Waitall() [2/3]

void pcl::Waitall ( std::vector< MPI_Request > &  requests,
std::vector< MPI_Request > &  requests2 
)
inline

◆ Waitall() [3/3]