19 #ifndef LIBMESH_COMMUNICATOR_H 20 #define LIBMESH_COMMUNICATOR_H 59 #ifdef LIBMESH_HAVE_MPI 71 static_cast<unsigned int>(MPI_ANY_SOURCE);
82 #endif // LIBMESH_HAVE_MPI 221 template <
typename T>
222 bool verify(
const T & r)
const;
229 template <
typename T>
236 template <
typename T>
237 void min(T & r)
const;
244 template <
typename T>
246 unsigned int & min_id)
const;
253 template <
typename T,
typename A1,
typename A2>
254 void minloc(std::vector<T,A1> & r,
255 std::vector<unsigned int,A2> & min_id)
const;
261 template <
typename T>
262 void max(T & r)
const;
269 template <
typename T>
271 unsigned int & max_id)
const;
278 template <
typename T,
typename A1,
typename A2>
279 void maxloc(std::vector<T,A1> & r,
280 std::vector<unsigned int,A2> & max_id)
const;
286 template <
typename T>
287 void sum(T & r)
const;
294 template <
typename T>
301 template <
typename T>
323 template <
typename T>
331 template <
typename T>
332 void send (
const unsigned int dest_processor_id,
339 template <
typename T>
340 void send (
const unsigned int dest_processor_id,
352 template <
typename T>
353 void send (
const unsigned int dest_processor_id,
365 template <
typename T>
366 void send (
const unsigned int dest_processor_id,
375 template <
typename T>
383 template <
typename T>
384 void receive (
const unsigned int dest_processor_id,
396 template <
typename T>
409 template <
typename T>
410 void receive (
const unsigned int dest_processor_id,
429 template <
typename Context,
typename Iter>
431 const Context * context,
433 const Iter range_end,
449 template <
typename Context,
typename Iter>
451 const Context * context,
453 const Iter range_end,
465 template <
typename Context,
typename Iter>
467 const Context * context,
469 const Iter range_end,
482 template <
typename Context,
typename Iter>
484 const Context * context,
486 const Iter range_end,
488 std::shared_ptr<std::vector<
typename Parallel::Packing<
typename std::iterator_traits<Iter>::value_type>::buffer_type>> & buffer,
517 template <
typename Context,
typename OutputIter,
typename T>
521 const T * output_type,
536 template <
typename Context,
typename OutputIter,
typename T>
540 const T * output_type,
557 template <
typename Context,
typename OutputIter,
typename T>
561 const T * output_type,
572 template <
typename T1,
typename T2>
575 const unsigned int source_processor_id,
616 template <
typename Context1,
typename RangeIter,
typename Context2,
617 typename OutputIter,
typename T>
619 const Context1 * context1,
620 RangeIter send_begin,
621 const RangeIter send_end,
622 const unsigned int source_processor_id,
625 const T * output_type,
634 template <
typename T1,
typename T2>
638 const unsigned int source_processor_id,
648 template <
typename T,
typename A>
649 inline void gather(
const unsigned int root_id,
651 std::vector<T,A> & recv)
const;
658 template <
typename T,
typename A>
659 inline void gather(
const unsigned int root_id,
660 const std::basic_string<T> &
send,
661 std::vector<std::basic_string<T>,
A> & recv,
662 const bool identical_buffer_sizes=
false)
const;
686 template <
typename T,
typename A>
687 inline void gather(
const unsigned int root_id,
688 std::vector<T,A> & r)
const;
694 template <
typename T,
typename A>
696 std::vector<T,A> & recv)
const;
703 template <
typename T,
typename A>
705 std::vector<std::basic_string<T>,
A> & recv,
706 const bool identical_buffer_sizes=
false)
const;
732 template <
typename T,
typename A>
733 inline void allgather(std::vector<T,A> & r,
734 const bool identical_buffer_sizes =
false)
const;
739 template <
typename T,
typename A>
740 inline void allgather(std::vector<std::basic_string<T>,
A> & r,
741 const bool identical_buffer_sizes =
false)
const;
748 template <
typename T,
typename A>
751 const unsigned int root_id=0)
const;
759 template <
typename T,
typename A>
761 std::vector<T,A> & recv,
762 const unsigned int root_id=0)
const;
770 template <
typename T,
typename A1,
typename A2>
771 inline void scatter(
const std::vector<T,A1> &
data,
772 const std::vector<int,A2> counts,
773 std::vector<T,A1> & recv,
774 const unsigned int root_id=0)
const;
781 template <
typename T,
typename A1,
typename A2>
782 inline void scatter(
const std::vector<std::vector<T,A1>,A2> &
data,
783 std::vector<T,A1> & recv,
784 const unsigned int root_id=0,
785 const bool identical_buffer_sizes=
false)
const;
792 template <
typename Context,
typename Iter,
typename OutputIter>
796 const Iter range_end,
797 OutputIter
out)
const;
803 template <
typename Context,
typename Iter,
typename OutputIter>
806 const Iter range_end,
807 OutputIter
out)
const;
814 template <
typename T,
typename A>
815 inline void alltoall(std::vector<T,A> & r)
const;
825 template <
typename T>
826 inline void broadcast(T &
data,
const unsigned int root_id=0)
const;
845 template <
typename Context,
typename OutputContext,
typename Iter,
typename OutputIter>
848 const Iter range_end,
849 OutputContext * context2,
851 const unsigned int root_id = 0)
const;
860 #include "libmesh/parallel_communicator_specializations" 869 #endif // LIBMESH_COMMUNICATOR_H
void set_union(T &data, const unsigned int root_id) const
void send(const unsigned int dest_processor_id, const T &buf, const MessageTag &tag=no_tag) const
void send_receive(const unsigned int dest_processor_id, const T1 &send, const unsigned int source_processor_id, T2 &recv, const MessageTag &send_tag=no_tag, const MessageTag &recv_tag=any_tag) const
void maxloc(T &r, unsigned int &max_id) const
const unsigned int any_source
processor_id_type size() const
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) const
void allgather(const T &send, std::vector< T, A > &recv) const
uint8_t processor_id_type
void receive_packed_range(const unsigned int dest_processor_id, Context *context, OutputIter out, const T *output_type, const MessageTag &tag=any_tag) const
void gather(const unsigned int root_id, const T &send, std::vector< T, A > &recv) const
void alltoall(std::vector< T, A > &r) const
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
MessageTag get_unique_tag(int tagvalue) const
void send_mode(const SendMode sm)
bool semiverify(const T *r) const
void minloc(T &r, unsigned int &min_id) const
processor_id_type rank() const
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) const
void assign(const communicator &comm)
void scatter(const std::vector< T, A > &data, T &recv, const unsigned int root_id=0) const
void duplicate(const Communicator &comm)
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
status probe(const unsigned int src_processor_id, const MessageTag &tag=any_tag) const
void allgather_packed_range(Context *context, Iter range_begin, const Iter range_end, OutputIter out) const
Communicator & operator=(const Communicator &)=delete
Status packed_range_probe(const unsigned int src_processor_id, const MessageTag &tag, bool &flag) const
void dereference_unique_tag(int tagvalue) const
static PetscErrorCode Mat * A
communicator _communicator
Status receive(const unsigned int dest_processor_id, T &buf, const MessageTag &tag=any_tag) const
std::map< int, unsigned int > used_tag_values
OStreamProxy out(std::cout)
void reference_unique_tag(int tagvalue) const
void gather_packed_range(const unsigned int root_id, Context *context, Iter range_begin, const Iter range_end, OutputIter out) const
void broadcast(T &data, const unsigned int root_id=0) const
void split(int color, int key, Communicator &target) const
void broadcast_packed_range(const Context *context1, Iter range_begin, const Iter range_end, OutputContext *context2, OutputIter out, const unsigned int root_id=0) const
SendMode send_mode() const
bool verify(const T &r) const