#include <communicator.h>
Public Types | |
enum | SendMode { DEFAULT =0, SYNCHRONOUS } |
Public Member Functions | |
Communicator () | |
Communicator (const communicator &comm) | |
Communicator (const Communicator &)=delete | |
Communicator & | operator= (const Communicator &)=delete |
Communicator (Communicator &&)=default | |
Communicator & | operator= (Communicator &&)=default |
~Communicator () | |
void | split (int color, int key, Communicator &target) const |
void | duplicate (const Communicator &comm) |
void | duplicate (const communicator &comm) |
communicator & | get () |
const communicator & | get () const |
MessageTag | get_unique_tag (int tagvalue) const |
void | reference_unique_tag (int tagvalue) const |
void | dereference_unique_tag (int tagvalue) const |
void | clear () |
Communicator & | operator= (const communicator &comm) |
processor_id_type | rank () const |
processor_id_type | size () const |
void | send_mode (const SendMode sm) |
SendMode | send_mode () const |
void | barrier () const |
template<typename T > | |
bool | verify (const T &r) const |
template<typename T > | |
bool | semiverify (const T *r) const |
template<typename T > | |
void | min (T &r) const |
template<typename T > | |
void | minloc (T &r, unsigned int &min_id) const |
template<typename T , typename A1 , typename A2 > | |
void | minloc (std::vector< T, A1 > &r, std::vector< unsigned int, A2 > &min_id) const |
template<typename T > | |
void | max (T &r) const |
template<typename T > | |
void | maxloc (T &r, unsigned int &max_id) const |
template<typename T , typename A1 , typename A2 > | |
void | maxloc (std::vector< T, A1 > &r, std::vector< unsigned int, A2 > &max_id) const |
template<typename T > | |
void | sum (T &r) const |
template<typename T > | |
void | set_union (T &data, const unsigned int root_id) const |
template<typename T > | |
void | set_union (T &data) const |
status | probe (const unsigned int src_processor_id, const MessageTag &tag=any_tag) const |
template<typename T > | |
Status | packed_range_probe (const unsigned int src_processor_id, const MessageTag &tag, bool &flag) const |
template<typename T > | |
void | send (const unsigned int dest_processor_id, const T &buf, const MessageTag &tag=no_tag) const |
template<typename T > | |
void | send (const unsigned int dest_processor_id, const T &buf, Request &req, const MessageTag &tag=no_tag) const |
template<typename T > | |
void | send (const unsigned int dest_processor_id, const T &buf, const DataType &type, const MessageTag &tag=no_tag) const |
template<typename T > | |
void | send (const unsigned int dest_processor_id, const T &buf, const DataType &type, Request &req, const MessageTag &tag=no_tag) const |
template<typename T > | |
Status | receive (const unsigned int dest_processor_id, T &buf, const MessageTag &tag=any_tag) const |
template<typename T > | |
void | receive (const unsigned int dest_processor_id, T &buf, Request &req, const MessageTag &tag=any_tag) const |
template<typename T > | |
Status | receive (const unsigned int dest_processor_id, T &buf, const DataType &type, const MessageTag &tag=any_tag) const |
template<typename T > | |
void | receive (const unsigned int dest_processor_id, T &buf, const DataType &type, Request &req, const MessageTag &tag=any_tag) const |
template<typename Context , typename Iter > | |
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 |
template<typename Context , typename Iter > | |
void | 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 |
template<typename Context , typename Iter > | |
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 |
template<typename Context , typename Iter > | |
void | nonblocking_send_packed_range (const unsigned int dest_processor_id, const Context *context, Iter range_begin, const Iter range_end, Request &req, std::shared_ptr< std::vector< typename Parallel::Packing< typename std::iterator_traits< Iter >::value_type >::buffer_type >> &buffer, const MessageTag &tag=no_tag) const |
template<typename Context , typename OutputIter , typename T > | |
void | receive_packed_range (const unsigned int dest_processor_id, Context *context, OutputIter out, const T *output_type, const MessageTag &tag=any_tag) const |
template<typename Context , typename OutputIter , typename T > | |
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 |
template<typename Context , typename OutputIter , typename T > | |
void | nonblocking_receive_packed_range (const unsigned int src_processor_id, Context *context, OutputIter out, const T *output_type, Request &req, Status &stat, std::shared_ptr< std::vector< typename Parallel::Packing< T >::buffer_type >> &buffer, const MessageTag &tag=any_tag) const |
template<typename T1 , typename T2 > | |
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 |
template<typename Context1 , typename RangeIter , typename Context2 , typename OutputIter , typename T > | |
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 |
template<typename T1 , typename T2 > | |
void | send_receive (const unsigned int dest_processor_id, const T1 &send, const DataType &type1, const unsigned int source_processor_id, T2 &recv, const DataType &type2, const MessageTag &send_tag=no_tag, const MessageTag &recv_tag=any_tag) const |
template<typename T , typename A > | |
void | gather (const unsigned int root_id, const T &send, std::vector< T, A > &recv) const |
template<typename T , typename A > | |
void | gather (const unsigned int root_id, const std::basic_string< T > &send, std::vector< std::basic_string< T >, A > &recv, const bool identical_buffer_sizes=false) const |
template<typename T , typename A > | |
void | gather (const unsigned int root_id, std::vector< T, A > &r) const |
template<typename T , typename A > | |
void | allgather (const T &send, std::vector< T, A > &recv) const |
template<typename T , typename A > | |
void | allgather (const std::basic_string< T > &send, std::vector< std::basic_string< T >, A > &recv, const bool identical_buffer_sizes=false) const |
template<typename T , typename A > | |
void | allgather (std::vector< T, A > &r, const bool identical_buffer_sizes=false) const |
template<typename T , typename A > | |
void | allgather (std::vector< std::basic_string< T >, A > &r, const bool identical_buffer_sizes=false) const |
template<typename T , typename A > | |
void | scatter (const std::vector< T, A > &data, T &recv, const unsigned int root_id=0) const |
template<typename T , typename A > | |
void | scatter (const std::vector< T, A > &data, std::vector< T, A > &recv, const unsigned int root_id=0) const |
template<typename T , typename A1 , typename A2 > | |
void | scatter (const std::vector< T, A1 > &data, const std::vector< int, A2 > counts, std::vector< T, A1 > &recv, const unsigned int root_id=0) const |
template<typename T , typename A1 , typename A2 > | |
void | scatter (const std::vector< std::vector< T, A1 >, A2 > &data, std::vector< T, A1 > &recv, const unsigned int root_id=0, const bool identical_buffer_sizes=false) const |
template<typename Context , typename Iter , typename OutputIter > | |
void | gather_packed_range (const unsigned int root_id, Context *context, Iter range_begin, const Iter range_end, OutputIter out) const |
template<typename Context , typename Iter , typename OutputIter > | |
void | allgather_packed_range (Context *context, Iter range_begin, const Iter range_end, OutputIter out) const |
template<typename T , typename A > | |
void | alltoall (std::vector< T, A > &r) const |
template<typename T > | |
void | broadcast (T &data, const unsigned int root_id=0) const |
template<typename Context , typename OutputContext , typename Iter , typename OutputIter > | |
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 |
template<typename T > | |
void | send (const unsigned int dest_processor_id, const std::basic_string< T > &buf, const MessageTag &tag) const |
template<typename T > | |
void | send (const unsigned int dest_processor_id, const std::basic_string< T > &buf, Request &req, const MessageTag &tag) const |
template<typename T > | |
Status | receive (const unsigned int src_processor_id, std::basic_string< T > &buf, const MessageTag &tag) const |
template<typename T > | |
void | receive (const unsigned int src_processor_id, std::basic_string< T > &buf, Request &req, const MessageTag &tag) const |
template<typename T , typename A > | |
void | send_receive (const unsigned int dest_processor_id, const std::vector< T, A > &sendvec, const unsigned int source_processor_id, std::vector< T, A > &recv, const MessageTag &send_tag, const MessageTag &recv_tag) const |
template<> | |
void | broadcast (bool &data, const unsigned int root_id) const |
template<typename T > | |
void | broadcast (std::basic_string< T > &data, const unsigned int root_id) const |
template<typename Context1 , typename RangeIter , typename Context2 , typename OutputIter , typename T > | |
void | send_receive_packed_range (const unsigned int libmesh_dbg_var(dest_processor_id), const Context1 *context1, RangeIter send_begin, const RangeIter send_end, const unsigned int libmesh_dbg_var(source_processor_id), Context2 *context2, OutputIter out_iter, const T *output_type, const MessageTag &, const MessageTag &) const |
template<typename T > | |
void | min (T &libmesh_mpi_var(r)) const |
template<typename A > | |
void | min (std::vector< bool, A > &r) const |
template<typename A1 , typename A2 > | |
void | minloc (std::vector< bool, A1 > &r, std::vector< unsigned int, A2 > &min_id) const |
template<typename T > | |
void | max (T &libmesh_mpi_var(r)) const |
template<typename A > | |
void | max (std::vector< bool, A > &r) const |
template<typename A1 , typename A2 > | |
void | maxloc (std::vector< bool, A1 > &r, std::vector< unsigned int, A2 > &max_id) const |
template<typename T > | |
void | sum (T &libmesh_mpi_var(r)) const |
template<typename T > | |
void | sum (std::complex< T > &libmesh_mpi_var(r)) const |
template<typename T > | |
void | broadcast (T &libmesh_mpi_var(data), const unsigned int root_id) const |
Private Member Functions | |
void | assign (const communicator &comm) |
Private Attributes | |
communicator | _communicator |
processor_id_type | _rank |
processor_id_type | _size |
SendMode | _send_mode |
std::map< int, unsigned int > | used_tag_values |
bool | _I_duped_it |
Encapsulates the MPI_Comm object. Allows the size of the group and this process's position in the group to be determined.
Methods of this object are the preferred way to perform distributed-memory parallel operations.
Definition at line 92 of file communicator.h.
Whether to use default or synchronous sends?
Enumerator | |
---|---|
DEFAULT | |
SYNCHRONOUS |
Definition at line 180 of file communicator.h.
libMesh::Parallel::Communicator::Communicator | ( | ) |
Default Constructor.
Definition at line 57 of file communicator.C.
|
explicit |
Definition at line 68 of file communicator.C.
References assign().
|
delete |
|
default |
libMesh::Parallel::Communicator::~Communicator | ( | ) |
|
inline |
Take a vector of length this->size()
, and fill in recv
[processor_id] = the value of send
on that processor
Definition at line 2746 of file parallel_implementation.h.
References size().
Referenced by allgather(), libMesh::LaplaceMeshSmoother::allgather_graph(), allgather_packed_range(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::DofMap::distribute_dofs(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), gather(), libMesh::Nemesis_IO::read(), and libMesh::DistributedMesh::renumber_dof_objects().
|
inline |
The allgather overload for string types has an optional identical_buffer_sizes optimization for when all strings are the same length.
Definition at line 1374 of file parallel_implementation.h.
References allgather(), and size().
|
inline |
Take a vector of local variables and expand it to include values from all processors. By default, each processor is allowed to have its own unique input buffer length. If it is known that all processors have the same input sizes additional communication can be avoided.
Specifically, this function transforms this:
* Processor 0: [ ... N_0 ] * Processor 1: [ ....... N_1 ] * ... * Processor M: [ .. N_M] *
into this:
* [ [ ... N_0 ] [ ....... N_1 ] ... [ .. N_M] ] *
on each processor. This function is collective and therefore must be called by all processors in the Communicator.
Definition at line 2770 of file parallel_implementation.h.
References allgather(), size(), and verify().
|
inline |
AllGather overload for vectors of string types
Definition at line 2834 of file parallel_implementation.h.
References allgather(), end, size(), and verify().
|
inline |
Take a range of local variables, combine it with ranges from all processors, and write the output to the output iterator.
Definition at line 3176 of file parallel_implementation.h.
References allgather(), max(), libMesh::Parallel::pack_range(), and libMesh::Parallel::unpack_range().
|
inline |
Effectively transposes the input vector across all processors. The jth entry on processor i is replaced with the ith entry from processor j.
Definition at line 3092 of file parallel_implementation.h.
References libMesh::libmesh_ignore(), size(), and verify().
Referenced by libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Parallel::push_parallel_vector_data(), and libMesh::Nemesis_IO::read().
|
private |
Utility function for setting our member variables from an MPI communicator
Definition at line 155 of file communicator.C.
References _communicator, _rank, _send_mode, _size, and DEFAULT.
Referenced by Communicator(), duplicate(), operator=(), and split().
void libMesh::Parallel::Communicator::barrier | ( | ) | const |
Pause execution until all processors reach a certain point.
Definition at line 188 of file communicator.C.
References size().
Referenced by libMesh::NameBasedIO::write(), and libMesh::XdrIO::write().
|
inline |
Take a local value and broadcast it to all processors. Optionally takes the root_id
processor, which specifies the processor initiating the broadcast. If data
is a vector, the user is responsible for resizing it on all processors, except in the case when data
is a vector of strings.
Referenced by libMesh::EquationSystems::_read_impl(), broadcast(), broadcast_packed_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::System::read_legacy_data(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), scatter(), libMesh::CheckpointIO::select_split_config(), libMesh::NameBasedIO::write(), and libMesh::System::write_serialized_blocked_dof_objects().
|
inline |
|
inline |
Definition at line 1461 of file parallel_implementation.h.
References broadcast(), data, rank(), and size().
|
inline |
Definition at line 3120 of file parallel_implementation.h.
References data, libMesh::libmesh_ignore(), rank(), and size().
|
inline |
Blocking-broadcast range-of-pointers to one processor. This function does not send the raw pointers, but rather constructs new objects at the other end whose contents match the objects pointed to by the sender.
void Parallel::pack(const T *, vector<int> & data, const Context *) is used to serialize type T onto the end of a data vector.
unsigned int Parallel::packable_size(const T *, const Context *) is used to allow data vectors to reserve memory, and for additional error checking
unsigned int Parallel::packed_size(const T *, vector<int>::const_iterator) is used to advance to the beginning of the next object's data.
Definition at line 1672 of file parallel_implementation.h.
References broadcast(), libMesh::Parallel::pack_range(), rank(), and libMesh::Parallel::unpack_range().
void libMesh::Parallel::Communicator::clear | ( | ) |
Free and reset this communicator
Definition at line 132 of file communicator.C.
References _communicator, and _I_duped_it.
Referenced by operator=(), split(), and ~Communicator().
void libMesh::Parallel::Communicator::dereference_unique_tag | ( | int | tagvalue | ) | const |
Dereference an already-acquired tag, and see if we can re-release it.
Definition at line 44 of file communicator.C.
References used_tag_values.
Referenced by libMesh::Parallel::MessageTag::operator=(), and libMesh::Parallel::MessageTag::~MessageTag().
void libMesh::Parallel::Communicator::duplicate | ( | const Communicator & | comm | ) |
Definition at line 108 of file communicator.C.
References _communicator, and send_mode().
void libMesh::Parallel::Communicator::duplicate | ( | const communicator & | comm | ) |
Definition at line 116 of file communicator.C.
References _communicator, _I_duped_it, and assign().
|
inline |
Take a vector of length comm.size(), and on processor root_id fill in recv[processor_id] = the value of send on processor processor_id
Definition at line 2606 of file parallel_implementation.h.
References rank(), and size().
Referenced by gather(), gather_packed_range(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().
|
inline |
The gather overload for string types has an optional identical_buffer_sizes optimization for when all strings are the same length.
Definition at line 2686 of file parallel_implementation.h.
References gather(), rank(), and size().
|
inline |
Take a vector of local variables and expand it on processor root_id to include values from all processors
This handles the case where the lengths of the vectors may vary. Specifically, this function transforms this:
* Processor 0: [ ... N_0 ] * Processor 1: [ ....... N_1 ] * ... * Processor M: [ .. N_M] *
into this:
* [ [ ... N_0 ] [ ....... N_1 ] ... [ .. N_M] ] *
on processor root_id. This function is collective and therefore must be called by all processors in the Communicator.
Definition at line 2633 of file parallel_implementation.h.
References allgather(), rank(), and size().
|
inline |
Take a range of local variables, combine it with ranges from all processors, and write the output to the output iterator on rank root.
Definition at line 3143 of file parallel_implementation.h.
References gather(), max(), libMesh::Parallel::pack_range(), and libMesh::Parallel::unpack_range().
|
inline |
Definition at line 141 of file communicator.h.
References _communicator.
Referenced by libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::PetscDMWrapper::build_section(), libMesh::PetscDMWrapper::build_sf(), libMesh::PetscDMWrapper::check_section_n_dofs(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_residual_helper(), and libMesh::PetscDMWrapper::set_point_range_in_section().
|
inline |
Definition at line 143 of file communicator.h.
References _communicator.
MessageTag libMesh::Parallel::Communicator::get_unique_tag | ( | int | tagvalue | ) | const |
Get a tag that is unique to this Communicator.
Definition at line 201 of file communicator.C.
References used_tag_values.
Referenced by libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Parallel::pull_parallel_vector_data(), libMesh::Parallel::push_parallel_vector_data(), libMesh::Nemesis_IO::read(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::System::write_serialized_blocked_dof_objects(), and libMesh::XdrIO::write_serialized_nodes().
void libMesh::Parallel::Communicator::max | ( | T & | r | ) | const |
Take a local variable and replace it with the maximum of it's values on all processors. Containers are replaced element-wise.
Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::MeshRefinement::_refine_elements(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), allgather_packed_range(), libMesh::DofMap::attach_matrix(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), gather_packed_range(), libMesh::DofMap::get_info(), libMesh::LocationMap< T >::init(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::MeshTools::n_active_levels(), libMesh::MeshTools::n_levels(), libMesh::MeshTools::n_p_levels(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Nemesis_IO::read(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshRefinement::refine_and_coarsen_elements(), semiverify(), libMesh::Parallel::sync_dofobject_data_by_xyz(), libMesh::MeshRefinement::test_level_one(), libMesh::MeshRefinement::test_unflagged(), and verify().
|
inline |
|
inline |
Definition at line 2332 of file parallel_implementation.h.
References size(), and verify().
|
inline |
Take a local variable and replace it with the maximum of it's values on all processors, returning the minimum rank of a processor which originally held the maximum value.
Definition at line 2354 of file parallel_implementation.h.
References libMesh::libmesh_ignore(), libMesh::Parallel::DataPlusInt< T >::rank, rank(), size(), and libMesh::Parallel::DataPlusInt< T >::val.
|
inline |
Take a vector of local variables and replace each entry with the maximum of it's values on all processors. Set each min_id
entry to the minimum rank where a corresponding maximum was found.
Definition at line 2404 of file parallel_implementation.h.
References libMesh::Parallel::DataPlusInt< T >::rank, rank(), size(), libMesh::Parallel::DataPlusInt< T >::val, and verify().
|
inline |
Definition at line 2441 of file parallel_implementation.h.
References libMesh::Parallel::DataPlusInt< T >::rank, rank(), size(), libMesh::Parallel::DataPlusInt< T >::val, and verify().
void libMesh::Parallel::Communicator::min | ( | T & | r | ) | const |
Take a local variable and replace it with the minimum of it's values on all processors. Containers are replaced element-wise.
Referenced by libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::LocationMap< T >::init(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), semiverify(), and verify().
|
inline |
|
inline |
Definition at line 2139 of file parallel_implementation.h.
References size(), and verify().
|
inline |
Take a local variable and replace it with the minimum of it's values on all processors, returning the minimum rank of a processor which originally held the minimum value.
Definition at line 2161 of file parallel_implementation.h.
References libMesh::libmesh_ignore(), libMesh::Parallel::DataPlusInt< T >::rank, rank(), size(), and libMesh::Parallel::DataPlusInt< T >::val.
|
inline |
Take a vector of local variables and replace each entry with the minimum of it's values on all processors. Set each min_id
entry to the minimum rank where a corresponding minimum was found.
Definition at line 2208 of file parallel_implementation.h.
References libMesh::Parallel::DataPlusInt< T >::rank, rank(), size(), libMesh::Parallel::DataPlusInt< T >::val, and verify().
|
inline |
Definition at line 2244 of file parallel_implementation.h.
References libMesh::Parallel::DataPlusInt< T >::rank, rank(), size(), libMesh::Parallel::DataPlusInt< T >::val, and verify().
|
inline |
Non-Blocking-receive range-of-pointers from one processor.
This is meant to receive messages from nonblocking_send_packed_range
Similar in design to the above receive_packed_range. However, this version requires a Request and a Status.
The Status must be a positively tested Status for a message of this type (i.e. a message does exist). It should most likely be generated by Communicator::packed_range_probe.
Definition at line 1117 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), libMesh::out, receive(), and libMesh::Parallel::Status::size().
|
inline |
Non-Blocking-receive range-of-pointers from one processor.
This is meant to receive messages from nonblocking_send_packed_range
Similar in design to the above receive_packed_range. However, this version requires a Request and a Status.
The Status must be a positively tested Status for a message of this type (i.e. a message does exist). It should most likely be generated by Communicator::packed_range_probe.
Definition at line 1715 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), libMesh::out, receive(), and libMesh::Parallel::Status::size().
|
inline |
Similar to the above Nonblocking send_packed_range with a few important differences:
Definition at line 686 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), std::max(), libMesh::Parallel::pack_range(), and send().
|
inline |
Similar to the above Nonblocking send_packed_range with a few important differences:
Definition at line 1329 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), std::max(), libMesh::Parallel::pack_range(), and send().
|
delete |
|
default |
Communicator & libMesh::Parallel::Communicator::operator= | ( | const communicator & | comm | ) |
Definition at line 147 of file communicator.C.
References assign(), and clear().
|
inline |
Non-Blocking message probe for a packed range message. Allows information about a message to be examined before the message is actually received.
Template type must match the object type that will be in the packed range
src_processor_id | The processor the message is expected from or Parallel::any_source |
tag | The message tag or Parallel::any_tag |
flag | Output. True if a message exists. False otherwise. |
Definition at line 188 of file parallel_implementation.h.
References libMesh::Parallel::Status::get(), and libMesh::Parallel::MessageTag::value().
|
inline |
Blocking message probe. Allows information about a message to be examined before the message is actually received.
We do not currently support probes on one processor without MPI.
Definition at line 174 of file parallel_implementation.h.
References libMesh::Parallel::MessageTag::value().
Referenced by libMesh::Parallel::pull_parallel_vector_data(), libMesh::Parallel::push_parallel_vector_data(), and receive().
|
inline |
Definition at line 173 of file communicator.h.
References _rank.
Referenced by broadcast(), broadcast_packed_range(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::ExodusII_IO::copy_elemental_solution(), gather(), maxloc(), minloc(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::ParallelObject::processor_id(), libMesh::Parallel::pull_parallel_vector_data(), libMesh::Parallel::push_parallel_vector_data(), scatter(), send_receive(), libMesh::split_mesh(), libMesh::Parallel::sync_dofobject_data_by_id(), and libMesh::Parallel::sync_dofobject_data_by_xyz().
|
inline |
Blocking-receive from one processor with data-defined type.
We do not currently support receives on one processor without MPI.
Definition at line 771 of file parallel_implementation.h.
References libMesh::Parallel::Status::get(), probe(), and libMesh::Parallel::MessageTag::value().
Referenced by libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::SystemSubsetBySubdomain::init(), libMesh::MeshRefinement::make_coarsening_compatible(), nonblocking_receive_packed_range(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Parallel::pull_parallel_vector_data(), libMesh::Parallel::push_parallel_vector_data(), libMesh::Nemesis_IO::read(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), receive(), receive_packed_range(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().
|
inline |
Nonblocking-receive from one processor with data-defined type.
Definition at line 791 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), libMesh::Parallel::Request::get(), and libMesh::Parallel::MessageTag::value().
|
inline |
Blocking-receive from one processor with user-defined type.
If T
is a container, container-of-containers, etc., then type
should be the DataType of the underlying fixed-size entries in the container(s).
Definition at line 1823 of file parallel_implementation.h.
|
inline |
Nonblocking-receive from one processor with user-defined type.
If T
is a container, container-of-containers, etc., then type
should be the DataType of the underlying fixed-size entries in the container(s).
Definition at line 1830 of file parallel_implementation.h.
|
inline |
Definition at line 727 of file parallel_implementation.h.
References receive().
|
inline |
Definition at line 742 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), and receive().
|
inline |
Blocking-receive range-of-pointers from one processor. This function does not receive raw pointers, but rather constructs new objects whose contents match the objects pointed to by the sender.
The objects will be of type T = iterator_traits<OutputIter>::value_type.
Using std::back_inserter as the output iterator allows receive to fill any container type. Using libMesh::null_output_iterator allows the receive to be dealt with solely by Parallel::unpack(), for objects whose unpack() is written so as to not leak memory when used in this fashion.
A future version of this method should be created to preallocate memory when receiving vectors...
void Parallel::unpack(vector<int>::iterator in, T ** out, Context *) is used to unserialize type T, typically into a new heap-allocated object whose pointer is returned as *out.
unsigned int Parallel::packed_size(const T *, vector<int>::const_iterator) is used to advance to the beginning of the next object's data.
Definition at line 1060 of file parallel_implementation.h.
References receive(), libMesh::Parallel::Status::source(), libMesh::Parallel::Status::tag(), and libMesh::Parallel::unpack_range().
Referenced by send_receive_packed_range().
void libMesh::Parallel::Communicator::reference_unique_tag | ( | int | tagvalue | ) | const |
Reference an already-acquired tag, so that we know it will be dereferenced multiple times before we can re-release it.
Definition at line 35 of file communicator.C.
References used_tag_values.
Referenced by libMesh::Parallel::MessageTag::MessageTag(), and libMesh::Parallel::MessageTag::operator=().
|
inline |
Take a vector of local variables and scatter the ith item to the ith processor in the communicator. The result is saved into recv.
Definition at line 2921 of file parallel_implementation.h.
References data, libMesh::libmesh_ignore(), rank(), and size().
Referenced by scatter().
|
inline |
Take a vector of local variables and scatter the ith equal-sized chunk to the ith processor in the communicator. The data size must be a multiple of the communicator size. The result is saved into recv buffer. The recv buffer does not have to be sized prior to this operation.
Definition at line 2953 of file parallel_implementation.h.
References broadcast(), data, libMesh::libmesh_ignore(), rank(), and size().
|
inline |
Take a vector of local variables and scatter the ith variable-sized chunk to the ith processor in the communicator. The counts vector should contain the number of items for each processor. The result is saved into recv buffer. The recv buffer does not have to be sized prior to this operation.
Definition at line 2991 of file parallel_implementation.h.
References data, libMesh::libmesh_ignore(), rank(), scatter(), and size().
|
inline |
Take a vector of vectors and scatter the ith inner vector to the ith processor in the communicator. The result is saved into recv buffer. The recv buffer does not have to be sized prior to this operation.
Definition at line 3044 of file parallel_implementation.h.
References data, end, rank(), scatter(), and size().
|
inline |
Verify that a local pointer points to the same value on all processors where it is not nullptr. Containers must have the same value in every entry.
Definition at line 1948 of file parallel_implementation.h.
References max(), min(), libMesh::Parallel::Attributes< T >::set_highest(), libMesh::Parallel::Attributes< T >::set_lowest(), and size().
Referenced by libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), and libMesh::MeshTools::libmesh_assert_valid_unique_ids().
|
inline |
Definition at line 213 of file parallel_implementation.h.
References send_mode(), SYNCHRONOUS, and libMesh::Parallel::MessageTag::value().
|
inline |
Definition at line 234 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), libMesh::Parallel::Request::get(), send_mode(), SYNCHRONOUS, and libMesh::Parallel::MessageTag::value().
|
inline |
Blocking-send to one processor with data-defined type.
We do not currently support sends on one processor without MPI.
Definition at line 261 of file parallel_implementation.h.
References send_mode(), SYNCHRONOUS, and libMesh::Parallel::MessageTag::value().
Referenced by libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::SystemSubsetBySubdomain::init(), libMesh::MeshRefinement::make_coarsening_compatible(), nonblocking_send_packed_range(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Parallel::pull_parallel_vector_data(), libMesh::Parallel::push_parallel_vector_data(), libMesh::Nemesis_IO::read(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), send_packed_range(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().
|
inline |
Nonblocking-send to one processor with data-defined type.
Definition at line 282 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), libMesh::Parallel::Request::get(), send_mode(), SYNCHRONOUS, and libMesh::Parallel::MessageTag::value().
|
inline |
Blocking-send to one processor with user-defined type.
If T
is a container, container-of-containers, etc., then type
should be the DataType of the underlying fixed-size entries in the container(s).
Definition at line 1775 of file parallel_implementation.h.
|
inline |
Nonblocking-send to one processor with user-defined type.
If T
is a container, container-of-containers, etc., then type
should be the DataType of the underlying fixed-size entries in the container(s).
Definition at line 1782 of file parallel_implementation.h.
|
inline |
Explicitly sets the SendMode
type used for send operations.
Definition at line 205 of file communicator.h.
References _send_mode.
Referenced by duplicate(), and split().
|
inline |
Gets the user-requested SendMode.
Definition at line 210 of file communicator.h.
References _send_mode.
Referenced by duplicate(), send(), and split().
|
inline |
Blocking-send range-of-pointers to one processor. This function does not send the raw pointers, but rather constructs new objects at the other end whose contents match the objects pointed to by the sender.
void Parallel::pack(const T *, vector<int> & data, const Context *) is used to serialize type T onto the end of a data vector.
unsigned int Parallel::packable_size(const T *, const Context *) is used to allow data vectors to reserve memory, and for additional error checking
Definition at line 562 of file parallel_implementation.h.
References libMesh::Parallel::pack_range(), libMesh::Parallel::packed_range_size(), and send().
Referenced by send_receive_packed_range().
|
inline |
Nonblocking-send range-of-pointers to one processor. This function does not send the raw pointers, but rather constructs new objects at the other end whose contents match the objects pointed to by the sender.
void Parallel::pack(const T *, vector<int> & data, const Context *) is used to serialize type T onto the end of a data vector.
unsigned int Parallel::packable_size(const T *, const Context *) is used to allow data vectors to reserve memory, and for additional error checking
Definition at line 609 of file parallel_implementation.h.
References libMesh::Parallel::Request::add_post_wait_work(), libMesh::Parallel::Request::add_prior_request(), libMesh::Parallel::pack_range(), libMesh::Parallel::packed_range_size(), and send().
|
inline |
Send data send
to one processor while simultaneously receiving other data recv
from a (potentially different) processor.
Send-receive data from one processor.
Definition at line 1178 of file parallel_implementation.h.
References rank(), and libMesh::Parallel::MessageTag::value().
Referenced by send_receive().
void libMesh::Parallel::Communicator::send_receive | ( | const unsigned int | dest_processor_id, |
const T1 & | send, | ||
const DataType & | type1, | ||
const unsigned int | source_processor_id, | ||
T2 & | recv, | ||
const DataType & | type2, | ||
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 different) processor, using a user-specified MPI Dataype.
|
inline |
Definition at line 1214 of file parallel_implementation.h.
References rank(), and send_receive().
|
inline |
Send a range-of-pointers to one processor while simultaneously receiving another range from a (potentially different) processor. This function does not send or receive raw pointers, but rather constructs new objects at each receiver whose contents match the objects pointed to by the sender.
The objects being sent will be of type T1 = iterator_traits<RangeIter>::value_type, and the objects being received will be of type T2 = iterator_traits<OutputIter>::value_type
void Parallel::pack(const T1*, vector<int> & data, const Context1*) is used to serialize type T1 onto the end of a data vector.
Using std::back_inserter as the output iterator allows send_receive to fill any container type. Using libMesh::null_output_iterator allows the receive to be dealt with solely by Parallel::unpack(), for objects whose unpack() is written so as to not leak memory when used in this fashion.
A future version of this method should be created to preallocate memory when receiving vectors...
void Parallel::unpack(vector<int>::iterator in, T2** out, Context *) is used to unserialize type T2, typically into a new heap-allocated object whose pointer is returned as *out.
unsigned int Parallel::packable_size(const T1*, const Context1*) is used to allow data vectors to reserve memory, and for additional error checking.
unsigned int Parallel::packed_size(const T2*, vector<int>::const_iterator) is used to advance to the beginning of the next object's data.
Definition at line 1302 of file parallel_implementation.h.
References receive_packed_range(), send_packed_range(), and libMesh::Parallel::Request::wait().
|
inline |
Send-receive range-of-pointers from one processor.
If you call this without MPI you might be making a mistake, but we'll support it.
Definition at line 1876 of file parallel_implementation.h.
References libMesh::Parallel::pack_range(), and libMesh::Parallel::unpack_range().
void libMesh::Parallel::Communicator::set_union | ( | T & | data, |
const unsigned int | root_id | ||
) | const |
Take a container of local variables on each processor, and collect their union over all processors, replacing the set on processor 0.
Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshBase::cache_elem_dims(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), DMlibMeshSetSystem_libMesh(), libMesh::MeshBase::subdomain_ids(), and libMesh::BoundaryInfo::sync().
void libMesh::Parallel::Communicator::set_union | ( | T & | data | ) | const |
Take a container of local variables on each processor, and replace it with their union over all processors.
|
inline |
Definition at line 175 of file communicator.h.
References _size.
Referenced by allgather(), alltoall(), barrier(), broadcast(), libMesh::EquationSystems::build_parallel_solution_vector(), gather(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), max(), maxloc(), min(), minloc(), libMesh::ParallelObject::n_processors(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Parallel::pull_parallel_vector_data(), libMesh::Parallel::push_parallel_vector_data(), scatter(), semiverify(), libMesh::split_mesh(), sum(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_dofobject_data_by_xyz(), and verify().
void libMesh::Parallel::Communicator::split | ( | int | color, |
int | key, | ||
Communicator & | target | ||
) | const |
Definition at line 89 of file communicator.C.
References _I_duped_it, assign(), clear(), and send_mode().
void libMesh::Parallel::Communicator::sum | ( | T & | r | ) | const |
Take a local variable and replace it with the sum of it's values on all processors. Containers are replaced element-wise.
Referenced by libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::System::calculate_norm(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::DistributedMesh::n_active_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::Nemesis_IO::read(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::ErrorEstimator::reduce_error(), libMesh::MeshTools::total_weight(), and libMesh::XdrIO::write_serialized_connectivity().
|
inline |
|
inline |
|
inline |
Verify that a local variable has the same value on all processors. Containers must have the same value in every entry.
Definition at line 1928 of file parallel_implementation.h.
References max(), min(), and size().
Referenced by allgather(), alltoall(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), max(), maxloc(), min(), and minloc().
|
private |
Definition at line 190 of file communicator.h.
Referenced by assign(), clear(), duplicate(), get(), and libMesh::ParallelObject::operator=().
|
private |
Definition at line 197 of file communicator.h.
Referenced by clear(), duplicate(), and split().
|
private |
Definition at line 191 of file communicator.h.
|
private |
Definition at line 192 of file communicator.h.
Referenced by assign(), and send_mode().
|
private |
Definition at line 191 of file communicator.h.
|
mutableprivate |
Definition at line 196 of file communicator.h.
Referenced by dereference_unique_tag(), get_unique_tag(), and reference_unique_tag().