29 #define fei_file "snl_fei_BlkSizeMsgHandler.cpp"
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;
106 firstExchange_ =
false;
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)
fei::comm_map * remote_colIndices_
fei::comm_map * local_colIndices_
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()
int exchange(MPI_Comm comm, MessageHandler< T > *msgHandler)
BlkSizeMsgHandler(fei::VectorSpace *vspace, fei::Graph *graph, MPI_Comm comm)
snl_fei::PointBlockMap * getPointBlockMap()
snl_fei::RaggedTable< std::map< int, std::set< int > * >, std::set< int > > comm_map
int localProc(MPI_Comm comm)
MAP_TYPE::iterator iterator
std::vector< int > & getSendProcs()
snl_fei::PointBlockMap * ptBlkMap_
int numProcs(MPI_Comm comm)