libMesh
Public Member Functions | Protected Attributes | Private Types | Private Attributes | List of all members
libMesh::Parallel::BinSorter< KeyType, IdxType > Class Template Reference

Perform a parallel sort using a bin-sort method. More...

#include <parallel_bin_sorter.h>

Inheritance diagram for libMesh::Parallel::BinSorter< KeyType, IdxType >:
[legend]

Public Member Functions

 BinSorter (const Parallel::Communicator &comm, const std::vector< KeyType > &d)
 
void binsort (const IdxType nbins, KeyType max, KeyType min)
 The actual function which sorts the data into nbins. More...
 
IdxType sizeof_bin (const IdxType bin) const
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Protected Attributes

const Parallel::Communicator_communicator
 

Private Types

typedef std::vector< KeyType >::const_iterator IterType
 

Private Attributes

const std::vector< KeyType > & data
 
std::vector< IterTypebin_iters
 

Detailed Description

template<typename KeyType, typename IdxType = unsigned int>
class libMesh::Parallel::BinSorter< KeyType, IdxType >

Perform a parallel sort using a bin-sort method.

Author
Benjamin S. Kirk
John W. Peterson
Date
2007 Parallel bin sorting object.

Definition at line 49 of file parallel_bin_sorter.h.

Member Typedef Documentation

◆ IterType

template<typename KeyType , typename IdxType = unsigned int>
typedef std::vector<KeyType>::const_iterator libMesh::Parallel::BinSorter< KeyType, IdxType >::IterType
private

Definition at line 52 of file parallel_bin_sorter.h.

Constructor & Destructor Documentation

◆ BinSorter()

template<typename KeyType , typename IdxType = unsigned int>
libMesh::Parallel::BinSorter< KeyType, IdxType >::BinSorter ( const Parallel::Communicator comm,
const std::vector< KeyType > &  d 
)
explicit

Member Function Documentation

◆ binsort()

template<typename KeyType , typename IdxType = unsigned int>
void libMesh::Parallel::BinSorter< KeyType, IdxType >::binsort ( const IdxType  nbins,
KeyType  max,
KeyType  min 
)

The actual function which sorts the data into nbins.

Currently based on the global min and max which you must provide e.g. by using MPI.

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::MeshBase::partition().

94  { return cast_int<processor_id_type>(_communicator.size()); }
processor_id_type size() const
Definition: communicator.h:175
const Parallel::Communicator & _communicator

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited

◆ sizeof_bin()

template<typename KeyType , typename IdxType >
IdxType libMesh::Parallel::BinSorter< KeyType, IdxType >::sizeof_bin ( const IdxType  bin) const
Returns
The size of bin b as an unsigned int.

Definition at line 88 of file parallel_bin_sorter.h.

89 {
90  libmesh_assert_less ((bin+1), bin_iters.size());
91 
92  // The size of the bin is defined by the distance between
93  // its bounding iterators
94  return cast_int<IdxType>
95  (std::distance (bin_iters[bin], bin_iters[bin+1]));
96 }
std::vector< IterType > bin_iters

Member Data Documentation

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ bin_iters

template<typename KeyType , typename IdxType = unsigned int>
std::vector<IterType> libMesh::Parallel::BinSorter< KeyType, IdxType >::bin_iters
private

Definition at line 79 of file parallel_bin_sorter.h.

◆ data

template<typename KeyType , typename IdxType = unsigned int>
const std::vector<KeyType>& libMesh::Parallel::BinSorter< KeyType, IdxType >::data
private

Definition at line 78 of file parallel_bin_sorter.h.


The documentation for this class was generated from the following file: