19#ifndef LIBMESH_PARALLEL_SORT_H
20#define LIBMESH_PARALLEL_SORT_H
23#include "libmesh/libmesh_common.h"
24#include "libmesh/parallel_object.h"
54template <
typename KeyType,
typename IdxType=
unsigned int>
67 std::vector<KeyType> & d);
83 const std::vector<KeyType> &
bin();
An object whose state is distributed along a set of processors.
const Parallel::Communicator & comm() const
The parallel sorting method is templated on the type of data which is to be sorted.
const processor_id_type _n_procs
The number of processors to work with.
const std::vector< KeyType > & bin()
Return a constant reference to _my_bin.
std::vector< KeyType > _my_bin
The bin which will eventually be held by this processor.
void sort()
This is the only method which needs to be called by the user.
void sort_local_bin()
After all the bins have been communicated, we can sort our local bin.
void communicate_bins()
Communicates the bins from each processor to the appropriate processor.
std::vector< IdxType > _local_bin_sizes
Vector which holds the size of each bin on this processor.
std::vector< KeyType > & _data
The raw, unsorted data which will need to be sorted (in parallel) across all processors.
bool _bin_is_sorted
Flag which lets you know if sorting is complete.
void binsort()
Sorts the local data into bins across all processors.
const processor_id_type _proc_id
The identity of this processor.
uint8_t processor_id_type
The libMesh namespace provides an interface to certain functionality in the library.