ug4
|
the Process Communication Layer 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) |
the Process Communication Layer
#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()) |
typedef MPI_Datatype pcl::DataType |
typedef int pcl::ProcID |
typedef MPI_Op pcl::ReduceOperation |
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().
void pcl::AddLayout | ( | TLayout & | destLayout, |
const TLayout & | sourceLayout | ||
) |
bool pcl::AllProcsTrue | ( | bool | bFlag, |
ProcessCommunicator | comm = ProcessCommunicator() |
||
) |
performs an allreduce and returns true if and only if all procs called the function with bFlag = true
References pcl::ProcessCommunicator::allreduce(), pcl::ProcessCommunicator::empty(), pcl::ProcessCommunicator::is_local(), PCL_DEBUG_BARRIER, PCL_DT_INT, PCL_PROFILE, and PCL_RO_LAND.
Referenced by ug::FETISolver< TAlgebra >::apply_return_defect(), ug::PrimalSubassembledMatrixInverse< TAlgebra >::apply_return_defect(), ug::AgglomeratingBase< TBase, TAlgebra >::base_init(), ug::CheckDiagonalInvertible(), ug::CheckDistributedParentTypes(), ug::CheckVectorInvertible(), ug::ConsistencyCheck(), ug::FETISolver< TAlgebra >::init(), ug::IsFinite(), ug::IsFiniteAndNotTooBig(), ug::LoadGrid(), ug::script::LoadUGScript(), ug::bridge::PclAllProcsTrue(), SendRecvBuffersMatch(), SendRecvListsMatch(), ug::TestGridLayoutMap(), and TestLayout().
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.
sendBuf | Sending buffer |
recBuf | Recieve buffer |
count | |
type | Data type |
op | has to be one of the |
References PCL_COMM_WORLD, and UG_LOG.
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.
References ug::find().
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().
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().
void pcl::CollectUniqueElements | ( | std::vector< typename TLayout::Element > & | elemsOut, |
const TLayout & | layout | ||
) |
writes all elements in the interfaces into the resulting vector. avoids doubles.
References ug::Hash< TKey, TValue >::has_entry(), ug::Hash< TKey, TValue >::insert(), and ug::Hash< TKey, TValue >::reserve().
Referenced by ug::BuildOneToManyLayout(), ug::GenerateOverlapClass< matrix_type >::calculate(), ug::PrimalSubassembledMatrixInverse< TAlgebra >::init(), ug::IExternalSolver< TAlgebra >::mat_preprocess(), ug::ILUTScalarPreconditioner< TAlgebra >::preprocess(), ug::IBlockJacobiPreconditioner< TAlgebra >::preprocess(), ug::GaussSeidelBase< TAlgebra >::preprocess(), ug::ILU< TAlgebra >::preprocess(), ug::Vanka< TAlgebra >::preprocess(), ug::DiagVanka< TAlgebra >::preprocess(), ug::ComponentGaussSeidel< TDomain, TAlgebra >::preprocess(), ug::UzawaBase< TDomain, TAlgebra >::preprocess(), ug::LineGaussSeidel< TDomain, TAlgebra >::preprocess(), ug::LineVanka< TDomain, TAlgebra >::preprocess(), and ug::ILUTPreconditioner< TAlgebra >::preprocess_mat().
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().
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.
References PERFORM_MPI_INITIALIZATION.
Referenced by ug::bridge::RegisterBridge_PCL().
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().
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().
void pcl::Finalize | ( | ) |
call this method right before quitting your application
References PCL_PROFILE, and PERFORM_MPI_INITIALIZATION.
Referenced by ug::UGFinalize().
|
inline |
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().
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.
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().
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.
keyInOut | each proc's key (used as input and as output) |
valInOut | each proc's value (used as input and as output) |
cmp | object 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().
|
inline |
References PROFILE_FUNC_GROUP.
Referenced by pcl::ProcessCommunicator::receive_data(), ReceiveData(), pcl::ProcessCommunicator::send_data(), and SendData().
|
inline |
References PROFILE_FUNC_GROUP.
Referenced by Waitall().
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().
bool pcl::OneProcTrue | ( | bool | bFlag, |
ProcessCommunicator | comm = ProcessCommunicator() |
||
) |
performs an allreduce and returns true at least one process called the function with bFlag = true
References pcl::ProcessCommunicator::allreduce(), pcl::ProcessCommunicator::empty(), pcl::ProcessCommunicator::is_local(), PCL_DEBUG_BARRIER, PCL_DT_INT, PCL_PROFILE, and PCL_RO_LOR.
Referenced by ug::ParallelHangingNodeRefiner_MultiGrid::continue_collect_objects_for_refine(), ug::LoadGrid(), ug::HangingNodeRefinerBase< TSelector >::mark_neighborhood(), ug::ParallelHangingNodeRefiner_MultiGrid::one_proc_true(), ug::ParallelHNodeAdjuster::ref_marks_changed(), and ug::SynchronizeAttachedGlobalAttachments().
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.
filename | filename (in/out!) |
file | the file |
if | true, use r instead of rb for file functions |
bDistributedLoad | if false, just use ReadFile. |
rank | which should open files. core with rank pc.get_proc_id(0) reads this filename. status, filename, and file are transmitted to other cores |
|
inline |
References TestLayout().
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> |
||
) |
|
inline |
References UG_LOG.
|
inline |
References pcl::ProcessCommunicator::get_proc_id(), pcl::ProcessCommunicator::size(), and UG_LOG.
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().
void pcl::ReceiveData | ( | void * | pBuffOut, |
ProcID | srcProc, | ||
int | bufferSize, | ||
int | tag | ||
) |
receives the data that was send with
References MPI_Wait(), PCL_COMM_WORLD, and UG_LOG.
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().
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.
Referenced by RemoveUnselectedInterfaceEntries().
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
References RemoveUnselectedInterfaceEntries().
void pcl::SendData | ( | ProcID | destProc, |
void * | pBuffer, | ||
int | bufferSize, | ||
int | tag | ||
) |
sends data to another process. data may be received using
References MPI_Wait(), PCL_COMM_WORLD, and UG_LOG.
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.
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().
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
The return value is the same for all participating processes.
References AllProcsTrue(), CommunicateInvolvedProcesses(), ug::find(), pcl::ProcessCommunicator::gather(), ug::LogAssistant::get_output_process(), pcl::ProcessCommunicator::get_proc_id(), ug::GetLogAssistant(), PCL_DT_INT, PCL_PROFILE_FUNC, ProcRank(), pcl::ProcessCommunicator::size(), and UG_LOG.
Referenced by pcl::InterfaceCommunicator< TLayout >::communicate_and_resume().
void pcl::SetErrHandler | ( | ) |
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().
References pcl::ProcessCommunicator::barrier().
Referenced by ug::LogIndexLayoutOnAllProcs(), and ug::bridge::RegisterBridge_PCL().
bool pcl::TestLayout | ( | const pcl::ProcessCommunicator & | processCommunicator, |
pcl::InterfaceCommunicator< TLayout > & | com, | ||
const TLayout & | masterLayout, | ||
const TLayout & | slaveLayout, | ||
bool | bPrint = false , |
||
bool | compareValues = false |
||
) |
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().
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().
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().
double pcl::Time | ( | ) |
returns the time in seconds
|
inline |
TElem pcl::TrivialToValue | ( | TElem | e | ) |
Trivial implementation of a to-value callback.
TValue has to be constructable from TElem.
|
inline |
References MPI_Waitall(), and PROFILE_FUNC_GROUP.
|
inline |
References MPI_Waitall(), and PROFILE_FUNC_GROUP.
|
inline |
References MPI_Waitall(), and PROFILE_FUNC_GROUP.
Referenced by pcl::MultiGroupCommunicator::allreduce(), CollectData(), pcl::InterfaceCommunicator< TLayout >::communicate_and_resume(), pcl::ProcessCommunicator::distribute_data(), DistributeData(), pcl::ProcessCommunicator::send_data(), SendRecvBuffersMatch(), and pcl::InterfaceCommunicator< TLayout >::wait().