23 #ifdef __USE_64_BIT_INT__ 24 #define DendroIntL long long 25 #define DendroIntLSpecifier %lld 26 #define DendroUIntLSpecifier %llu 28 #define DendroIntL int 29 #define DendroIntLSpecifier %d 30 #define DendroUIntLSpecifier %u 41 int Mpi_Isend(T* buf,
int count,
int dest,
int tag, MPI_Comm comm, MPI_Request* request);
44 int Mpi_Issend(T* buf,
int count,
int dest,
int tag, MPI_Comm comm, MPI_Request* request);
47 int Mpi_Recv(T* buf,
int count,
int source,
int tag, MPI_Comm comm, MPI_Status* status);
50 int Mpi_Irecv(T* buf,
int count,
int source,
int tag, MPI_Comm comm, MPI_Request* request);
53 int Mpi_Gather( T* sendBuffer, T* recvBuffer,
int count,
int root, MPI_Comm comm);
55 template <
typename T,
typename S>
56 int Mpi_Sendrecv( T* sendBuf,
int sendCount,
int dest,
int sendTag,
57 S* recvBuf,
int recvCount,
int source,
int recvTag,
58 MPI_Comm comm, MPI_Status* status);
61 int Mpi_Bcast( T* buffer,
int count,
int root, MPI_Comm comm);
64 int Mpi_Scan( T* sendbuf, T* recvbuf,
int count, MPI_Op op, MPI_Comm comm);
67 int Mpi_Reduce( T* sendbuf, T* recvbuf,
int count, MPI_Op op,
int root, MPI_Comm comm);
70 int Mpi_Allreduce( T* sendbuf, T* recvbuf,
int count, MPI_Op op, MPI_Comm comm);
73 int Mpi_Alltoall(T* sendbuf, T* recvbuf,
int count, MPI_Comm comm);
77 int* recvcounts,
int* displs, MPI_Comm comm);
80 int Mpi_Allgather(T* sendbuf, T* recvbuf,
int count, MPI_Comm comm);
84 T* recvbuf,
int* recvcnts,
int* rdispls, MPI_Comm comm);
88 T* recvbuf,
int* recvcnts,
int* rdispls, MPI_Comm comm);
107 unsigned int (*getWeight)(
const T *), MPI_Comm comm);
111 void rankSamples(std::vector<T>& arr, std::vector<T> samples, MPI_Comm comm);
114 std::vector<T>
Sorted_Sample_Select(std::vector<T>& arr,
unsigned int kway, std::vector<unsigned int>& min_idx, std::vector<unsigned int>& max_idx, std::vector<DendroIntL>& splitter_ranks, MPI_Comm comm);
122 std::vector<T>
GetRangeMean(std::vector<T>& arr, std::vector<unsigned int> range_min, std::vector<unsigned int> range_max, MPI_Comm comm);
124 std::vector<T>
GuessRangeMedian(std::vector<T>& arr, std::vector<unsigned int> range_min, std::vector<unsigned int> range_max, MPI_Comm comm);
136 std::vector<T>
Sorted_k_Select(std::vector<T>& arr, std::vector<unsigned int> min_idx, std::vector<unsigned int> max_idx, std::vector<DendroIntL> K, std::vector<T> guess, MPI_Comm comm);
146 int HyperQuickSort(std::vector<T>& in, std::vector<T> & out, MPI_Comm comm);
177 int sampleSort(std::vector<T>& in, std::vector<T> & out, MPI_Comm comm);
180 int sampleSort(std::vector<T>& in, MPI_Comm comm);
191 int splitComm2way(
bool iAmEmpty, MPI_Comm* new_comm, MPI_Comm orig_comm);
202 int splitComm2way(
const bool* isEmptyList, MPI_Comm* new_comm, MPI_Comm orig_comm);
263 template <
typename T>
264 void MergeLists( std::vector<T> &listA, std::vector<T> &listB,
int KEEP_WHAT) ;
274 template <
typename T>
275 void MergeSplit( std::vector<T> &local_list,
int which_keys,
int partner, MPI_Comm comm);
280 template <
typename T>
286 template <
typename T>
292 template <
typename T>
304 template <
typename T>
319 template <
typename T>
320 void bitonicSort(std::vector<T> & in, MPI_Comm comm) ;
324 #include "parUtils.tcc" int Mpi_Irecv(T *buf, int count, int source, int tag, MPI_Comm comm, MPI_Request *request)
int HyperQuickSort(std::vector< T > &in, std::vector< T > &out, MPI_Comm comm)
A parallel hyper quick sort implementation.
int Mpi_Alltoallv_sparse(T *sendbuf, int *sendcnts, int *sdispls, T *recvbuf, int *recvcnts, int *rdispls, MPI_Comm comm)
int Mpi_Allgatherv(T *sendbuf, int sendcount, T *recvbuf, int *recvcounts, int *displs, MPI_Comm comm)
int Mpi_Reduce(T *sendbuf, T *recvbuf, int count, MPI_Op op, int root, MPI_Comm comm)
std::vector< T > Sorted_k_Select(std::vector< T > &arr, std::vector< unsigned int > min_idx, std::vector< unsigned int > max_idx, std::vector< DendroIntL > K, std::vector< T > guess, MPI_Comm comm)
A parallel k-selection algorithms.
void MergeLists(std::vector< T > &listA, std::vector< T > &listB, int KEEP_WHAT)
Merges lists A, and B, retaining either the low or the High in list A.
void rankSamples(std::vector< T > &arr, std::vector< T > samples, MPI_Comm comm)
void Par_bitonic_merge_incr(std::vector< T > &local_list, int proc_set_size, MPI_Comm comm)
int Mpi_Alltoall(T *sendbuf, T *recvbuf, int count, MPI_Comm comm)
std::vector< T > Sorted_Sample_Select(std::vector< T > &arr, unsigned int kway, std::vector< unsigned int > &min_idx, std::vector< unsigned int > &max_idx, std::vector< DendroIntL > &splitter_ranks, MPI_Comm comm)
void Par_bitonic_sort_incr(std::vector< T > &local_list, int proc_set_size, MPI_Comm comm)
int Mpi_Bcast(T *buffer, int count, int root, MPI_Comm comm)
int Mpi_Allgather(T *sendbuf, T *recvbuf, int count, MPI_Comm comm)
int Mpi_Issend(T *buf, int count, int dest, int tag, MPI_Comm comm, MPI_Request *request)
std::vector< std::pair< T, DendroIntL > > Sorted_approx_Select_skewed(std::vector< T > &arr, unsigned int k, MPI_Comm comm)
new one to handle skewed distributions ...
unsigned int defaultWeight(const T *a)
void MergeSplit(std::vector< T > &local_list, int which_keys, int partner, MPI_Comm comm)
The main operation in the parallel bitonic sort algorithm. This implements the compare-split operatio...
void bitonicSort_binary(std::vector< T > &in, MPI_Comm comm)
An implementation of parallel bitonic sort that expects the number of processors to be a power of 2...
unsigned int splitCommBinary(MPI_Comm orig_comm, MPI_Comm *new_comm)
Splits a communication group into two, the first having a power of 2 number of processors and the oth...
std::vector< T > GuessRangeMedian(std::vector< T > &arr, std::vector< unsigned int > range_min, std::vector< unsigned int > range_max, MPI_Comm comm)
int Mpi_Recv(T *buf, int count, int source, int tag, MPI_Comm comm, MPI_Status *status)
int HyperQuickSort_cav(std::vector< T > &in, std::vector< T > &out, MPI_Comm comm)
int partitionW(std::vector< T > &vec, unsigned int(*getWeight)(const T *), MPI_Comm comm)
A parallel weighted partitioning function. In our implementation, we do not pose any restriction on t...
std::vector< T > GetRangeMean(std::vector< T > &arr, std::vector< unsigned int > range_min, std::vector< unsigned int > range_max, MPI_Comm comm)
int Mpi_Allreduce(T *sendbuf, T *recvbuf, int count, MPI_Op op, MPI_Comm comm)
void bitonicSort(std::vector< T > &in, MPI_Comm comm)
An implementation of parallel bitonic sort that does not expect the number of processors to be a powe...
Collection of Generic Parallel Functions: Sorting, Partitioning, Searching,...
int splitCommUsingSplittingRank(int splittingRank, MPI_Comm *new_comm, MPI_Comm orig_comm)
int Mpi_Sendrecv(T *sendBuf, int sendCount, int dest, int sendTag, S *recvBuf, int recvCount, int source, int recvTag, MPI_Comm comm, MPI_Status *status)
unsigned int splitCommBinaryNoFlip(MPI_Comm orig_comm, MPI_Comm *new_comm)
Splits a communication group into two, the first having a power of 2 number of processors and the oth...
std::vector< T > Sorted_approx_Select(std::vector< T > &arr, unsigned int k, MPI_Comm comm)
int HyperQuickSort_kway(std::vector< T > &in, std::vector< T > &out, MPI_Comm comm)
int Mpi_Scan(T *sendbuf, T *recvbuf, int count, MPI_Op op, MPI_Comm comm)
int splitComm2way(bool iAmEmpty, MPI_Comm *new_comm, MPI_Comm orig_comm)
Splits a communication group into two, one containing processors that passed a value of 'false' for t...
void Par_bitonic_sort_decr(std::vector< T > &local_list, int proc_set_size, MPI_Comm comm)
int Mpi_Alltoallv_dense(T *sendbuf, int *sendcnts, int *sdispls, T *recvbuf, int *recvcnts, int *rdispls, MPI_Comm comm)
int sampleSort(std::vector< T > &in, std::vector< T > &out, MPI_Comm comm)
A parallel sample sort implementation. In our implementation, we do not pose any restriction on the i...
int Mpi_Gather(T *sendBuffer, T *recvBuffer, int count, int root, MPI_Comm comm)
int Mpi_Isend(T *buf, int count, int dest, int tag, MPI_Comm comm, MPI_Request *request)