19#ifndef TIMPI_SERIAL_IMPLEMENTATION_H
20#define TIMPI_SERIAL_IMPLEMENTATION_H
45#define TIMPI_LOG_SCOPE(f,c)
67 const MessageTag &)
const
74 const MessageTag &)
const
100template <
typename Context,
typename Iter>
109template <
typename Context,
typename Iter>
119template <
typename Context,
typename Iter>
125 const MessageTag &)
const
128template <
typename Context,
typename OutputIter,
typename T>
135 const MessageTag &)
const
144 const MessageTag &)
const
151 const MessageTag &)
const
169template <
typename Context,
typename OutputIter,
typename T>
185template <
typename T1,
typename T2,
186 typename std::enable_if<std::is_base_of<DataType, StandardType<T1>>::value &&
187 std::is_base_of<DataType, StandardType<T2>>::value,
201template <
typename T1,
typename T2,
typename A1,
typename A2>
204 const std::vector<T1,A1> & send,
207 std::vector<T2,A2> &recv,
217template <
typename T1,
typename T2,
typename A1,
typename A2,
218 typename std::enable_if<std::is_base_of<DataType, StandardType<T1>>::value &&
219 std::is_base_of<DataType, StandardType<T2>>::value,
223 const std::vector<T1,A1> & send,
225 std::vector<T2,A2> &recv,
227 const MessageTag &)
const
234template <
typename T,
typename A,
235 typename std::enable_if<std::is_base_of<DataType, StandardType<T>>::value,
239 const std::vector<T,A> & send,
241 std::vector<T,A> &recv,
250template <
typename T1,
typename T2,
typename A1,
typename A2,
251 typename std::enable_if<Has_buffer_type<Packing<T1>>::value &&
255 const std::vector<T1,A1> & send,
257 std::vector<T2,A2> &recv,
266template <
typename T,
typename A,
267 typename std::enable_if<Has_buffer_type<Packing<T>>::value,
int>::type>
270 const std::vector<T,A> & send,
272 std::vector<T,A> &recv,
274 const MessageTag &)
const
281template <
typename T1,
typename T2,
typename A1,
typename A2,
typename A3,
typename A4>
284 const std::vector<std::vector<T1,A1>,
A2> & send,
286 std::vector<std::vector<T2,A3>,
A4> &recv,
288 const MessageTag &)
const
295template <
typename T,
typename A1,
typename A2>
298 const std::vector<std::vector<T,A1>,
A2> & send,
300 std::vector<std::vector<T,A1>,
A2> &recv,
341 typedef typename std::iterator_traits<RangeIter>::value_type
T1;
347 std::make_unique<OutputIter>(
out_iter);
355 std::vector<buffer_t>
buffer;
372template <
typename T,
typename A,
373 typename std::enable_if<std::is_base_of<DataType, StandardType<T>>::value,
int>::type>
384template <
typename T,
typename A,
385 typename std::enable_if<Has_buffer_type<Packing<T>>::value,
int>::type>
388 const NotADataType &,
390 const MessageTag &)
const
396template <
typename T,
typename A1,
typename A2>
399 std::vector<std::vector<T,A1>,
A2> &,
402 const MessageTag &)
const
408template <
typename T,
typename A>
410 std::vector<std::basic_string<T>,
A> & recv,
void nonblocking_receive_packed_range(const unsigned int src_processor_id, Context *context, OutputIter out, const T *output_type, Request &req, Status &stat, const MessageTag &tag=any_tag) const
Non-Blocking-receive range-of-pointers from one processor.
processor_id_type size() const
void receive_packed_range(const unsigned int dest_processor_id, Context *context, OutputIter out, const T *output_type, const MessageTag &tag=any_tag) const
Blocking-receive range-of-pointers from one processor.
void nonblocking_send_packed_range(const unsigned int dest_processor_id, const Context *context, Iter range_begin, const Iter range_end, Request &req, const MessageTag &tag=no_tag) const
Similar to the above Nonblocking send_packed_range with a few important differences:
Status receive(const unsigned int dest_processor_id, T &buf, const MessageTag &tag=any_tag) const
Blocking-receive from one processor with data-defined type.
void send_receive(const unsigned int dest_processor_id, const T1 &send_data, const unsigned int source_processor_id, T2 &recv_data, const MessageTag &send_tag=no_tag, const MessageTag &recv_tag=any_tag) const
Send data send to one processor while simultaneously receiving other data recv from a (potentially di...
bool possibly_receive(unsigned int &src_processor_id, std::vector< T, A > &buf, Request &req, const MessageTag &tag) const
Nonblocking-receive from one processor with user-defined type.
void send_packed_range(const unsigned int dest_processor_id, const Context *context, Iter range_begin, const Iter range_end, const MessageTag &tag=no_tag, std::size_t approx_buffer_size=1000000) const
Blocking-send range-of-pointers to one processor.
void send_receive_packed_range(const unsigned int dest_processor_id, const Context1 *context1, RangeIter send_begin, const RangeIter send_end, const unsigned int source_processor_id, Context2 *context2, OutputIter out, const T *output_type, const MessageTag &send_tag=no_tag, const MessageTag &recv_tag=any_tag, std::size_t approx_buffer_size=1000000) const
Send a range-of-pointers to one processor while simultaneously receiving another range from a (potent...
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
Take a vector of length this->size(), and fill in recv[processor_id] = the value of send on that proc...
void send(const unsigned int dest_processor_id, const T &buf, const MessageTag &tag=no_tag) const
Blocking-send to one processor with data-defined type.
Encapsulates the MPI_Datatype.
Encapsulates the MPI tag integers.
StandardType<T>'s which do not define a way to MPI_Type T should inherit from this class.
Encapsulates the MPI_Request.
Encapsulates the MPI_Status struct.
Define data types and (un)serialization functions for use when encoding a potentially-variable-size o...
Iter pack_range(const Context *context, Iter range_begin, const Iter range_end, std::vector< buffertype > &buffer, std::size_t approx_buffer_size)
Helper function for range packing.
Tnew cast_int(Told oldvar)
OutputIter unpack_range(const std::vector< buffertype > &buffer, Context *context, OutputIter out_iter, const T *)
Helper function for range unpacking.