FEI Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
fei_NodeCommMgr.hpp
Go to the documentation of this file.
1#ifndef _NodeCommMgr_hpp_
2#define _NodeCommMgr_hpp_
3
4/*--------------------------------------------------------------------*/
5/* Copyright 2005 Sandia Corporation. */
6/* Under the terms of Contract DE-AC04-94AL85000, there is a */
7/* non-exclusive license for use of this work by or on behalf */
8/* of the U.S. Government. Export of this program may require */
9/* a license from the United States Government. */
10/*--------------------------------------------------------------------*/
11
12#include <fei_fwd.hpp>
13
14#include <fei_CommUtils.hpp>
15
37class NodeCommMgr : public fei::MessageHandler<int> {
38 public:
40
41 NodeCommMgr(MPI_Comm comm, const SNL_FEI_Structure& problemStructure, int sharedNodeOwnership=STRICTLY_LOW_PROC);
42 virtual ~NodeCommMgr();
43
44 size_t getNumSharedNodes() {return(sharedNodeIDs.size());}
45 std::vector<GlobalID>& getLocalNodeIDs() {return(localNodeIDs);}
46 std::vector<GlobalID>& getSharedNodeIDs() {return(sharedNodeIDs);}
47 std::vector<int>& getSharedNodeNumbers() {return(sharedNodeNumbers);}
48
49 int getSharedNodeIndex_num(int nodeNumber);
50
51 int addSharedNodes(const GlobalID* nodeIDs, int numNodes,
52 const int* const* procs, const int* numProcs);
53
54 int initComplete(NodeDatabase& nodeDB, bool safetyCheck);
55
56 int informLocal(const NodeDescriptor& node);
57
58 int exchangeEqnInfo();
59
60 int getSharedNodeIndex(GlobalID nodeID);
61
63 std::vector<int>* getSharedNodeSubdomainList(GlobalID nodeID);
64
66 {return(*(sharedNodes_[index]));}
67
68 std::vector<int>& getSharedNodeProcs(int index)
69 {return(*(sharingProcs_[index]));};
70
71 void setSharedOwnershipRule(int ownershipRule)
72 { sharedNodeOwnership_ = ownershipRule; }
73
74 std::vector<int>& getSendProcs();
75 std::vector<int>& getRecvProcs();
76
77 int getSendMessageLength(int destProc, int& messageLength);
78 int getSendMessage(int destProc, std::vector<int>& message);
79 int processRecvMessage(int srcProc, std::vector<int>& message);
80
81 private:
84
86
87 int storeNodeProcs(int index, std::vector<std::vector<int>*>& procTable,
88 const int* procs, int numProcs);
89
91
92 int checkCommArrays(const char* whichCheck,
93 std::vector<int>& globalRemoteProcs,
94 std::vector<int>& globalNodesPerRemoteProc,
95 std::vector<int>& globalRemoteProcLengths,
96 std::vector<int>& nodesPerRemoteProc,
97 std::vector<int>& remoteProcs);
98
100
101 void packLocalNodesAndData(int* data, int proc,
102 int numNodes, int len);
103 void packRemoteNodesAndData(GlobalID* data, int proc,
104 int numNodes, int len);
105
107
108 int createProcLists();
109
110 int createProcList(std::vector<int>& itemsPerProc,
111 std::vector<int>& procs);
112
114
115 int getGlobalMaxFieldsBlocks(int& maxFields, int& maxBlocks);
116
118
121
123
124 std::vector<GlobalID> localNodeIDs;
125 std::vector<GlobalID> remoteNodeIDs;
126
127 std::vector<GlobalID> sharedNodeIDs; //global node identifiers
128
129 std::vector<std::vector<int> > sharedNodeSubdomains;
130 //subdomains each shared node
131 //appears in.
132 std::vector<int> trivialSubdomainList;
133
134 std::vector<std::vector<int>*> sharingProcs_;//table, i-th row is a list of procs
135 //associated with i-th shared node
136
137 std::vector<int> sharedNodeNumbers;
138
141
144
148
151};
152
153#endif
154
void setSharedOwnershipRule(int ownershipRule)
NodeDescriptor ** sharedNodes_
std::vector< GlobalID > remoteNodeIDs
std::vector< int > & getSharedNodeNumbers()
std::vector< GlobalID > localNodeIDs
int getSharedNodeIndex_num(int nodeNumber)
std::vector< GlobalID > & getSharedNodeIDs()
std::vector< int > nodesPerOwnerProc_
NodeCommMgr(const NodeCommMgr &src)
int addSharedNodes(const GlobalID *nodeIDs, int numNodes, const int *const *procs, const int *numProcs)
std::vector< int > nodesPerSharingProc_
int processRecvMessage(int srcProc, std::vector< int > &message)
const SNL_FEI_Structure & probStruc
std::vector< int > & getRecvProcs()
std::vector< int > & getSharedNodeProcs(int index)
std::vector< int > remoteSharingProcs_
int informLocal(const NodeDescriptor &node)
NodeDescriptor & getSharedNodeAtIndex(int index)
void setNodeNumbersArray()
int getSharedNodeIndex(GlobalID nodeID)
std::vector< std::vector< int > > sharedNodeSubdomains
int getSharedNodeNumSubdomains(GlobalID nodeID)
int initComplete(NodeDatabase &nodeDB, bool safetyCheck)
int createProcList(std::vector< int > &itemsPerProc, std::vector< int > &procs)
int storeNodeProcs(int index, std::vector< std::vector< int > * > &procTable, const int *procs, int numProcs)
std::vector< GlobalID > & getLocalNodeIDs()
std::vector< int > remoteOwnerProcs_
virtual ~NodeCommMgr()
std::vector< int > * getSharedNodeSubdomainList(GlobalID nodeID)
int getSendMessage(int destProc, std::vector< int > &message)
int getGlobalMaxFieldsBlocks(int &maxFields, int &maxBlocks)
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)
NodeCommMgr & operator=(const NodeCommMgr &src)
int getSendMessageLength(int destProc, int &messageLength)
std::vector< std::vector< int > * > sharingProcs_
std::vector< int > sharedNodeNumbers
int adjustSharedOwnership()
void packLocalNodesAndData(int *data, int proc, int numNodes, int len)
size_t getNumSharedNodes()
std::vector< GlobalID > sharedNodeIDs
int allocateNodeDescriptorPtrs(NodeDatabase &nodeDB)
NodeCommMgr(MPI_Comm comm, const SNL_FEI_Structure &problemStructure, int sharedNodeOwnership=STRICTLY_LOW_PROC)
std::vector< int > trivialSubdomainList
void packRemoteNodesAndData(GlobalID *data, int proc, int numNodes, int len)
int getGlobalMaxFieldsBlocksSubdomains()
std::vector< int > & getSendProcs()
int exchangeSharedRemoteFieldsBlks()
int GlobalID
Definition fei_defs.h:60
#define MPI_Comm
Definition fei_mpi.h:56