9 #ifndef stk_util_parallel_DistributedIndex_hpp 10 #define stk_util_parallel_DistributedIndex_hpp 16 #include <stk_util/parallel/Parallel.hpp> 18 class UnitTestSTKParallelDistributedIndex ;
42 typedef uint64_t KeyType ;
43 typedef int ProcType ;
44 typedef std::pair<KeyType,KeyType> KeySpan ;
45 typedef std::pair<KeyType,ProcType> KeyProc ;
61 const std::vector<KeySpan> & partition_spans );
65 void query( std::vector<KeyProc> & sharing_of_local_keys )
const ;
71 void query(
const std::vector<KeyType> & keys ,
72 std::vector<KeyProc> & sharing_of_keys )
const ;
79 std::vector<KeyProc> & sharing_of_keys )
const ;
86 void update_keys(
const std::vector<KeyType> & add_new_keys ,
87 const std::vector<KeyType> & remove_existing_keys );
108 const std::vector<size_t> & requests ,
109 std::vector< std::vector<KeyType> > & requested_keys );
116 void generate_new_global_key_upper_bound(
117 const std::vector<size_t> & requests ,
118 std::vector<DistributedIndex::KeyType> & global_key_upper_bound )
const;
124 void generate_new_keys_local_planning(
125 const std::vector<DistributedIndex::KeyType> & global_key_upper_bound ,
126 const std::vector<size_t> & requests_local ,
127 std::vector<long> & new_requests ,
128 std::vector<KeyType> & requested_keys ,
129 std::vector<KeyType> & contrib_keys )
const ;
134 void generate_new_keys_global_planning(
135 const std::vector<long> & new_request ,
136 std::vector<long> & my_donations )
const ;
139 void query(
const std::vector<KeyProc> & request ,
140 std::vector<KeyProc> & sharing_of_keys )
const ;
146 ProcType to_which_proc(
const KeyType & key )
const ;
158 ProcType m_comm_rank ;
159 ProcType m_comm_size ;
160 size_t m_span_count ;
161 std::vector<KeySpan> m_key_span ;
162 std::vector<KeyProc> m_key_usage ;
167 friend class ::UnitTestSTKParallelDistributedIndex ;
void query_to_usage(const std::vector< KeyType > &keys, std::vector< KeyProc > &sharing_of_keys) const
Query which processors added the given keys. The results of the query are pushed to the processes on ...
void query(std::vector< KeyProc > &sharing_of_local_keys) const
Query with which process the local added keys are shared.
void generate_new_keys(const std::vector< size_t > &requests, std::vector< std::vector< KeyType > > &requested_keys)
Request a collection of unused keys.
void update_keys(const std::vector< KeyType > &add_new_keys, const std::vector< KeyType > &remove_existing_keys)
Update a parallel index with new and changed keys. FIRST: Remove this process' participation in the e...
Parallel cross-reference index for a collection of keys.