23 ip_iter = procs_to_ids_and_sharing_procs.begin(),
24 ip_end = procs_to_ids_and_sharing_procs.end();
26 for(; ip_iter != ip_end; ++ip_iter) {
27 const std::vector<int>& ids_and_procs = ip_iter->second;
28 size_t vsize = ids_and_procs.size();
30 while(offset < vsize) {
31 int id = ids_and_procs[offset++];
32 int num_procs = ids_and_procs[offset++];
34 sharedIDs.
addSharedID(
id, num_procs, &ids_and_procs[offset]);
58 int lowest_global_id,
int highest_global_id)
64 if (numProcs < 2)
return;
68 lowest_global_id, highest_global_id);
80 fei::exchangeCommMapData<int>(comm, procs_to_shared_ids, procs_to_owned_ids);
86 o_iter = procs_to_owned_ids.begin(), o_end = procs_to_owned_ids.end();
88 for(; o_iter != o_end; ++o_iter) {
89 int proc = o_iter->first;
90 std::vector<int>& ids = o_iter->second;
91 for(
size_t i=0; i<ids.size(); ++i) {
101 for(o_iter=procs_to_owned_ids.begin(); o_iter!=procs_to_owned_ids.end(); ++o_iter) {
102 int proc = o_iter->first;
103 std::vector<int>& ids = o_iter->second;
104 for(
size_t i=0; i<ids.size(); ++i) {
105 std::vector<int>& sharing_procs = owned_ids_to_procs[ids[i]];
106 int num_sharing_procs = sharing_procs.size();
107 if (num_sharing_procs > 1) {
108 addItemsToCommMap(proc, 1, &ids[i], procs_to_owned_ids_and_sharing_procs,
false);
109 addItemsToCommMap(proc, 1, &num_sharing_procs, procs_to_owned_ids_and_sharing_procs,
false);
110 addItemsToCommMap(proc, num_sharing_procs, &sharing_procs[0], procs_to_owned_ids_and_sharing_procs,
false);
116 fei::exchangeCommMapData<int>(comm, procs_to_owned_ids_and_sharing_procs,
117 procs_to_shared_ids_and_sharing_procs);
void addItemsToCommMap(int proc, size_t numItems, const T *items, typename CommMap< T >::Type &comm_map, bool keep_sorted_and_unique=true)
std::vector< int > & getOwningProcs()
void copy_remotelyowned_ids_into_CommMap(int myProc, const fei::LinearDecomposition< int > &lindecomp, const snl_fei::RecordCollection &records, fei::CommMap< int >::Type &procs_to_shared_ids)
map_type & getSharedIDs()
void set_shared_ids(MPI_Comm comm, const snl_fei::RecordCollection &records, fei::SharedIDs< int > &sharedIDs, int lowest_global_id, int highest_global_id)
int which_proc(GlobalIDType id) const
size_t getNumRecords() const
void copy_into_shared_ids(const fei::CommMap< int >::Type &procs_to_ids_and_sharing_procs, const snl_fei::RecordCollection &records, fei::SharedIDs< int > &sharedIDs)
std::map< int, std::vector< T > > Type
fei::Record< int > * getRecordWithLocalID(int lid)
void addSharedID(const T &ID, size_t numSharingProcs, const int *sharingProcs)
int localProc(MPI_Comm comm)
fei::Record< int > * getRecordWithID(int ID)
int numProcs(MPI_Comm comm)