Skip to content
Snippets Groups Projects
Commit ffb51fe3 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #4716: Cache which rank subbands come from to allow MPI to optimise for...

Task #4716: Cache which rank subbands come from to allow MPI to optimise for having a known sender for the data
parent 06546454
Branches
No related tags found
No related merge requests found
......@@ -24,6 +24,21 @@ namespace LOFAR {
return keys;
}
// Returns the keys of an std::map, for non-empty elements
template<typename K, typename V>
std::vector<K> keys_nonempty( const std::map<K, std::vector<V> > &m )
{
std::vector<K> keys;
keys.reserve(m.size());
for (typename std::map<K, std::vector<V> >::const_iterator i = m.begin(); i != m.end(); ++i) {
if (!i->second.empty())
keys.push_back(i->first);
}
return keys;
}
// Returns the set of unique values of an std::map.
template<typename K, typename V>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment