![]() |
Realm
A distributed, event-based tasking library
|
Go to the source code of this file.
Classes | |
| struct | realm_external_cuda_memory_resource_st |
| struct | realm_external_system_memory_resource_st |
| struct | realm_external_resource_st |
| struct | realm_index_space_t |
| struct | realm_region_instance_create_params_t |
| struct | realm_copy_src_dst_field_t |
| struct | realm_region_instance_copy_params_t |
| struct | realm_region_instance_attr_value_t |
| struct | realm_affinity_details_t |
Macros | |
| #define | REALM_EXPORT REALM_PUBLIC_API |
| #define | REALM_FNPTR |
| #define | IDFMT "%llx" |
| #define | REALM_NO_PROC ((realm_processor_t)0ULL) |
| #define | REALM_NO_MEM ((realm_memory_t)0ULL) |
| #define | REALM_NO_EVENT ((realm_event_t)0ULL) |
| #define | REALM_NO_USER_EVENT ((realm_user_event_t)0ULL) |
| #define | REALM_NO_INST ((realm_region_instance_t)0ULL) |
| #define | REALM_TASK_ID_PROCESSOR_NOP ((realm_task_func_id_t)0U) |
| #define | REALM_TASK_ID_PROCESSOR_INIT ((realm_task_func_id_t)1U) |
| #define | REALM_TASK_ID_PROCESSOR_SHUTDOWN ((realm_task_func_id_t)2U) |
| #define | REALM_TASK_ID_FIRST_AVAILABLE ((realm_task_func_id_t)4U) |
| #define | REALM_WAIT_INFINITE ((int64_t)INT64_MIN) |
| #define | REALM_PROCESSOR_KINDS(__op__) |
| #define | C_ENUMS(name, desc) name, |
| #define | REALM_MEMORY_KINDS(__op__) |
| #define | C_ENUMS(name, desc) name, |
| #define C_ENUMS | ( | name, | |
| desc | |||
| ) | name, |
| #define C_ENUMS | ( | name, | |
| desc | |||
| ) | name, |
| #define IDFMT "%llx" |
| #define REALM_EXPORT REALM_PUBLIC_API |
| #define REALM_FNPTR |
| #define REALM_MEMORY_KINDS | ( | __op__ | ) |
| #define REALM_NO_EVENT ((realm_event_t)0ULL) |
| #define REALM_NO_INST ((realm_region_instance_t)0ULL) |
| #define REALM_NO_MEM ((realm_memory_t)0ULL) |
| #define REALM_NO_PROC ((realm_processor_t)0ULL) |
| #define REALM_NO_USER_EVENT ((realm_user_event_t)0ULL) |
| #define REALM_PROCESSOR_KINDS | ( | __op__ | ) |
| #define REALM_TASK_ID_FIRST_AVAILABLE ((realm_task_func_id_t)4U) |
| #define REALM_TASK_ID_PROCESSOR_INIT ((realm_task_func_id_t)1U) |
| #define REALM_TASK_ID_PROCESSOR_NOP ((realm_task_func_id_t)0U) |
| #define REALM_TASK_ID_PROCESSOR_SHUTDOWN ((realm_task_func_id_t)2U) |
| #define REALM_WAIT_INFINITE ((int64_t)INT64_MIN) |
| typedef unsigned int realm_address_space_t |
| typedef struct realm_affinity_details_t realm_affinity_details_t |
| typedef unsigned long long realm_barrier_timestamp_t |
| typedef void* realm_coord_t |
| typedef enum realm_coord_type_enum realm_coord_type_t |
| typedef struct realm_copy_src_dst_field_t realm_copy_src_dst_field_t |
| typedef int realm_custom_serdez_id_t |
| typedef unsigned realm_event_gen_t |
| typedef realm_id_t realm_event_t |
| typedef struct realm_external_resource_st realm_external_resource_t |
| typedef int realm_field_id_t |
| typedef enum realm_file_mode_t realm_file_mode_t |
| typedef unsigned long long realm_id_t |
| typedef struct realm_index_space_t realm_index_space_t |
| typedef enum realm_memory_attr_enum realm_memory_attr_t |
| typedef enum realm_memory_kind_t realm_memory_kind_t |
| typedef realm_status_t(REALM_FNPTR * realm_memory_query_cb_t) (realm_memory_t, void *) |
| typedef struct realm_memory_query_st* realm_memory_query_t |
| typedef realm_id_t realm_memory_t |
| typedef enum realm_processor_attr_enum realm_processor_attr_t |
| typedef enum realm_processor_kind_t realm_processor_kind_t |
| typedef realm_status_t(REALM_FNPTR * realm_processor_query_cb_t) (realm_processor_t, void *) |
| typedef struct realm_processor_query_st* realm_processor_query_t |
| typedef realm_id_t realm_processor_t |
| typedef struct realm_profiling_request_set_st* realm_profiling_request_set_t |
| typedef int realm_reduction_op_id_t |
| typedef realm_id_t realm_region_instance_t |
| typedef enum realm_register_task_flags realm_register_task_flags_t |
| typedef enum realm_runtime_attr_enum realm_runtime_attr_t |
| typedef struct realm_runtime_st* realm_runtime_t |
| typedef struct realm_sparsity_handle_st* realm_sparsity_handle_t |
| typedef enum realm_status_enum realm_status_t |
| typedef unsigned realm_task_func_id_t |
| typedef void(REALM_FNPTR * realm_task_pointer_t) (const void *, size_t, const void *, size_t, realm_processor_t) |
| typedef realm_id_t realm_user_event_t |
| typedef realm_status_t RealmStatus |
| enum realm_file_mode_t |
| enum realm_memory_kind_t |
| enum realm_status_enum |
| realm_status_t REALM_EXPORT realm_event_has_triggered | ( | realm_runtime_t | runtime, |
| realm_event_t | event, | ||
| int * | has_triggered, | ||
| int * | poisoned | ||
| ) |
Checks if an event has triggered.
| runtime | The runtime instance to use. | |
| event | The event to check. | |
| [out] | has_triggered | Whether the event has triggered. |
| [out] | poisoned | Whether the event is poisoned. |
| realm_status_t REALM_EXPORT realm_event_merge | ( | realm_runtime_t | runtime, |
| const realm_event_t * | wait_for, | ||
| size_t | num_events, | ||
| realm_event_t * | event, | ||
| int | ignore_faults | ||
| ) |
Merges multiple events into a single event.
| runtime | The runtime instance to use. | |
| wait_for | The events to wait for. | |
| num_events | The number of events to wait for. | |
| [out] | event | The merged event. |
| ignore_faults | Whether to ignore any poison on the input events. |
| realm_status_t REALM_EXPORT realm_event_wait | ( | realm_runtime_t | runtime, |
| realm_event_t | event, | ||
| int64_t | max_ns, | ||
| int * | poisoned | ||
| ) |
Waits for a specific event to complete.
| runtime | The runtime instance to use. | |
| event | The event to wait for. | |
| max_ns | The maximum number of nanoseconds to wait. REALM_WAIT_INFINITE is a special value that means wait forever. | |
| [out] | poisoned | Whether the event is poisoned. |
| realm_status_t REALM_EXPORT realm_external_resource_suggested_memory | ( | realm_runtime_t | runtime, |
| const realm_external_resource_t * | external_resource, | ||
| realm_memory_t * | memory | ||
| ) |
Gets the suggested memory for an external instance resource.
| runtime | The runtime instance to use. | |
| resource | The external instance resource to get the suggested memory for. | |
| [out] | memory | The suggested memory. |
| realm_status_t REALM_EXPORT realm_get_library_version | ( | const char ** | version | ) |
| realm_status_t REALM_EXPORT realm_memory_get_attributes | ( | realm_runtime_t | runtime, |
| realm_memory_t | mem, | ||
| realm_memory_attr_t * | attrs, | ||
| uint64_t * | values, | ||
| size_t | num | ||
| ) |
Returns the attributes of a memory.
| runtime | The runtime instance to use. | |
| mem | The memory to get the attributes of. | |
| attrs | The attributes to get. | |
| [out] | values | The values of the attributes. |
| num | The number of attributes to get. |
| realm_status_t REALM_EXPORT realm_memory_query_create | ( | realm_runtime_t | runtime, |
| realm_memory_query_t * | query | ||
| ) |
Creates a new memory query.
| machine | The machine instance. | |
| [out] | query | The memory query to be created. |
| realm_status_t REALM_EXPORT realm_memory_query_destroy | ( | realm_memory_query_t | query | ) |
Destroys a memory query.
| query | The memory query to be destroyed. |
| realm_status_t REALM_EXPORT realm_memory_query_iter | ( | realm_memory_query_t | query, |
| realm_memory_query_cb_t | cb, | ||
| void * | user_data, | ||
| size_t | max_queries | ||
| ) |
Iterates over the memories in the query.
| query | The memory query to be iterated over. |
| cb | The callback function to be called for each memory. |
| user_data | The user data to be passed to the callback function. |
| max_queries | The maximum number of memories to iterate over. |
| realm_status_t REALM_EXPORT realm_memory_query_restrict_by_capacity | ( | realm_memory_query_t | query, |
| size_t | min_bytes | ||
| ) |
Restricts the memory query to a minimum capacity.
| query | The memory query to be restricted. |
| min_bytes | The minimum capacity to restrict to. |
| realm_status_t REALM_EXPORT realm_memory_query_restrict_to_address_space | ( | realm_memory_query_t | query, |
| realm_address_space_t | address_space | ||
| ) |
Restricts the memory query to address space.
| query | The memory query to be restricted. |
| address_space | The address space to restrict to. |
| realm_status_t REALM_EXPORT realm_memory_query_restrict_to_kind | ( | realm_memory_query_t | query, |
| realm_memory_kind_t | kind | ||
| ) |
Restricts the memory query to a specific kind.
| query | The memory query to be restricted. |
| kind | The kind of memory to restrict to. |
| realm_status_t REALM_EXPORT realm_processor_get_attributes | ( | realm_runtime_t | runtime, |
| realm_processor_t | proc, | ||
| realm_processor_attr_t * | attrs, | ||
| uint64_t * | values, | ||
| size_t | num | ||
| ) |
Returns the attributes of a processor.
| runtime | The runtime instance to use. | |
| proc | The processor to get the attributes of. | |
| attrs | The attributes to get. | |
| [out] | values | The values of the attributes. |
| num | The number of attributes to get. |
| realm_status_t REALM_EXPORT realm_processor_query_create | ( | realm_runtime_t | runtime, |
| realm_processor_query_t * | query | ||
| ) |
Creates a new processor query.
| machine | The machine instance. | |
| [out] | query | The processor query to be created. |
| realm_status_t REALM_EXPORT realm_processor_query_destroy | ( | realm_processor_query_t | query | ) |
Destroys a processor query.
| query | The processor query to be destroyed. |
| realm_status_t REALM_EXPORT realm_processor_query_iter | ( | realm_processor_query_t | query, |
| realm_processor_query_cb_t | cb, | ||
| void * | user_data, | ||
| size_t | max_queries | ||
| ) |
Iterates over the processors in the query.
| query | The processor query to be iterated over. |
| cb | The callback function to be called for each processor. |
| user_data | The user data to be passed to the callback function. |
| max_queries | The maximum number of processors to iterate over. |
| realm_status_t REALM_EXPORT realm_processor_query_restrict_to_address_space | ( | realm_processor_query_t | query, |
| realm_address_space_t | address_space | ||
| ) |
Restricts the processor query to address space.
| query | The processor query to be restricted. |
| address_space | The address space to restrict to. |
| realm_status_t REALM_EXPORT realm_processor_query_restrict_to_kind | ( | realm_processor_query_t | query, |
| realm_processor_kind_t | kind | ||
| ) |
Restricts the processor query to a specific kind.
| query | The processor query to be restricted. |
| kind | The kind of processor to restrict to. |
| realm_status_t REALM_EXPORT realm_processor_register_task_by_kind | ( | realm_runtime_t | runtime, |
| realm_processor_kind_t | target_kind, | ||
| realm_register_task_flags_t | flags, | ||
| realm_task_func_id_t | task_id, | ||
| realm_task_pointer_t | func, | ||
| void * | user_data, | ||
| size_t | user_data_len, | ||
| realm_event_t * | event | ||
| ) |
Registers a task with all processors whose kind matches that of target_kind.
| runtime | The runtime instance to use. | |
| target_kind | The kind of processor to register the task with. | |
| global | Registrations that are global are ones in which the registration only has to be done by one process in a multi-process realm. This has the requirement that the function is referenceable through calls such as dladdr and dlsym and that the function has the same offset across all processes in the realm. This usually requires the application to compile with -rdynamic. | |
| task_id | The ID of the task to be registered. | |
| func | The function pointer for the task. | |
| user_data | User data to pass to the task. | |
| user_data_len | The length of the user data. | |
| [out] | event | An event to signal upon task registration. |
| realm_status_t REALM_EXPORT realm_processor_spawn | ( | realm_runtime_t | runtime, |
| realm_processor_t | target_proc, | ||
| realm_task_func_id_t | task_id, | ||
| const void * | args, | ||
| size_t | arglen, | ||
| realm_profiling_request_set_t | prs, | ||
| realm_event_t | wait_on, | ||
| int | priority, | ||
| realm_event_t * | event | ||
| ) |
Spawns a task on a specific processor.
| runtime | The runtime instance to use. | |
| target_proc | The target processor for the task. | |
| task_id | The ID of the task to be spawned. | |
| args | The arguments for the task. | |
| arglen | The length of the arguments. | |
| prs | The profiling request set. | |
| wait_on | An event to wait on before spawning the task. | |
| priority | The priority of the task. | |
| [out] | event | An event to signal upon task completion. |
| realm_status_t REALM_EXPORT realm_region_instance_copy | ( | realm_runtime_t | runtime, |
| const realm_region_instance_copy_params_t * | instance_copy_params, | ||
| realm_profiling_request_set_t | prs, | ||
| realm_event_t | wait_on, | ||
| int | priority, | ||
| realm_event_t * | event | ||
| ) |
Copies data between region instances.
| runtime | The runtime instance to use. | |
| params | The parameters to copy the region instances. | |
| prs | The profiling request set. | |
| wait_on | The event to wait on before copying. | |
| priority | The priority of the copy. | |
| [out] | event | The event to signal upon copy completion. |
| realm_status_t REALM_EXPORT realm_region_instance_create | ( | realm_runtime_t | runtime, |
| const realm_region_instance_create_params_t * | instance_creation_params, | ||
| realm_profiling_request_set_t | prs, | ||
| realm_event_t | wait_on, | ||
| realm_region_instance_t * | instance, | ||
| realm_event_t * | event | ||
| ) |
Creates a new region instance.
| runtime | The runtime instance to use. | |
| instance_params | The parameters to create the region instance. | |
| prs | The profiling request set. | |
| wait_on | The event to wait on before creating the region instance. | |
| [out] | instance | The region instance to be created. |
| [out] | event | The event to signal upon region instance creation. |
| realm_status_t REALM_EXPORT realm_region_instance_destroy | ( | realm_runtime_t | runtime, |
| realm_region_instance_t | instance, | ||
| realm_event_t | wait_on | ||
| ) |
Destroys a region instance.
| runtime | The runtime instance to use. |
| instance | The region instance to destroy. |
| wait_on | The event to wait on before destroying the region instance. |
| realm_status_t REALM_EXPORT realm_region_instance_fetch_metadata | ( | realm_runtime_t | runtime, |
| realm_region_instance_t | instance, | ||
| realm_processor_t | target, | ||
| realm_event_t * | event | ||
| ) |
Fetches the metadata of a region instance.
| runtime | The runtime instance to use. | |
| instance | The region instance to fetch the metadata of. | |
| target | The target processor to fetch the metadata on. | |
| [out] | event | The event to signal upon metadata fetch completion. |
| realm_status_t REALM_EXPORT realm_region_instance_generate_external_resource_info | ( | realm_runtime_t | runtime, |
| realm_region_instance_t | instance, | ||
| const realm_index_space_t * | index_space, | ||
| const realm_field_id_t * | field_ids, | ||
| size_t | num_fields, | ||
| int | read_only, | ||
| realm_external_resource_t * | external_resource | ||
| ) |
Generates an external instance resource info for a region instance.
| runtime | The runtime instance to use. | |
| instance | The region instance to generate the external instance resource info for. | |
| index_space | The index space of the region instance. | |
| field_ids | The field ids of the region instance. | |
| num_fields | The number of fields of the region instance. | |
| read_only | Whether the external instance resource is read only. | |
| [out] | external_resource | The external instance resource info. It should be either realm_external_cuda_memory_resource_t or realm_external_system_memory_resource_t. It is caller's responsibility to allocate the memory for the external instance resource. |
| realm_status_t REALM_EXPORT realm_region_instance_get_attributes | ( | realm_runtime_t | runtime, |
| realm_region_instance_t | instance, | ||
| realm_region_instance_attr_t * | attrs, | ||
| realm_region_instance_attr_value_t * | values, | ||
| size_t | num | ||
| ) |
Gets the attributes of a region instance.
| runtime | The runtime instance to use. | |
| instance | The region instance to get the attributes of. | |
| attrs | The attributes to get. | |
| [out] | values | The values of the attributes. |
| num | The number of attributes to get. |
| realm_status_t REALM_EXPORT realm_runtime_collective_spawn | ( | realm_runtime_t | runtime, |
| realm_processor_t | target_proc, | ||
| realm_task_func_id_t | task_id, | ||
| const void * | args, | ||
| size_t | arglen, | ||
| realm_event_t | wait_on, | ||
| int | priority, | ||
| realm_event_t * | event | ||
| ) |
Spawns the task registered by the task id by task_id on the processor given by target_proc. This call has special meaning for multi-process realms as all processes calling this will perform a barrier and a single arbitrary process will be elected to launch the task on the processor. It is undefined if these arguments do not match across all processes calls in a multi-process invocation.
| runtime | The runtime instance to use. | |
| target_proc | The target processor for the task. | |
| task_id | The ID of the task to be spawned. | |
| args | This is a buffer of bytes of length arglen to be copied to the executor of the given task_id. | |
| arglen | The length of the arguments. | |
| wait_on | An event to wait on before spawning the task. | |
| priority | The priority of the task. | |
| [out] | event | An event to signal upon task completion. |
| realm_status_t REALM_EXPORT realm_runtime_create | ( | realm_runtime_t * | runtime | ) |
| realm_status_t REALM_EXPORT realm_runtime_destroy | ( | realm_runtime_t | runtime | ) |
| realm_status_t REALM_EXPORT realm_runtime_get_attributes | ( | realm_runtime_t | runtime, |
| realm_runtime_attr_t * | attrs, | ||
| uint64_t * | values, | ||
| size_t | num | ||
| ) |
Returns the attributes of a runtime.
| runtime | The runtime instance to use. |
| attrs | The attributes to get. |
| values | The values of the attributes. |
| num | The number of attributes to get. |
| realm_status_t REALM_EXPORT realm_runtime_get_memory_memory_affinity | ( | realm_runtime_t | runtime, |
| realm_memory_t | mem1, | ||
| realm_memory_t | mem2, | ||
| realm_affinity_details_t * | details | ||
| ) |
Checks if two memories have affinity. If there is a affinity, we can do one-hop copy between them.
| runtime | The runtime instance to use. | |
| mem1 | The first memory. | |
| mem2 | The second memory. | |
| [out] | details | The details of the affinity. |
| realm_status_t REALM_EXPORT realm_runtime_get_processor_memory_affinity | ( | realm_runtime_t | runtime, |
| realm_processor_t | proc, | ||
| realm_memory_t | mem, | ||
| realm_affinity_details_t * | details | ||
| ) |
Checks if a processor has affinity to a memory. If there is a affinity, the processor can access the memory directly.
| runtime | The runtime instance to use. | |
| proc | The processor. | |
| mem | The memory. | |
| [out] | details | The details of the affinity. |
| realm_status_t REALM_EXPORT realm_runtime_get_runtime | ( | realm_runtime_t * | runtime | ) |
| realm_status_t REALM_EXPORT realm_runtime_init | ( | realm_runtime_t | runtime, |
| int * | argc, | ||
| char *** | argv | ||
| ) |
| realm_status_t REALM_EXPORT realm_runtime_signal_shutdown | ( | realm_runtime_t | runtime, |
| realm_event_t | wait_on, | ||
| int | result_code | ||
| ) |
| realm_status_t REALM_EXPORT realm_runtime_wait_for_shutdown | ( | realm_runtime_t | runtime | ) |
| realm_status_t REALM_EXPORT realm_user_event_create | ( | realm_runtime_t | runtime, |
| realm_user_event_t * | event | ||
| ) |
Creates a new user event.
| [out] | event | The user event to be created. |
| realm_status_t REALM_EXPORT realm_user_event_trigger | ( | realm_runtime_t | runtime, |
| realm_user_event_t | event, | ||
| realm_event_t | wait_on, | ||
| int | ignore_faults | ||
| ) |
Triggers a user event.
| event | The user event to be triggered. |
| wait_on | The event to wait on. |
| ignore_faults | Whether to ignore any poison on the input events. |