Itoyori  v0.0.1
options.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ityr/common/util.hpp"
5 
6 namespace ityr::ori {
7 
8 inline void print_compile_options() {
9 #ifndef ITYR_ORI_CORE
10 #define ITYR_ORI_CORE default
11 #endif
13 
14 #ifndef ITYR_ORI_BLOCK_SIZE
15 #define ITYR_ORI_BLOCK_SIZE 65536
16 #endif
18 
19 #ifndef ITYR_ORI_DEFAULT_MEM_MAPPER
20 #define ITYR_ORI_DEFAULT_MEM_MAPPER cyclic
21 #endif
23 
24 #ifndef ITYR_ORI_ENABLE_WRITE_THROUGH
25 #define ITYR_ORI_ENABLE_WRITE_THROUGH false
26 #endif
28 
29 #ifndef ITYR_ORI_ENABLE_LAZY_RELEASE
30 #define ITYR_ORI_ENABLE_LAZY_RELEASE true
31 #endif
33 
34 #ifndef ITYR_ORI_ENABLE_VM_MAP
35 #define ITYR_ORI_ENABLE_VM_MAP true
36 #endif
38 
39 #ifndef ITYR_ORI_FORCE_GETPUT
40 #define ITYR_ORI_FORCE_GETPUT false
41 #endif
43 
44 #ifndef ITYR_ORI_CACHE_PROF
45 #define ITYR_ORI_CACHE_PROF disabled
46 #endif
48 
49 #ifndef ITYR_ORI_CACHE_TLB_SIZE
50 #define ITYR_ORI_CACHE_TLB_SIZE 3
51 #endif
53 
54 #ifndef ITYR_ORI_HOME_TLB_SIZE
55 #define ITYR_ORI_HOME_TLB_SIZE 3
56 #endif
58 }
59 
60 struct cache_size_option : public common::option<cache_size_option, std::size_t> {
61  using option::option;
62  static std::string name() { return "ITYR_ORI_CACHE_SIZE"; }
63  static std::size_t default_value() { return std::size_t(16) * 1024 * 1024; }
64 };
65 
66 struct sub_block_size_option : public common::option<sub_block_size_option, std::size_t> {
67  using option::option;
68  static std::string name() { return "ITYR_ORI_SUB_BLOCK_SIZE"; }
69  static std::size_t default_value() { return 4096; }
70 };
71 
72 struct max_dirty_cache_size_option : public common::option<max_dirty_cache_size_option, std::size_t> {
73  using option::option;
74  static std::string name() { return "ITYR_ORI_MAX_DIRTY_CACHE_SIZE"; }
75  static std::size_t default_value() { return cache_size_option::value() / 2; }
76 };
77 
78 struct noncoll_allocator_size_option : public common::option<noncoll_allocator_size_option, std::size_t> {
79  using option::option;
80  static std::string name() { return "ITYR_ORI_NONCOLL_ALLOCATOR_SIZE"; }
81  static std::size_t default_value() { return std::size_t(4) * 1024 * 1024; }
82 };
83 
84 struct lazy_release_check_interval_option : public common::option<lazy_release_check_interval_option, int> {
85  using option::option;
86  static std::string name() { return "ITYR_ORI_LAZY_RELEASE_CHECK_INTERVAL"; }
87  static int default_value() { return 10; }
88 };
89 
90 struct lazy_release_make_mpi_progress_option : public common::option<lazy_release_make_mpi_progress_option, bool> {
91  using option::option;
92  static std::string name() { return "ITYR_ORI_LAZY_RELEASE_MAKE_MPI_PROGRESS"; }
93  static bool default_value() { return true; }
94 };
95 
103 };
104 
105 }
Definition: options.hpp:90
Definition: options.hpp:54
static value_type value()
Definition: options.hpp:62
#define ITYR_PRINT_MACRO(x)
Definition: options.hpp:12
Definition: block_region_set.hpp:9
void print_compile_options()
Definition: options.hpp:8
#define ITYR_ORI_HOME_TLB_SIZE
#define ITYR_ORI_CACHE_PROF
#define ITYR_ORI_CORE
#define ITYR_ORI_FORCE_GETPUT
#define ITYR_ORI_DEFAULT_MEM_MAPPER
#define ITYR_ORI_CACHE_TLB_SIZE
#define ITYR_ORI_BLOCK_SIZE
#define ITYR_ORI_ENABLE_LAZY_RELEASE
#define ITYR_ORI_ENABLE_WRITE_THROUGH
#define ITYR_ORI_ENABLE_VM_MAP
Definition: options.hpp:60
static std::string name()
Definition: options.hpp:62
static std::size_t default_value()
Definition: options.hpp:63
static std::string name()
Definition: options.hpp:86
static int default_value()
Definition: options.hpp:87
static std::string name()
Definition: options.hpp:92
static bool default_value()
Definition: options.hpp:93
Definition: options.hpp:72
static std::string name()
Definition: options.hpp:74
static std::size_t default_value()
Definition: options.hpp:75
static std::string name()
Definition: options.hpp:80
static std::size_t default_value()
Definition: options.hpp:81
Definition: options.hpp:96
common::option_initializer< lazy_release_make_mpi_progress_option > ITYR_ANON_VAR
Definition: options.hpp:102
common::option_initializer< max_dirty_cache_size_option > ITYR_ANON_VAR
Definition: options.hpp:99
common::option_initializer< lazy_release_check_interval_option > ITYR_ANON_VAR
Definition: options.hpp:101
common::option_initializer< cache_size_option > ITYR_ANON_VAR
Definition: options.hpp:97
common::option_initializer< noncoll_allocator_size_option > ITYR_ANON_VAR
Definition: options.hpp:100
common::option_initializer< sub_block_size_option > ITYR_ANON_VAR
Definition: options.hpp:98
Definition: options.hpp:66
static std::string name()
Definition: options.hpp:68
static std::size_t default_value()
Definition: options.hpp:69