GADGET-4
parallel_sort.h File Reference

parallel sort routine that leaves the number of elements per processor invariant More...

#include "cxxsort.h"
#include "../data/mymalloc.h"

Go to the source code of this file.

Classes

class  IdxComp__< It, Comp >
 

Functions

template<typename It , typename T2 , typename Comp >
void buildIndex (It begin, It end, T2 *idx, Comp comp)
 
template<typename T , typename Comp >
void get_local_rank (const T &element, std::size_t tie_breaking_rank, const T *base, size_t nmemb, size_t noffs_thistask, long long left, long long right, size_t *loc, Comp comp)
 
template<typename T , typename Comp >
double mycxxsort_parallel (T *begin, T *end, Comp comp, MPI_Comm comm)
 

Detailed Description

parallel sort routine that leaves the number of elements per processor invariant

Definition in file parallel_sort.h.

Function Documentation

◆ buildIndex()

void buildIndex ( It  begin,
It  end,
T2 *  idx,
Comp  comp 
)
inline

Performs an indirect sort on the supplied iterator range and returns in idx a vector containing the indices of the smallest, second smallest, third smallest, etc. element, according to comp.

Definition at line 37 of file parallel_sort.h.

◆ get_local_rank()

void get_local_rank ( const T &  element,
std::size_t  tie_breaking_rank,
const T *  base,
size_t  nmemb,
size_t  noffs_thistask,
long long  left,
long long  right,
size_t *  loc,
Comp  comp 
)

Definition at line 47 of file parallel_sort.h.

◆ mycxxsort_parallel()

double mycxxsort_parallel ( T *  begin,
T *  end,
Comp  comp,
MPI_Comm  comm 
)
inline

Definition at line 162 of file parallel_sort.h.