File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,14 +192,29 @@ namespace chunk_assignment
192192 std::map< std::string, ChunkTable > chunkGroups;
193193 ChunkTable & sourceChunks = res.notAssigned ;
194194 ChunkTable & sinkChunks = res.assigned ;
195- for ( auto const & chunk : sourceChunks )
196195 {
197- std::string hostname = in.at ( chunk.sourceID );
198- ChunkTable & chunksOnHost = chunkGroups[ hostname ];
199- chunksOnHost.push_back ( std::move ( chunk ) );
196+ ChunkTable leftover;
197+ for ( auto const & chunk : sourceChunks )
198+ {
199+ auto it = in.find ( chunk.sourceID );
200+ if ( it == in.end () )
201+ {
202+ leftover.push_back ( std::move ( chunk ) );
203+ }
204+ else
205+ {
206+ std::string hostname = it->second ;
207+ ChunkTable & chunksOnHost = chunkGroups[ hostname ];
208+ chunksOnHost.push_back ( std::move ( chunk ) );
209+ }
210+ }
211+ // undistributed chunks will be put back in later on
212+ sourceChunks.clear ();
213+ for ( auto & chunk : leftover )
214+ {
215+ sourceChunks.push_back ( std::move ( chunk ) );
216+ }
200217 }
201- // undistributed chunks will be put back in later on
202- sourceChunks.clear ();
203218 // chunkGroups will now contain chunks by hostname
204219 // the ranks are the source ranks
205220
@@ -426,6 +441,8 @@ namespace chunk_assignment
426441 outer_loop:;
427442 }
428443
444+ std::cout << " BYCOBOIDSLICE assigned " << res.assigned .size () << " chunks" << std::endl;
445+
429446 return res.assigned ;
430447 }
431448
You can’t perform that action at this time.
0 commit comments