10 #define ITYR_STR_EXPAND(x) #x
11 #define ITYR_STR(x) ITYR_STR_EXPAND(x)
12 #define ITYR_PRINT_MACRO(x) printf(#x "=" ITYR_STR_EXPAND(x) "\n")
17 #ifndef ITYR_MAX_VERBOSE_LEVEL
18 #define ITYR_MAX_VERBOSE_LEVEL 0
22 #ifndef ITYR_PROFILER_MODE
23 #define ITYR_PROFILER_MODE disabled
28 #if __has_include(<utofu.h>)
29 #define ITYR_RMA_IMPL utofu
31 #define ITYR_RMA_IMPL mpi
36 #ifndef ITYR_ALLOCATOR_USE_BOOST
37 #define ITYR_ALLOCATOR_USE_BOOST 0
41 #ifndef ITYR_ALLOCATOR_USE_DYNAMIC_WIN
42 #define ITYR_ALLOCATOR_USE_DYNAMIC_WIN false
53 template <
typename Derived,
typename T>
77 std::cout << Derived::name() <<
"=" <<
val_ << std::endl;
85 static std::vector<option_base*> opts;
89 template <
typename Option>
93 : init_(
getenv_coll(Option::name(), Option::default_value())) {
96 if (std::find(opts.begin(), opts.end(), opt) == opts.end()) {
108 bool should_pop_ =
false;
119 static std::string
name() {
return "ITYR_ENABLE_SHARED_MEMORY"; }
125 static std::string
name() {
return "ITYR_GLOBAL_CLOCK_SYNC_ROUND_TRIPS"; }
131 static std::string
name() {
return "ITYR_PROF_OUTPUT_PER_RANK"; }
137 static std::string
name() {
return "ITYR_RMA_USE_MPI_WIN_ALLOCATE"; }
143 static std::string
name() {
return "ITYR_ALLOCATOR_BLOCK_SIZE"; }
149 static std::string
name() {
return "ITYR_ALLOCATOR_MAX_UNFLUSHED_FREE_OBJS"; }
Definition: options.hpp:47
virtual ~option_base()=default
virtual void print() const =0
Definition: options.hpp:90
~option_initializer()
Definition: options.hpp:101
option_initializer()
Definition: options.hpp:92
Definition: options.hpp:54
void print() const override
Definition: options.hpp:76
option(value_type val)
Definition: options.hpp:60
T value_type
Definition: options.hpp:58
value_type val_
Definition: options.hpp:81
static value_type value()
Definition: options.hpp:62
static void set(value_type val)
Definition: options.hpp:67
static void unset()
Definition: options.hpp:71
static bool initialized()
Definition: util.hpp:185
static auto & get()
Definition: util.hpp:180
static void init(Args &&... args)
Definition: util.hpp:190
static void fini()
Definition: util.hpp:194
#define ITYR_PRINT_MACRO(x)
Definition: options.hpp:12
#define ITYR_PROFILER_MODE
#define ITYR_MAX_VERBOSE_LEVEL
#define ITYR_ALLOCATOR_USE_BOOST
#define ITYR_ALLOCATOR_USE_DYNAMIC_WIN
#define ITYR_CHECK(cond)
Definition: util.hpp:48
Definition: allocator.hpp:16
void print_runtime_options()
Definition: options.hpp:111
std::vector< option_base * > & get_options()
Definition: options.hpp:84
void print_compile_options()
Definition: options.hpp:16
T getenv_coll(const std::string &env_var, T default_val)
Definition: mpi_util.hpp:467
void get(global_ptr< ConstT > from_ptr, T *to_ptr, std::size_t count)
Definition: ori.hpp:80
Definition: options.hpp:141
static std::size_t default_value()
Definition: options.hpp:144
static std::string name()
Definition: options.hpp:143
Definition: options.hpp:147
static std::string name()
Definition: options.hpp:149
static std::size_t default_value()
Definition: options.hpp:150
Definition: options.hpp:117
static bool default_value()
Definition: options.hpp:120
static std::string name()
Definition: options.hpp:119
Definition: options.hpp:123
static std::string name()
Definition: options.hpp:125
static std::size_t default_value()
Definition: options.hpp:126
Definition: options.hpp:129
static bool default_value()
Definition: options.hpp:132
static std::string name()
Definition: options.hpp:131
Definition: options.hpp:135
static std::string name()
Definition: options.hpp:137
static bool default_value()
Definition: options.hpp:138
Definition: options.hpp:153
option_initializer< enable_shared_memory_option > ITYR_ANON_VAR
Definition: options.hpp:154
option_initializer< allocator_max_unflushed_free_objs_option > ITYR_ANON_VAR
Definition: options.hpp:159
option_initializer< rma_use_mpi_win_allocate > ITYR_ANON_VAR
Definition: options.hpp:157
option_initializer< global_clock_sync_round_trips_option > ITYR_ANON_VAR
Definition: options.hpp:155
option_initializer< allocator_block_size_option > ITYR_ANON_VAR
Definition: options.hpp:158
option_initializer< prof_output_per_rank_option > ITYR_ANON_VAR
Definition: options.hpp:156