20#ifndef REALM_RUNTIME_H
21#define REALM_RUNTIME_H
97 bool (*put)(
const void *key,
size_t key_size,
const void *value,
size_t value_sizem,
98 const void *vtable_data,
size_t vtable_data_size) =
nullptr;
118 bool (*get)(
const void *key,
size_t key_size,
void *value,
size_t *value_size,
119 const void *vtable_data,
size_t vtable_data_size) =
nullptr;
160 inline static constexpr std::string_view group_key =
"realm_group";
161 inline static constexpr std::string_view rank_key =
"realm_rank";
162 inline static constexpr std::string_view ranks_key =
"realm_ranks";
163 bool (*bar)(
const void *vtable_data,
size_t vtable_data_size) =
nullptr;
182 bool (*cas)(
const void *key,
size_t key_size,
void *expected,
size_t *expected_size,
183 const void *desired,
size_t desired_size,
const void *vtable_data,
184 size_t vtable_data_size) =
nullptr;
190 bool remove_realm_args =
false);
200 bool remove_realm_args =
false);
206 bool init(
int *argc,
char ***argv);
216 Event event = Event::NO_EVENT;
217 if(register_reduction(event, redop_id, redop)) {
223 template <
typename REDOP>
227 return register_reduction(redop_id, &redop);
229 template <
typename REDOP>
233 return register_reduction(redop_id, &redop);
238 template <
typename SERDEZ>
242 return register_custom_serdez(serdez_id, &serdez);
246 const void *args,
size_t arglen,
247 Event wait_on = Event::NO_EVENT,
int priority = 0);
251 size_t arglen,
bool one_per_node =
false,
252 Event wait_on = Event::NO_EVENT,
int priority = 0);
265 RunStyle style = ONE_TASK_ONLY,
const void *args = 0,
266 size_t arglen = 0,
bool background =
false));
284 template <
typename T>
287 Module *mod = get_module_untyped(name);
289 return dynamic_cast<T *
>(mod);
Definition custom_serdez.h:150
Definition custom_serdez.h:192
Definition module_config.h:32
Definition processor.h:37
Kind
Definition processor.h:65
::realm_task_func_id_t TaskFuncID
Definition processor.h:58
RunStyle
Definition runtime.h:257
@ ONE_TASK_PER_NODE
Definition runtime.h:259
@ ONE_TASK_ONLY
Definition runtime.h:258
@ ONE_TASK_PER_PROC
Definition runtime.h:260
bool configure_from_command_line(std::vector< std::string > &cmdline, bool remove_realm_args=false)
bool register_reduction(Event &event, ReductionOpID redop_id, const ReductionOpUntyped *redop)
void * impl
Definition runtime.h:34
bool register_reduction(ReductionOpID redop_id, const ReductionOpUntyped *redop)
Definition runtime.h:214
void parse_command_line(std::vector< std::string > &cmdline, bool remove_realm_args=false)
static Runtime get_runtime(void)
bool init(int *argc, char ***argv)
bool register_task(Processor::TaskFuncID taskid, Processor::TaskFuncPtr taskptr)
static const char * get_library_version()
Module * get_module_untyped(const char *name)
~Runtime(void)
Definition runtime.h:47
void shutdown(Event wait_on=Event::NO_EVENT, int result_code=0)
bool register_custom_serdez(CustomSerdezID serdez_id)
Definition runtime.h:239
void parse_command_line(int argc, char **argv)
Runtime(const Runtime &r)
Definition runtime.h:38
bool register_custom_serdez(CustomSerdezID serdez_id, const CustomSerdezUntyped *serdez)
int wait_for_shutdown(void)
bool register_reduction(ReductionOpID redop_id)
Definition runtime.h:224
bool create_configs(int argc, char **argv)
T * get_module(const char *name)
Definition runtime.h:285
Runtime & operator=(const Runtime &r)
Definition runtime.h:41
bool configure_from_command_line(int argc, char **argv)
bool network_init(const KeyValueStoreVtable &vtable)
Event collective_spawn_by_kind(Processor::Kind target_kind, Processor::TaskFuncID task_id, const void *args, size_t arglen, bool one_per_node=false, Event wait_on=Event::NO_EVENT, int priority=0)
REALM_ATTR_DEPRECATED("use collective_spawn calls instead", void run(Processor::TaskFuncID task_id=0, RunStyle style=ONE_TASK_ONLY, const void *args=0, size_t arglen=0, bool background=false))
Event collective_spawn(Processor target_proc, Processor::TaskFuncID task_id, const void *args, size_t arglen, Event wait_on=Event::NO_EVENT, int priority=0)
bool register_reduction(Event &event, ReductionOpID redop_id)
Definition runtime.h:230
void finish_configure(void)
bool network_init(int *argc, char ***argv)
ModuleConfig * get_module_config(const std::string &name) const
#define REALM_PUBLIC_API
Definition compiler_support.h:217
Definition activemsg.h:38
int CustomSerdezID
Definition custom_serdez.h:148
::realm_reduction_op_id_t ReductionOpID
Definition event.h:38
const void * vtable_data
Definition runtime.h:82
size_t vtable_data_size
Definition runtime.h:83