FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
NodeCommMgr Class Reference

#include <fei_NodeCommMgr.hpp>

Inheritance diagram for NodeCommMgr:
Inheritance graph
[legend]

Public Types

enum  { STRICTLY_LOW_PROC, PROC_WITH_LOCAL_ELEM, CALLER_SPECIFIES }
 

Public Member Functions

 NodeCommMgr (MPI_Comm comm, const SNL_FEI_Structure &problemStructure, int sharedNodeOwnership=STRICTLY_LOW_PROC)
 
virtual ~NodeCommMgr ()
 
size_t getNumSharedNodes ()
 
std::vector< GlobalID > & getLocalNodeIDs ()
 
std::vector< GlobalID > & getSharedNodeIDs ()
 
std::vector< int > & getSharedNodeNumbers ()
 
int getSharedNodeIndex_num (int nodeNumber)
 
int addSharedNodes (const GlobalID *nodeIDs, int numNodes, const int *const *procs, const int *numProcs)
 
int initComplete (NodeDatabase &nodeDB, bool safetyCheck)
 
int informLocal (const NodeDescriptor &node)
 
int exchangeEqnInfo ()
 
int getSharedNodeIndex (GlobalID nodeID)
 
int getSharedNodeNumSubdomains (GlobalID nodeID)
 
std::vector< int > * getSharedNodeSubdomainList (GlobalID nodeID)
 
NodeDescriptorgetSharedNodeAtIndex (int index)
 
std::vector< int > & getSharedNodeProcs (int index)
 
void setSharedOwnershipRule (int ownershipRule)
 
std::vector< int > & getSendProcs ()
 
std::vector< int > & getRecvProcs ()
 
int getSendMessageLength (int destProc, int &messageLength)
 
int getSendMessage (int destProc, std::vector< int > &message)
 
int processRecvMessage (int srcProc, std::vector< int > &message)
 
- Public Member Functions inherited from fei::MessageHandler< int >
virtual ~MessageHandler ()
 

Private Member Functions

 NodeCommMgr (const NodeCommMgr &src)
 
NodeCommMgroperator= (const NodeCommMgr &src)
 
int allocateNodeDescriptorPtrs (NodeDatabase &nodeDB)
 
int storeNodeProcs (int index, std::vector< std::vector< int > * > &procTable, const int *procs, int numProcs)
 
int checkSharedNodeInfo ()
 
int checkCommArrays (const char *whichCheck, std::vector< int > &globalRemoteProcs, std::vector< int > &globalNodesPerRemoteProc, std::vector< int > &globalRemoteProcLengths, std::vector< int > &nodesPerRemoteProc, std::vector< int > &remoteProcs)
 
void setNodeNumbersArray ()
 
void packLocalNodesAndData (int *data, int proc, int numNodes, int len)
 
void packRemoteNodesAndData (GlobalID *data, int proc, int numNodes, int len)
 
int adjustSharedOwnership ()
 
int createProcLists ()
 
int createProcList (std::vector< int > &itemsPerProc, std::vector< int > &procs)
 
int exchangeSharedRemoteFieldsBlks ()
 
int getGlobalMaxFieldsBlocks (int &maxFields, int &maxBlocks)
 
int getGlobalMaxFieldsBlocksSubdomains ()
 

Private Attributes

NodeDescriptor ** sharedNodes_
 
bool sharedNodesAllocated_
 
int sharedNodeOwnership_
 
std::vector< GlobalIDlocalNodeIDs
 
std::vector< GlobalIDremoteNodeIDs
 
std::vector< GlobalIDsharedNodeIDs
 
std::vector< std::vector< int > > sharedNodeSubdomains
 
std::vector< int > trivialSubdomainList
 
std::vector< std::vector< int > * > sharingProcs_
 
std::vector< int > sharedNodeNumbers
 
std::vector< int > remoteOwnerProcs_
 
std::vector< int > remoteSharingProcs_
 
std::vector< int > nodesPerOwnerProc_
 
std::vector< int > nodesPerSharingProc_
 
MPI_Comm comm_
 
int numProcs_
 
int localProc_
 
int maxFields_
 
int maxBlocks_
 
int maxSubdomains_
 
bool initCompleteCalled_
 
const SNL_FEI_StructureprobStruc
 

Detailed Description

NodeCommMgr (Node communication manager) is responsible for keeping track of nodes that require communication (shared nodes).

All shared nodes are put into this class through the addSharedNodes function. When they've all been put in, initComplete() is called, which allocates a list of pointer-to-NodeDescriptors.

Before initComplete is called, all nodes that appear in local element- connectivities should be passed to NodeCommMgr using the informLocal function.

The communication that must then happen is this:

For all nodes that we own, we must send their field-IDs and (global) equation numbers to the remote processors that share the node.

For all nodes that we don't own, we need to receive the field-IDs and equation numbers.

Definition at line 37 of file fei_NodeCommMgr.hpp.

Member Enumeration Documentation

anonymous enum
Enumerator
STRICTLY_LOW_PROC 
PROC_WITH_LOCAL_ELEM 
CALLER_SPECIFIES 

Definition at line 39 of file fei_NodeCommMgr.hpp.

Constructor & Destructor Documentation

NodeCommMgr::NodeCommMgr ( MPI_Comm  comm,
const SNL_FEI_Structure problemStructure,
int  sharedNodeOwnership = STRICTLY_LOW_PROC 
)
NodeCommMgr::~NodeCommMgr ( )
virtual

Definition at line 59 of file fei_NodeCommMgr.cpp.

References sharedNodeIDs, sharedNodes_, sharedNodesAllocated_, and sharingProcs_.

NodeCommMgr::NodeCommMgr ( const NodeCommMgr src)
private

Member Function Documentation

size_t NodeCommMgr::getNumSharedNodes ( )
inline
std::vector<GlobalID>& NodeCommMgr::getLocalNodeIDs ( )
inline
std::vector<GlobalID>& NodeCommMgr::getSharedNodeIDs ( )
inline
std::vector<int>& NodeCommMgr::getSharedNodeNumbers ( )
inline

Definition at line 47 of file fei_NodeCommMgr.hpp.

References sharedNodeNumbers.

Referenced by SNL_FEI_Structure::getSharedNodeNumbers().

int NodeCommMgr::getSharedNodeIndex_num ( int  nodeNumber)
int NodeCommMgr::addSharedNodes ( const GlobalID nodeIDs,
int  numNodes,
const int *const *  procs,
const int *  numProcs 
)
int NodeCommMgr::initComplete ( NodeDatabase nodeDB,
bool  safetyCheck 
)
int NodeCommMgr::informLocal ( const NodeDescriptor node)
int NodeCommMgr::exchangeEqnInfo ( )
int NodeCommMgr::getSharedNodeIndex ( GlobalID  nodeID)
int NodeCommMgr::getSharedNodeNumSubdomains ( GlobalID  nodeID)

Definition at line 76 of file fei_NodeCommMgr.cpp.

References getSharedNodeIndex(), and sharedNodeSubdomains.

Referenced by SNL_FEI_Structure::getNumSubdomains().

std::vector< int > * NodeCommMgr::getSharedNodeSubdomainList ( GlobalID  nodeID)
NodeDescriptor& NodeCommMgr::getSharedNodeAtIndex ( int  index)
inline
std::vector<int>& NodeCommMgr::getSharedNodeProcs ( int  index)
inline
void NodeCommMgr::setSharedOwnershipRule ( int  ownershipRule)
inline
std::vector< int > & NodeCommMgr::getSendProcs ( )
virtual

Get the list of processors to which messages are to be sent in a sparse data exchange.

Implements fei::MessageHandler< int >.

Definition at line 185 of file fei_NodeCommMgr.cpp.

References remoteSharingProcs_.

std::vector< int > & NodeCommMgr::getRecvProcs ( )
virtual
Get the list of processors from which messages are to be received in

a sparse data exchange.

Implements fei::MessageHandler< int >.

Definition at line 191 of file fei_NodeCommMgr.cpp.

References remoteOwnerProcs_.

int NodeCommMgr::getSendMessageLength ( int  destProc,
int &  messageLength 
)
virtual
Get the length of a message that is to be send to the specified

destination processor.

Implements fei::MessageHandler< int >.

Definition at line 197 of file fei_NodeCommMgr.cpp.

References ERReturn, maxBlocks_, maxFields_, maxSubdomains_, nodesPerSharingProc_, and remoteSharingProcs_.

Referenced by getSendMessage().

int NodeCommMgr::getSendMessage ( int  destProc,
std::vector< int > &  message 
)
virtual
Prepare (pack) a message that is to be sent to the specified

destination processor.

Implements fei::MessageHandler< int >.

Definition at line 214 of file fei_NodeCommMgr.cpp.

References CHK_ERR, ERReturn, getSendMessageLength(), nodesPerSharingProc_, packLocalNodesAndData(), and remoteSharingProcs_.

int NodeCommMgr::processRecvMessage ( int  srcProc,
std::vector< int > &  message 
)
virtual
NodeCommMgr& NodeCommMgr::operator= ( const NodeCommMgr src)
private
int NodeCommMgr::allocateNodeDescriptorPtrs ( NodeDatabase nodeDB)
private
int NodeCommMgr::storeNodeProcs ( int  index,
std::vector< std::vector< int > * > &  procTable,
const int *  procs,
int  numProcs 
)
private

Definition at line 1065 of file fei_NodeCommMgr.cpp.

References fei::numProcs().

Referenced by addSharedNodes().

int NodeCommMgr::checkSharedNodeInfo ( )
private
int NodeCommMgr::checkCommArrays ( const char *  whichCheck,
std::vector< int > &  globalRemoteProcs,
std::vector< int > &  globalNodesPerRemoteProc,
std::vector< int > &  globalRemoteProcLengths,
std::vector< int > &  nodesPerRemoteProc,
std::vector< int > &  remoteProcs 
)
private

Definition at line 722 of file fei_NodeCommMgr.cpp.

References fei::binarySearch(), fei::console_out(), FEI_ENDL, localProc_, and numProcs_.

Referenced by checkSharedNodeInfo().

void NodeCommMgr::setNodeNumbersArray ( )
private
void NodeCommMgr::packLocalNodesAndData ( int *  data,
int  proc,
int  numNodes,
int  len 
)
private
void NodeCommMgr::packRemoteNodesAndData ( GlobalID data,
int  proc,
int  numNodes,
int  len 
)
private
int NodeCommMgr::adjustSharedOwnership ( )
private
int NodeCommMgr::createProcLists ( )
private
int NodeCommMgr::createProcList ( std::vector< int > &  itemsPerProc,
std::vector< int > &  procs 
)
private

Definition at line 477 of file fei_NodeCommMgr.cpp.

References fei::numProcs().

Referenced by createProcLists().

int NodeCommMgr::exchangeSharedRemoteFieldsBlks ( )
private
int NodeCommMgr::getGlobalMaxFieldsBlocks ( int &  maxFields,
int &  maxBlocks 
)
private
int NodeCommMgr::getGlobalMaxFieldsBlocksSubdomains ( )
private

Member Data Documentation

NodeDescriptor** NodeCommMgr::sharedNodes_
private
bool NodeCommMgr::sharedNodesAllocated_
private

Definition at line 120 of file fei_NodeCommMgr.hpp.

Referenced by allocateNodeDescriptorPtrs(), and ~NodeCommMgr().

int NodeCommMgr::sharedNodeOwnership_
private

Definition at line 122 of file fei_NodeCommMgr.hpp.

Referenced by initComplete(), and setSharedOwnershipRule().

std::vector<GlobalID> NodeCommMgr::localNodeIDs
private
std::vector<GlobalID> NodeCommMgr::remoteNodeIDs
private

Definition at line 125 of file fei_NodeCommMgr.hpp.

Referenced by adjustSharedOwnership().

std::vector<GlobalID> NodeCommMgr::sharedNodeIDs
private
std::vector<std::vector<int> > NodeCommMgr::sharedNodeSubdomains
private
std::vector<int> NodeCommMgr::trivialSubdomainList
private

Definition at line 132 of file fei_NodeCommMgr.hpp.

Referenced by getSharedNodeSubdomainList(), and NodeCommMgr().

std::vector<std::vector<int>*> NodeCommMgr::sharingProcs_
private
std::vector<int> NodeCommMgr::sharedNodeNumbers
private
std::vector<int> NodeCommMgr::remoteOwnerProcs_
private
std::vector<int> NodeCommMgr::remoteSharingProcs_
private
std::vector<int> NodeCommMgr::nodesPerOwnerProc_
private
std::vector<int> NodeCommMgr::nodesPerSharingProc_
private
MPI_Comm NodeCommMgr::comm_
private
int NodeCommMgr::numProcs_
private
int NodeCommMgr::localProc_
private
int NodeCommMgr::maxFields_
private
int NodeCommMgr::maxBlocks_
private
int NodeCommMgr::maxSubdomains_
private
bool NodeCommMgr::initCompleteCalled_
private

Definition at line 149 of file fei_NodeCommMgr.hpp.

Referenced by initComplete().

const SNL_FEI_Structure& NodeCommMgr::probStruc
private

The documentation for this class was generated from the following files: