9 #include <fei_macros.hpp>
11 #include <snl_fei_BlkSizeMsgHandler.hpp>
13 #include <fei_utils.hpp>
15 #include <snl_fei_Utils.hpp>
16 #include <fei_FieldMask.hpp>
17 #include <snl_fei_RecordCollection.hpp>
18 #include <fei_VectorSpace.hpp>
19 #include <fei_ParameterSet.hpp>
20 #include <fei_Graph.hpp>
21 #include <snl_fei_Constraint.hpp>
22 #include <fei_TemplateUtils.hpp>
24 #include <fei_EqnBuffer.hpp>
25 #include <fei_EqnCommMgr.hpp>
26 #include <SNL_FEI_Structure.hpp>
29 #define fei_file "snl_fei_BlkSizeMsgHandler.cpp"
30 #include <fei_ErrMacros.hpp>
36 : remote_colIndices_(NULL),
37 local_colIndices_(NULL),
55 delete remote_colIndices_;
56 delete local_colIndices_;
69 g_iter = localgraph->
begin(),
70 g_end = localgraph->
end();
76 for(; g_iter != g_end; ++g_iter) {
79 fei::Graph::table_type::row_type::const_iterator
81 iter_end = row->end();
85 for(; iter != iter_end; ++iter) {
87 owner = vecSpace_->getOwnerProcBlkIndex(col);
89 if (owner != local_proc) {
90 remote_colIndices_->addIndices(owner, 1, &col);
102 firstExchange_ =
true;
104 CHK_ERR( fei::exchange(comm_,
this) );
106 firstExchange_ =
false;
108 CHK_ERR( fei::exchange(comm_,
this) );
116 if (firstExchange_) {
127 if (firstExchange_) {
139 if (firstExchange_) {
141 messageLength = cols->size();
146 messageLength = cols->size()*2;
153 std::vector<int>& message)
155 if (firstExchange_) {
157 message.resize(cols->size());
164 message.resize(cols->size()*2);
166 fei::comm_map::row_type::const_iterator
167 iter = cols->begin(),
168 iter_end = cols->end();
171 for(; iter != iter_end; ++iter) {
172 CHK_ERR( ptBlkMap_->getBlkEqnInfo(*iter,
173 message[offset], message[offset+1]) );
183 std::vector<int>& message)
185 if (firstExchange_) {
186 for(
unsigned i=0; i<message.size(); ++i) {
187 local_colIndices_->addIndices(srcProc, 1, &(message[i]));
192 fei::comm_map::row_type::const_iterator
193 iter = cols->begin(),
194 iter_end = cols->end();
197 for(; iter != iter_end; ++iter) {
198 int ptEqn = message[offset];
199 int blkSize = message[offset+1];
200 for(
int i=0; i<blkSize; ++i) {
201 CHK_ERR( ptBlkMap_->setEqn(ptEqn+i, *iter, blkSize) );
int getSendMessageLength(int destProc, int &messageLength)
int getSendMessage(int destProc, std::vector< int > &message)
void copySetToArray(const SET_TYPE &set_obj, int lenList, int *list)
void copyKeysToVector(const MAP_TYPE &map_obj, std::vector< int > &keyvector)
int processRecvMessage(int srcProc, std::vector< int > &message)
int mirrorProcs(MPI_Comm comm, std::vector< int > &toProcs, std::vector< int > &fromProcs)
std::vector< int > & getRecvProcs()
virtual ~BlkSizeMsgHandler()
BlkSizeMsgHandler(fei::VectorSpace *vspace, fei::Graph *graph, MPI_Comm comm)
snl_fei::PointBlockMap * getPointBlockMap()
int localProc(MPI_Comm comm)
MAP_TYPE::iterator iterator
std::vector< int > & getSendProcs()
int numProcs(MPI_Comm comm)