33 #ifndef GLOBAL_LAYOUT_H_
34 #define GLOBAL_LAYOUT_H_
56 template<
typename TGlobalToLocal>
60 for(GlobalLayout::iterator it = globalLayout.begin(); it != globalLayout.end(); ++it)
63 std::vector<AlgebraID> &v = it->second;
64 if(v.size() == 0)
continue;
65 sort(v.begin(), v.end());
72 for(
size_t i=1; i<v.size(); i++)
74 interface.push_back(globalToLocal[v[i]]);
78 for(
size_t i=0; i<v.size(); i++)
79 interface.push_back(globalToLocal[v[i]]);
84 template<
typename TGlobalToLocal>
92 template<
typename TLocalToGlobal>
94 const IndexLayout &layout,
const TLocalToGlobal &localToGlobal)
100 int pid = layout.
proc_id(iter);
102 std::vector<AlgebraID> &v = globalLayout[pid];
105 size_t localIndex = interface.get_element(iter2);
106 v.push_back(localToGlobal[localIndex]);
location name
Definition: checkpoint_util.lua:128
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
You may add elements to this interface and iterate over them.
Definition: pcl_communication_structs.h:207
iterator push_back(const Element &elem)
Definition: pcl_communication_structs.h:245
iterator end(size_t level=0)
returns the iterator to the last interface of the layout.
Definition: pcl_communication_structs.h:492
iterator begin(size_t level=0)
returns the iterator to the first interface of the layout.
Definition: pcl_communication_structs.h:486
int proc_id(iterator iter) const
returns the target process of the interface given in iterator
Definition: pcl_communication_structs.h:509
InterfaceMap::const_iterator const_iterator
Definition: pcl_communication_structs.h:477
void clear()
clears the layout
Definition: pcl_communication_structs.h:522
function table merge(t1, t2)
void CreateGlobalLayout(GlobalLayout &globalLayout, const IndexLayout &layout, const TLocalToGlobal &localToGlobal)
Definition: global_layout.h:93
void AddLayoutFromGlobalLayout(IndexLayout &layout, GlobalLayout &globalLayout, TGlobalToLocal &globalToLocal, bool bRemoveDoubles=true)
Definition: global_layout.h:57
void SendGlobalLayout(pcl::InterfaceCommunicator< IndexLayout > &comm, const GlobalLayout &globalMasterLayout, const GlobalLayout &globalSlaveLayout, int pid)
Definition: global_layout.cpp:118
void PrintGlobalLayout(const GlobalLayout &globalLayout, const char *name)
Definition: global_layout.cpp:62
std::map< int, std::vector< AlgebraID > > GlobalLayout
Definition: global_layout.h:47
void CreateLayoutFromGlobalLayout(IndexLayout &layout, GlobalLayout &globalLayout, TGlobalToLocal &globalToLocal, bool bRemoveDoubles=true)
Definition: global_layout.h:85
void ReceiveGlobalLayout(pcl::InterfaceCommunicator< IndexLayout > &comm, const std::vector< int > &srcprocs, GlobalLayout &globalMasterLayout, GlobalLayout &globalSlaveLayout)
Definition: global_layout.cpp:81
void MergeGlobalLayout(GlobalLayout &globalLayout, const std::map< int, int > &merge)
Definition: global_layout.cpp:135
#define PROFILE_FUNC()
Definition: profiler.h:257