Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
realm_c.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Stanford University, NVIDIA Corporation
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18// C-only header for Realm - mostly includes typedefs right now,
19// but may be expanded to provide C bindings for the Realm API
20
21#ifndef REALM_C_H
22#define REALM_C_H
23
24#include "realm/realm_config.h"
25
26#ifndef LEGION_USE_PYTHON_CFFI
27// for size_t
28#include <stddef.h>
29// TODO: Fix me, use dllimport / visibility from realm_exports.h
30#define REALM_EXPORT REALM_PUBLIC_API
31#else
32#define REALM_EXPORT
33#endif // LEGION_USE_PYTHON_CFFI
34
35// for uint64_t
36#include <stdint.h>
37
38#if defined(_WIN32)
39// Force a specific calling convention for function pointers
40#define REALM_FNPTR __stdcall
41#else
42#define REALM_FNPTR
43#endif
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49struct realm_runtime_st;
50typedef struct realm_runtime_st *realm_runtime_t;
51
52struct realm_profiling_request_set_st;
53typedef struct realm_profiling_request_set_st *realm_profiling_request_set_t;
54
55struct realm_processor_query_st;
56typedef struct realm_processor_query_st *realm_processor_query_t;
57
58struct realm_memory_query_st;
59typedef struct realm_memory_query_st *realm_memory_query_t;
60
61struct realm_sparsity_handle_st;
62typedef struct realm_sparsity_handle_st *realm_sparsity_handle_t;
63
64typedef unsigned long long realm_id_t;
70#define IDFMT "%llx" // TODO: name it to REALM_IDFMT
71
72typedef unsigned int realm_address_space_t;
73typedef unsigned realm_task_func_id_t;
76typedef unsigned realm_event_gen_t;
77typedef int realm_field_id_t;
78typedef unsigned long long realm_barrier_timestamp_t;
79
80// type of external resource
88
89// cuda memory external resource
91 int cuda_device_id; // the cuda device id
92 const void *base; // the base address of the cuda memory
93 size_t size; // the size of the cuda memory
94 int read_only; // whether the cuda memory is read only
96
97// system memory external resource
99 const void *base; // the base address of the system memory
100 size_t size; // the size of the system memory
101 int read_only; // whether the system memory is read only
103
104// the struct of different types of external resource
112
113typedef void *realm_coord_t;
114
115// data type range of realm region instance coordinate
117{
118 REALM_COORD_TYPE_LONG_LONG = 0, // the coordinate range is long long
119 REALM_COORD_TYPE_INT, // the coordinate range is int
121 REALM_COORD_TYPE_MAX = 0x7fffffffULL,
123
124// Currently, we only support dense index space
131
132// data type of region instance create params
134 realm_memory_t memory; // the memory where the region instance is created
135 realm_coord_t lower_bound; // the lower bound of the region instance
136 realm_coord_t upper_bound; // the upper bound of the region instance
137 size_t num_dims; // the number of dimensions of the region instance
138 realm_coord_type_t coord_type; // the data type of the coordinate
139 realm_sparsity_handle_t sparsity_map; // the sparsity map of the region instance
140 realm_field_id_t *field_ids; // the field ids of the region instance
141 size_t *field_sizes; // the field sizes of the region instance
142 size_t num_fields; // the number of fields of the region instance
143 size_t block_size; // the block size of the region instance
144 const realm_external_resource_t *external_resource; // the external resource of the
145 // region instance
147
149 realm_region_instance_t inst; // the region instance to be copied
150 realm_field_id_t field_id; // the field id of the field to be copied
151 size_t size; // the size of the field to be copied
153
155 realm_copy_src_dst_field_t *srcs; // the source fields to be copied
156 realm_copy_src_dst_field_t *dsts; // the destination fields to be copied
157 size_t num_fields; // the number of fields to be copied
158 realm_coord_t lower_bound; // the lower bound of the region instance
159 realm_coord_t upper_bound; // the upper bound of the region instance
160 size_t num_dims; // the number of dimensions of the region instance
161 realm_coord_type_t coord_type; // the data type of the coordinate
162 realm_sparsity_handle_t sparsity_map; // the sparsity map of the region instance
164
165#define REALM_NO_PROC ((realm_processor_t)0ULL)
166#define REALM_NO_MEM ((realm_memory_t)0ULL)
167#define REALM_NO_EVENT ((realm_event_t)0ULL)
168#define REALM_NO_USER_EVENT ((realm_user_event_t)0ULL)
169#define REALM_NO_INST ((realm_region_instance_t)0ULL)
170
171#define REALM_TASK_ID_PROCESSOR_NOP ((realm_task_func_id_t)0U)
172#define REALM_TASK_ID_PROCESSOR_INIT ((realm_task_func_id_t)1U)
173#define REALM_TASK_ID_PROCESSOR_SHUTDOWN ((realm_task_func_id_t)2U)
174#define REALM_TASK_ID_FIRST_AVAILABLE ((realm_task_func_id_t)4U)
175
176#define REALM_WAIT_INFINITE ((int64_t)INT64_MIN)
177
185
193
202
204{
205 REALM_RUNTIME_ATTR_ADDRESS_SPACE = 0x0ULL, // The total number of address spaces
206 REALM_RUNTIME_ATTR_LOCAL_ADDRESS_SPACE, // The address space of the current process
208 REALM_RUNTIME_ATTR_MAX = 0xFFFFFFFFFFFFFFFFULL,
210
217
224
225// Different Processor types
226// clang-format off
227#define REALM_PROCESSOR_KINDS(__op__) \
228 __op__(NO_KIND, "") \
229 __op__(TOC_PROC, "Throughput core") \
230 __op__(LOC_PROC, "Latency core") \
231 __op__(UTIL_PROC, "Utility core") \
232 __op__(IO_PROC, "I/O core") \
233 __op__(PROC_GROUP, "Processor group") \
234 __op__(PROC_SET, "Set of Processors for OpenMP/Kokkos etc.") \
235 __op__(OMP_PROC, "OpenMP (or similar) thread pool") \
236 __op__(PY_PROC, "Python interpreter")
237// clang-format on
238
240{
241#define C_ENUMS(name, desc) name,
243#undef C_ENUMS
245
246// Different Memory types
247// clang-format off
248#define REALM_MEMORY_KINDS(__op__) \
249 __op__(NO_MEMKIND, "") \
250 __op__(GLOBAL_MEM, "Guaranteed visible to all processors on all nodes (e.g. GASNet memory, universally slow)") \
251 __op__(SYSTEM_MEM, "Visible to all processors on a node") \
252 __op__(REGDMA_MEM, "Registered memory visible to all processors on a node, can be a target of RDMA") \
253 __op__(SOCKET_MEM, "Memory visible to all processors within a node, better performance to processors on same socket") \
254 __op__(Z_COPY_MEM, "Zero-Copy memory visible to all CPUs within a node and one or more GPUs") \
255 __op__(GPU_FB_MEM, "Framebuffer memory for one GPU and all its SMs") \
256 __op__(DISK_MEM, "Disk memory visible to all processors on a node") \
257 __op__(HDF_MEM, "HDF memory visible to all processors on a node") \
258 __op__(FILE_MEM, "file memory visible to all processors on a node") \
259 __op__(LEVEL3_CACHE, "CPU L3 Visible to all processors on the node, better performance to processors on same socket") \
260 __op__(LEVEL2_CACHE, "CPU L2 Visible to all processors on the node, better performance to one processor") \
261 __op__(LEVEL1_CACHE, "CPU L1 Visible to all processors on the node, better performance to one processor") \
262 __op__(GPU_MANAGED_MEM, "Managed memory that can be cached by either host or GPU") \
263 __op__(GPU_DYNAMIC_MEM, "Dynamically-allocated framebuffer memory for one GPU and all its SMs")
264// clang-format on
265
267{
268#define C_ENUMS(name, desc) name,
270#undef C_ENUMS
272
273// file modes - to be removed soon
284
286 unsigned bandwidth; // in MB/s
287 unsigned latency; // in nanoseconds
289
290// Prototype for a Realm task
291typedef void(REALM_FNPTR *realm_task_pointer_t)(const void * /*data*/, size_t /*datalen*/,
292 const void * /*userdata*/,
293 size_t /*userlen*/,
294 realm_processor_t /*proc_id*/);
295
296// error code
298{
299 // To comply with other C libraries, we use 0 for success, negative numbers for errors
304 -1000, // this is a soft error, the caller will expect to receive correct results
354
356
357// Callback function for processor query iteration.
359 void * /*user_data*/);
360
361// Callback function for memory query iteration.
363 void * /*user_data*/);
364
374
375/*
376 * @defgroup Runtime Runtime API
377 * @ingroup Realm
378 */
379
389
400
410
422 char ***argv);
423
435 realm_event_t wait_on,
436 int result_code);
437
447
469 realm_runtime_t runtime, realm_processor_t target_proc, realm_task_func_id_t task_id,
470 const void *args, size_t arglen, realm_event_t wait_on, int priority,
471 realm_event_t *event);
472
486 uint64_t *values, size_t num);
487
502 realm_affinity_details_t *details);
503
517 realm_affinity_details_t *details);
518
519/*
520 * @defgroup Processor Processor API
521 * @ingroup Realm
522 */
523
544 realm_runtime_t runtime, realm_processor_kind_t target_kind,
546 realm_task_pointer_t func, void *user_data, size_t user_data_len,
547 realm_event_t *event);
548
566 realm_runtime_t runtime, realm_processor_t target_proc, realm_task_func_id_t task_id,
567 const void *args, size_t arglen, realm_profiling_request_set_t prs,
568 realm_event_t wait_on, int priority, realm_event_t *event);
569
585 uint64_t *values, size_t num);
586
587/*
588 * @defgroup ProcessorQuery ProcessorQuery API
589 * @ingroup Realm
590 */
591
603
613
625
637
651 void *user_data,
652 size_t max_queries);
653
654/*
655 * @defgroup Memory Memory API
656 * @ingroup Realm
657 */
658
672 realm_memory_t mem,
673 realm_memory_attr_t *attrs,
674 uint64_t *values, size_t num);
675
676/*
677 * @defgroup MemoryQuery MemoryQuery API
678 * @ingroup Realm
679 */
680
691 realm_memory_query_t *query);
692
702
714
725 realm_memory_query_t query, realm_address_space_t address_space);
726
738
752 void *user_data, size_t max_queries);
753
754/*
755 * @defgroup Event Event API
756 * @ingroup Realm
757 */
758
772 int64_t max_ns, int *poisoned);
773
787 const realm_event_t *wait_for,
788 size_t num_events, realm_event_t *event,
789 int ignore_faults);
790
803 realm_event_t event,
804 int *has_triggered, int *poisoned);
805
806/*
807 * @defgroup UserEvent UserEvent API
808 * @ingroup Realm
809 */
810
820 realm_user_event_t *event);
821
833 realm_user_event_t event,
834 realm_event_t wait_on,
835 int ignore_faults);
836
837/*
838 * @defgroup RegionInstance RegionInstance API
839 * @ingroup Realm
840 */
841
856 realm_runtime_t runtime,
857 const realm_region_instance_create_params_t *instance_creation_params,
859 realm_region_instance_t *instance, realm_event_t *event);
860
875 realm_runtime_t runtime,
876 const realm_region_instance_copy_params_t *instance_copy_params,
877 realm_profiling_request_set_t prs, realm_event_t wait_on, int priority,
878 realm_event_t *event);
879
891 realm_runtime_t runtime, realm_region_instance_t instance, realm_event_t wait_on);
892
906 realm_event_t *event);
907
923 size_t num);
924
944 const realm_index_space_t *index_space, const realm_field_id_t *field_ids,
945 size_t num_fields, int read_only, realm_external_resource_t *external_resource);
946
958 realm_runtime_t runtime, const realm_external_resource_t *external_resource,
959 realm_memory_t *memory);
960#ifdef __cplusplus
961}
962#endif
963
964#endif // ifndef REALM_C_H
#define REALM_MEMORY_KINDS(__op__)
Definition realm_c.h:248
realm_status_t RealmStatus
Definition realm_c.h:355
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.
int realm_field_id_t
Definition realm_c.h:77
struct realm_runtime_st * realm_runtime_t
Definition realm_c.h:50
realm_coord_type_enum
Definition realm_c.h:117
@ REALM_COORD_TYPE_MAX
Definition realm_c.h:121
@ REALM_COORD_TYPE_LONG_LONG
Definition realm_c.h:118
@ REALM_COORD_TYPE_NUM
Definition realm_c.h:120
@ REALM_COORD_TYPE_INT
Definition realm_c.h:119
realm_processor_attr_enum
Definition realm_c.h:187
@ REALM_PROCESSOR_ATTR_KIND
Definition realm_c.h:188
@ REALM_PROCESSOR_ATTR_ADDRESS_SPACE
Definition realm_c.h:189
@ REALM_PROCESSOR_ATTR_MAX
Definition realm_c.h:191
@ REALM_PROCESSOR_ATTR_NUM
Definition realm_c.h:190
int realm_custom_serdez_id_t
Definition realm_c.h:75
enum realm_region_instance_attr_enum realm_region_instance_attr_t
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.
realm_status_t REALM_EXPORT realm_memory_query_create(realm_runtime_t runtime, realm_memory_query_t *query)
Creates a new memory query.
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....
realm_status_t REALM_EXPORT realm_runtime_wait_for_shutdown(realm_runtime_t runtime)
Waits for the Realm runtime to shut down.
enum realm_status_enum realm_status_t
struct realm_sparsity_handle_st * realm_sparsity_handle_t
Definition realm_c.h:62
realm_status_t(REALM_FNPTR * realm_memory_query_cb_t)(realm_memory_t, void *)
Definition realm_c.h:362
realm_processor_kind_t
Definition realm_c.h:240
unsigned long long realm_id_t
Definition realm_c.h:64
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.
struct realm_memory_query_st * realm_memory_query_t
Definition realm_c.h:59
#define REALM_PROCESSOR_KINDS(__op__)
Definition realm_c.h:227
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.
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 ...
#define REALM_FNPTR
Definition realm_c.h:42
realm_status_t REALM_EXPORT realm_processor_query_create(realm_runtime_t runtime, realm_processor_query_t *query)
Creates a new processor query.
realm_status_t REALM_EXPORT realm_runtime_get_runtime(realm_runtime_t *runtime)
Returns the current Realm runtime instance.
enum realm_register_task_flags realm_register_task_flags_t
realm_status_t REALM_EXPORT realm_memory_query_destroy(realm_memory_query_t query)
Destroys a memory query.
realm_status_t REALM_EXPORT realm_runtime_create(realm_runtime_t *runtime)
Creates a new Realm runtime instance.
realm_memory_attr_enum
Definition realm_c.h:195
@ REALM_MEMORY_ATTR_CAPACITY
Definition realm_c.h:198
@ REALM_MEMORY_ATTR_KIND
Definition realm_c.h:196
@ REALM_MEMORY_ATTR_MAX
Definition realm_c.h:200
@ REALM_MEMORY_ATTR_NUM
Definition realm_c.h:199
@ REALM_MEMORY_ATTR_ADDRESS_SPACE
Definition realm_c.h:197
realm_register_task_flags
Definition realm_c.h:179
@ REALM_REGISTER_TASK_NUM
Definition realm_c.h:182
@ REALM_REGISTER_TASK_MAX
Definition realm_c.h:183
@ REALM_REGISTER_TASK_GLOBAL
Definition realm_c.h:181
@ REALM_REGISTER_TASK_DEFAULT
Definition realm_c.h:180
enum realm_processor_attr_enum realm_processor_attr_t
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.
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.
realm_external_resource_type_enum
Definition realm_c.h:82
@ REALM_EXTERNAL_RESOURCE_TYPE_CUDA_MEMORY
Definition realm_c.h:83
@ REALM_EXTERNAL_RESOURCE_TYPE_MAX
Definition realm_c.h:86
@ REALM_EXTERNAL_RESOURCE_TYPE_NUM
Definition realm_c.h:85
@ REALM_EXTERNAL_RESOURCE_TYPE_SYSTEM_MEMORY
Definition realm_c.h:84
realm_file_mode_t
Definition realm_c.h:275
@ LEGION_FILE_READ_WRITE
Definition realm_c.h:281
@ LEGION_FILE_READ_ONLY
Definition realm_c.h:280
@ REALM_FILE_CREATE
Definition realm_c.h:278
@ REALM_FILE_READ_ONLY
Definition realm_c.h:276
@ REALM_FILE_READ_WRITE
Definition realm_c.h:277
@ LEGION_FILE_CREATE
Definition realm_c.h:282
realm_status_t REALM_EXPORT realm_processor_query_destroy(realm_processor_query_t query)
Destroys a processor query.
enum realm_runtime_attr_enum realm_runtime_attr_t
realm_id_t realm_user_event_t
Definition realm_c.h:66
realm_id_t realm_event_t
Definition realm_c.h:65
struct realm_external_system_memory_resource_st realm_external_system_memory_resource_t
realm_id_t realm_processor_t
Definition realm_c.h:67
realm_id_t realm_region_instance_t
Definition realm_c.h:69
#define REALM_EXPORT
Definition realm_c.h:30
realm_status_t REALM_EXPORT realm_runtime_destroy(realm_runtime_t runtime)
Destroys a Realm runtime instance, please make sure all works are finished and the runtime has been s...
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.
realm_status_t REALM_EXPORT realm_runtime_init(realm_runtime_t runtime, int *argc, char ***argv)
Creates and initializes the Realm runtime with command-line arguments.
unsigned long long realm_barrier_timestamp_t
Definition realm_c.h:78
realm_status_t REALM_EXPORT realm_user_event_create(realm_runtime_t runtime, realm_user_event_t *event)
Creates a new user event.
int realm_reduction_op_id_t
Definition realm_c.h:74
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.
realm_status_t REALM_EXPORT realm_runtime_signal_shutdown(realm_runtime_t runtime, realm_event_t wait_on, int result_code)
Shuts down the Realm runtime.
realm_memory_kind_t
Definition realm_c.h:267
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.
realm_status_t(REALM_FNPTR * realm_processor_query_cb_t)(realm_processor_t, void *)
Definition realm_c.h:358
enum realm_coord_type_enum realm_coord_type_t
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.
realm_id_t realm_memory_t
Definition realm_c.h:68
struct realm_external_cuda_memory_resource_st realm_external_cuda_memory_resource_t
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.
realm_status_enum
Definition realm_c.h:298
@ REALM_ERROR
Definition realm_c.h:301
@ REALM_TOPOLOGY_ERROR_WIN32_NO_PROC_INFO
Definition realm_c.h:317
@ REALM_SUCCESS
Definition realm_c.h:300
@ REALM_EXTERNAL_RESOURCE_ERROR_INVALID_RESOURCE
Definition realm_c.h:344
@ REALM_EXTERNAL_RESOURCE_ERROR_INVALID_CUDA_DEVICE_ID
Definition realm_c.h:347
@ REALM_REGION_INSTANCE_ERROR_INVALID_DIMS
Definition realm_c.h:337
@ REALM_PROCESSOR_QUERY_ERROR_INVALID_QUERY
Definition realm_c.h:332
@ REALM_TOPOLOGY_ERROR_LINUX_NO_CPU_DIR
Definition realm_c.h:311
@ REALM_REGION_INSTANCE_ERROR_INVALID_COORD_TYPE
Definition realm_c.h:342
@ REALM_MEMORY_QUERY_ERROR_INVALID_CALLBACK
Definition realm_c.h:335
@ REALM_REGION_INSTANCE_ERROR_INVALID_PARAMS
Definition realm_c.h:341
@ REALM_TOPOLOGY_ERROR_HWLOC_TYPE_DEPTH_UNKNOWN
Definition realm_c.h:315
@ REALM_TOPOLOGY_ERROR_NO_AFFINITY
Definition realm_c.h:310
@ REALM_TOPOLOGY_ERROR_LINUX_NO_NUMA_DIR
Definition realm_c.h:312
@ REALM_RUNTIME_ERROR_INVALID_RUNTIME
Definition realm_c.h:318
@ REALM_RUNTIME_ERROR_NOT_INITIALIZED
Definition realm_c.h:319
@ REALM_REGION_INSTANCE_ERROR_INVALID_ATTRIBUTE
Definition realm_c.h:343
@ REALM_PROCESSOR_QUERY_ERROR_INVALID_CALLBACK
Definition realm_c.h:333
@ REALM_EVENT_ERROR_INVALID_EVENT
Definition realm_c.h:331
@ REALM_MODULE_CONFIG_ERROR_NO_RESOURCE
Definition realm_c.h:352
@ REALM_REGION_INSTANCE_ERROR_INVALID_EVENT
Definition realm_c.h:340
@ REALM_REGION_INSTANCE_ERROR_INVALID_INSTANCE
Definition realm_c.h:339
@ REALM_EXTERNAL_RESOURCE_ERROR_INVALID_BASE
Definition realm_c.h:345
@ REALM_PROCESSOR_ERROR_INVALID_ATTRIBUTE
Definition realm_c.h:326
@ REALM_RUNTIME_ERROR_INVALID_AFFINITY
Definition realm_c.h:321
@ REALM_MEMORY_ERROR_INVALID_MEMORY
Definition realm_c.h:323
@ REALM_ERROR_INVALID_PARAMETER
Definition realm_c.h:302
@ REALM_RUNTIME_ERROR_INVALID_ATTRIBUTE
Definition realm_c.h:320
@ REALM_PROCESSOR_ERROR_INVALID_PROCESSOR
Definition realm_c.h:324
@ REALM_EXTERNAL_RESOURCE_ERROR_INVALID_PARAMS
Definition realm_c.h:349
@ REALM_PROCESSOR_ERROR_INVALID_TASK_FUNCTION
Definition realm_c.h:327
@ REALM_MEMORY_ERROR_INVALID_MEMORY_KIND
Definition realm_c.h:329
@ REALM_CUDA_ERROR_NOT_ENABLED
Definition realm_c.h:350
@ REALM_MEMORY_QUERY_ERROR_INVALID_QUERY
Definition realm_c.h:334
@ REALM_ARGUMENT_ERROR_WITH_EXTRA_FLAGS
Definition realm_c.h:303
@ REALM_MODULE_CONFIG_ERROR_INVALID_NAME
Definition realm_c.h:351
@ REALM_ARGUMENT_ERROR_UNKNOWN_INTEGER_UNIT
Definition realm_c.h:306
@ REALM_MEMORY_ERROR_INVALID_ATTRIBUTE
Definition realm_c.h:330
@ REALM_TOPOLOGY_ERROR_HWLOC_LOAD_TOPO_FAILED
Definition realm_c.h:314
@ REALM_EXTERNAL_RESOURCE_ERROR_INVALID_SIZE
Definition realm_c.h:346
@ REALM_REGION_INSTANCE_ERROR_INVALID_FIELDS
Definition realm_c.h:338
@ REALM_ARGUMENT_ERROR_METHOD_RETURN_FALSE
Definition realm_c.h:309
@ REALM_EXTERNAL_RESOURCE_ERROR_INVALID_TYPE
Definition realm_c.h:348
@ REALM_PROCESSOR_ERROR_OUTSIDE_TASK
Definition realm_c.h:328
@ REALM_MACHINE_ERROR_INVALID_MACHINE
Definition realm_c.h:322
@ REALM_TOPOLOGY_ERROR_HWLOC_INIT_FAILED
Definition realm_c.h:313
@ REALM_PROCESSOR_ERROR_INVALID_PROCESSOR_KIND
Definition realm_c.h:325
@ REALM_TOPOLOGY_ERROR_ENV_LOAD_FAILED
Definition realm_c.h:316
@ REALM_ARGUMENT_ERROR_UNKNOWN_INTEGER
Definition realm_c.h:305
@ REALM_ARGUMENT_ERROR_OUTPUT_STRING_TOO_SHORT
Definition realm_c.h:308
@ REALM_ARGUMENT_ERROR_MISSING_INPUT
Definition realm_c.h:307
@ REALM_ADDRESS_SPACE_INVALID
Definition realm_c.h:336
unsigned int realm_address_space_t
Definition realm_c.h:72
void * realm_coord_t
Definition realm_c.h:113
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.
unsigned realm_event_gen_t
Definition realm_c.h:76
void(REALM_FNPTR * realm_task_pointer_t)(const void *, size_t, const void *, size_t, realm_processor_t)
Definition realm_c.h:291
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.
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.
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.
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.
struct realm_processor_query_st * realm_processor_query_t
Definition realm_c.h:56
realm_region_instance_attr_enum
Definition realm_c.h:212
@ REALM_REGION_INSTANCE_ATTR_MAX
Definition realm_c.h:215
@ REALM_REGION_INSTANCE_ATTR_NUM
Definition realm_c.h:214
@ REALM_REGION_INSTANCE_ATTR_MEMORY
Definition realm_c.h:213
unsigned realm_task_func_id_t
Definition realm_c.h:73
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.
struct realm_external_resource_st realm_external_resource_t
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.
struct realm_profiling_request_set_st * realm_profiling_request_set_t
Definition realm_c.h:53
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.
enum realm_external_resource_type_enum realm_external_resource_type_t
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.
realm_status_t REALM_EXPORT realm_get_library_version(const char **version)
Returns the version of the Realm library.
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.
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.
realm_runtime_attr_enum
Definition realm_c.h:204
@ REALM_RUNTIME_ATTR_NUM
Definition realm_c.h:207
@ REALM_RUNTIME_ATTR_MAX
Definition realm_c.h:208
@ REALM_RUNTIME_ATTR_LOCAL_ADDRESS_SPACE
Definition realm_c.h:206
@ REALM_RUNTIME_ATTR_ADDRESS_SPACE
Definition realm_c.h:205
enum realm_memory_attr_enum realm_memory_attr_t
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.
#define C_ENUMS(name, desc)
Definition realm_c.h:241
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.
Definition realm_c.h:285
unsigned bandwidth
Definition realm_c.h:286
unsigned latency
Definition realm_c.h:287
Definition realm_c.h:148
realm_region_instance_t inst
Definition realm_c.h:149
size_t size
Definition realm_c.h:151
realm_field_id_t field_id
Definition realm_c.h:150
const void * base
Definition realm_c.h:92
int read_only
Definition realm_c.h:94
int cuda_device_id
Definition realm_c.h:91
size_t size
Definition realm_c.h:93
Definition realm_c.h:105
realm_external_system_memory_resource_t system_memory
Definition realm_c.h:109
realm_external_resource_type_t type
Definition realm_c.h:106
union realm_external_resource_st::@25 resource
realm_external_cuda_memory_resource_t cuda_memory
Definition realm_c.h:108
const void * base
Definition realm_c.h:99
size_t size
Definition realm_c.h:100
int read_only
Definition realm_c.h:101
Definition realm_c.h:125
size_t num_dims
Definition realm_c.h:128
realm_coord_type_t coord_type
Definition realm_c.h:129
realm_coord_t lower_bound
Definition realm_c.h:126
realm_coord_t upper_bound
Definition realm_c.h:127
Definition realm_c.h:218
realm_memory_t memory
Definition realm_c.h:221
realm_region_instance_attr_t type
Definition realm_c.h:219
union realm_region_instance_attr_value_t::@26 value
Definition realm_c.h:154
size_t num_dims
Definition realm_c.h:160
realm_coord_type_t coord_type
Definition realm_c.h:161
realm_copy_src_dst_field_t * dsts
Definition realm_c.h:156
realm_copy_src_dst_field_t * srcs
Definition realm_c.h:155
realm_sparsity_handle_t sparsity_map
Definition realm_c.h:162
realm_coord_t lower_bound
Definition realm_c.h:158
size_t num_fields
Definition realm_c.h:157
realm_coord_t upper_bound
Definition realm_c.h:159
realm_coord_t lower_bound
Definition realm_c.h:135
size_t num_fields
Definition realm_c.h:142
size_t block_size
Definition realm_c.h:143
realm_field_id_t * field_ids
Definition realm_c.h:140
size_t num_dims
Definition realm_c.h:137
realm_coord_t upper_bound
Definition realm_c.h:136
realm_sparsity_handle_t sparsity_map
Definition realm_c.h:139
const realm_external_resource_t * external_resource
Definition realm_c.h:144
realm_memory_t memory
Definition realm_c.h:134
realm_coord_type_t coord_type
Definition realm_c.h:138
size_t * field_sizes
Definition realm_c.h:141