33 #ifndef SERIALIZATION_H_
34 #define SERIALIZATION_H_
38 template<
class TOStream>
43 Serialize(buf, interface.get_element(iter));
46 template<
class TIStream>
49 size_t s = Deserialize<size_t> (buf);
51 for(
size_t i=0; i<
s; i++)
54 interface.push_back(el);
59 template<
class TOStream>
71 template<
class TIStream>
74 size_t num_interfaces = Deserialize<size_t>(buf);
75 for(
size_t i=0; i<num_interfaces; i++)
77 int pid = Deserialize<int>(buf);
88 t.set_master_layout(masterLayout);
89 t.set_slave_layout(slaveLayout);
91 t.set_communicator(ic);
92 t.set_process_communicator(pc);
95 template<
typename T,
class TOStream>
103 Serialize(buf, t.layouts()->proc_comm());
106 template<
typename T,
class TIStream>
121 template<
typename T,
class TOStream>
127 template<
typename T,
class TIStream>
146 template<
typename TValueType,
class TOStream>
152 template<
typename TValueType,
class TIStream>
171 template<
class TOStream>
177 template<
class TIStream>
183 template<
class TOStream>
195 for(
int i=0; i<
s; i++)
201 template<
class TIStream>
204 int s = Deserialize<int>(buf);
213 if(ic.
empty())
return;
218 std::vector<int> procs;
219 for(
int i=0; i<
s; i++)
220 procs.push_back(Deserialize<int>(buf));
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
Definition: pcl_process_communicator.h:70
static ProcessCommunicator create_communicator(std::vector< int > &newGlobalProcs)
Definition: pcl_process_communicator.cpp:234
int get_proc_id(size_t index) const
returns the i-th process in the communicator
Definition: pcl_process_communicator.cpp:86
bool empty() const
returns true if the communicator is empty, false if not.
Definition: pcl_process_communicator.h:77
bool is_world() const
return true if the communicator is PCD_WORLD
Definition: pcl_process_communicator.h:80
size_t size() const
returns the size of the communicator
Definition: pcl_process_communicator.cpp:71
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
size_t num_interfaces(size_t level=0) const
returns the number of interfaces in the layout
Definition: pcl_communication_structs.h:567
int proc_id(iterator iter) const
returns the target process of the interface given in iterator
Definition: pcl_communication_structs.h:509
Interface & interface(iterator iter)
returns the interface to the given iterator.
Definition: pcl_communication_structs.h:505
InterfaceMap::const_iterator const_iterator
Definition: pcl_communication_structs.h:477
Interface::Element Element
Element type.
Definition: pcl_communication_structs.h:473
TInterface Interface
Interface type.
Definition: pcl_communication_structs.h:467
Wrapper for sequential matrices to handle them in parallel.
Definition: parallel_matrix.h:65
void set_storage_type(uint type)
sets the storage type
Definition: parallel_matrix.h:101
uint get_storage_mask() const
returns storage type mask
Definition: parallel_matrix.h:120
Definition: parallel_vector.h:60
uint get_storage_mask() const
returns storage type mask
Definition: parallel_vector.h:123
void set_storage_type(uint type)
sets the storage type
Definition: parallel_vector.h:104
@ PCD_EMPTY
Definition: pcl_process_communicator.h:54
@ PCD_WORLD
Definition: pcl_process_communicator.h:55
void DeserializeUniquePart(TIStream &buf, ParallelMatrix< T > &A)
Definition: serialization.h:128
void SerializeUniquePart(TOStream &buf, const ParallelMatrix< T > &A)
Definition: serialization.h:122
void DeserializeParallelData(TIStream &buf, T &t, IndexLayout &masterLayout, IndexLayout &slaveLayout, pcl::InterfaceCommunicator< IndexLayout > &ic, pcl::ProcessCommunicator &pc)
Definition: serialization.h:107
void Deserialize(TIStream &buf, ParallelVector< T > &v)
Deerialize for ParallelVector<T>
Definition: restart_bridge.cpp:112
void SerializeParallelData(TOStream &buf, T &t)
Definition: serialization.h:96
void Serialize(TOStream &buf, const ParallelVector< T > &v)
Serialize for ParallelVector<T>
Definition: restart_bridge.cpp:103
void SetParallelData(T &t, IndexLayout &masterLayout, IndexLayout &slaveLayout, pcl::InterfaceCommunicator< IndexLayout > &ic, pcl::ProcessCommunicator &pc)
Definition: serialization.h:83