Chombo + EB  3.0
sort_hist.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _SORT_HIST_H_
12 #define _SORT_HIST_H_
13 
14 // this method explicity uses keys instead of a compare method
15 typedef unsigned long long key_type;
16 
18 {
19 public:
23  int total;
24 };
25 
26 class probe
27 {
28 public:
30  int num_keys;
33 };
34 
35 struct splitter
36 {
42  int virt;
43  bool achieved;
45 };
46 
47 class Histogram
48 {
49 public:
50  Histogram( SortComm* env, key_type min, key_type max );
51  void set_limits( key_type min, key_type max );
52  int* mws_sdispl( key_type *, int nloc, MPI_Comm c, float margin );
53 private:
54  key_type m_min_key, m_max_key;
55  const int m_num_pes;
56  const int m_my_pe;
58  int m_ncalls;
66  //std::vector<index_type> m_key_splits;
67  //std::vector<key_type> m_probe;
68 private:
69  splitter* mws_private( key_type *, int , MPI_Comm );
70  void Init( MPI_Comm a_comm, const int a_nloc, float );
71  void RefineProbes( std::vector<index_type> & );
72  key_type* get_splitter_guesses(int *ptr_num_guesses, std::vector< splitter* > active_splitters);
73 };
74 
75 //need to include .C file in order to have it instantiated when the .h file is included externally
76 //such instantiation is necessary here since the compiler generates templated code on demand
77 #include "sort_histI.H"
78 #endif
Definition: sort_hist.H:26
index_type upperb_count
Definition: sort_hist.H:37
key_type * splitter_guesses
Definition: sort_hist.H:29
index_type goal
Definition: sort_hist.H:41
const int m_num_pes
Definition: sort_hist.H:55
key_type upperb
Definition: sort_hist.H:21
int m_probe_size_max
Definition: sort_hist.H:61
index_type m_num_total_keys
Definition: sort_hist.H:64
IndexTM< T, N > min(const IndexTM< T, N > &a_p1, const IndexTM< T, N > &a_p2)
Definition: IndexTMI.H:396
int chare_dest
Definition: sort_hist.H:22
Definition: sort_hist.H:35
Definition: sort_hist.H:17
int total
Definition: sort_hist.H:23
unsigned long long key_type
Definition: sort_hist.H:15
int num_keys
Definition: sort_hist.H:30
const int m_my_pe
Definition: sort_hist.H:56
key_type upperb_key
Definition: sort_hist.H:38
index_type lowerb_count
Definition: sort_hist.H:39
int m_num_steps
Definition: sort_hist.H:57
IndexTM< T, N > max(const IndexTM< T, N > &a_p1, const IndexTM< T, N > &a_p2)
Definition: IndexTMI.H:403
int m_margin_error
Definition: sort_hist.H:62
bool achieved
Definition: sort_hist.H:43
int m_probe_size
Definition: sort_hist.H:60
key_type m_min_key
Definition: sort_hist.H:54
int virt
Definition: sort_hist.H:42
key_type * m_last_probe
Definition: sort_hist.H:65
Definition: sort_hist.H:47
int num_ranges
Definition: sort_hist.H:32
splitter * m_splitters
Definition: sort_hist.H:63
long long index_type
Definition: sort_utils.H:22
bool broadcasted
Definition: sort_hist.H:44
key_type lowerb
Definition: sort_hist.H:20
int m_num_achv
Definition: sort_hist.H:59
key_type lowerb_key
Definition: sort_hist.H:40
resolved_range * send_info
Definition: sort_hist.H:31
int m_ncalls
Definition: sort_hist.H:58