Legion Runtime
Loading...
Searching...
No Matches
runtime.h
Go to the documentation of this file.
1/* Copyright 2026 Stanford University, NVIDIA Corporation
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef __LEGION_RUNTIME_H__
17#define __LEGION_RUNTIME_H__
18
24#include "legion/api/buffers.h"
25#include "legion/api/functors.h"
26#include "legion/api/future.h"
30#include "legion/api/values.h"
31
32#define LEGION_PRINT_ONCE(runtime, ctx, file, fmt, ...) \
33 { \
34 char message[4096]; \
35 snprintf(message, 4096, fmt, ##__VA_ARGS__); \
36 runtime->print_once(ctx, file, message); \
37 }
38
39namespace Legion {
40
46 struct InputArgs {
47 public:
48 char** argv;
49 int argc;
50 };
51
57 Machine machine;
58 Runtime* runtime;
59 std::set<Processor> local_procs;
60 UntypedBuffer buffer;
61 };
62
76 public:
78 bool leaf = false, bool inner = false, bool idempotent = false);
79 public:
80 bool leaf;
81 bool inner;
82 bool idempotent;
83 };
84
108 class Runtime {
109 protected:
110 // The Runtime bootstraps itself and should
111 // never need to be explicitly created.
112 friend class Internal::Runtime;
113 friend class Future;
114 Runtime(Internal::Runtime* rt);
115 public:
116 //------------------------------------------------------------------------
117 // Index Space Operations
118 //------------------------------------------------------------------------
120
135 Context ctx, const Domain& bounds, TypeTag type_tag = 0,
136 const char* provenance = nullptr, const bool take_ownership = false);
137 // Template version
138 template<int DIM, typename COORD_T>
139 IndexSpaceT<DIM, COORD_T> create_index_space(
140 Context ctx, const Rect<DIM, COORD_T>& bounds,
141 const char* provenance = nullptr);
142 template<int DIM, typename COORD_T>
143 IndexSpaceT<DIM, COORD_T> create_index_space(
144 Context ctx, const DomainT<DIM, COORD_T>& bounds,
145 const char* provenance = nullptr, const bool take_ownership = false);
148
162 Context ctx, size_t dimensions, const Future& f, TypeTag type_tag = 0,
163 const char* provenance = nullptr);
164 template<int DIM, typename COORD_T>
165 IndexSpaceT<DIM, COORD_T> create_index_space(
166 Context ctx, const Future& f, const char* provenance = nullptr);
169
178 Context ctx, const std::vector<DomainPoint>& points,
179 const char* provenance = nullptr);
180 // Template version
181 template<int DIM, typename COORD_T>
182 IndexSpaceT<DIM, COORD_T> create_index_space(
183 Context ctx, const std::vector<Point<DIM, COORD_T> >& points,
184 const char* provenance = nullptr);
187
196 Context ctx, const std::vector<Domain>& rects,
197 const char* provenance = nullptr);
198 // Template version
199 template<int DIM, typename COORD_T>
200 IndexSpaceT<DIM, COORD_T> create_index_space(
201 Context ctx, const std::vector<Rect<DIM, COORD_T> >& rects,
202 const char* provenance = nullptr);
205
215 Context ctx, const std::vector<IndexSpace>& spaces,
216 const char* provenance = nullptr);
217 // Template version
218 template<int DIM, typename COORD_T>
219 IndexSpaceT<DIM, COORD_T> union_index_spaces(
220 Context ctx, const std::vector<IndexSpaceT<DIM, COORD_T> >& spaces,
221 const char* provenance = nullptr);
224
234 Context ctx, const std::vector<IndexSpace>& spaces,
235 const char* provenance = nullptr);
236 // Template version
237 template<int DIM, typename COORD_T>
238 IndexSpaceT<DIM, COORD_T> intersect_index_spaces(
239 Context ctx, const std::vector<IndexSpaceT<DIM, COORD_T> >& spaces,
240 const char* provenance = nullptr);
243
250 Context ctx, IndexSpace left, IndexSpace right,
251 const char* provenance = nullptr);
252 // Template version
253 template<int DIM, typename COORD_T>
254 IndexSpaceT<DIM, COORD_T> subtract_index_spaces(
255 Context ctx, IndexSpaceT<DIM, COORD_T> left,
256 IndexSpaceT<DIM, COORD_T> right, const char* provenance = nullptr);
258
265 LEGION_DEPRECATED(
266 "Use the new index space creation routines with a "
267 "single domain or rectangle.")
268 IndexSpace create_index_space(Context ctx, size_t max_num_elmts);
276 LEGION_DEPRECATED(
277 "Use the new index space creation routines with a "
278 "single domain or rectangle.")
279 IndexSpace create_index_space(Context ctx, const std::set<Domain>& domains);
290 void create_shared_ownership(Context ctx, IndexSpace handle);
302 Context ctx, IndexSpace handle, const bool unordered = false,
303 const bool recurse = true, const char* provenance = nullptr);
304 public:
315 void create_shared_ownership(Context ctx, IndexPartition handle);
327 Context ctx, IndexPartition handle, const bool unordered = false,
328 const bool recurse = true, const char* provenance = nullptr);
329 public:
330 //------------------------------------------------------------------------
331 // Dependent Partitioning Operations
332 //------------------------------------------------------------------------
334
355 Context ctx, IndexSpace parent, IndexSpace color_space,
356 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
357 const char* provenance = nullptr);
358 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
360 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
361 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
362 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
363 const char* provenance = nullptr);
366
384 Context ctx, IndexSpace parent,
385 const std::map<DomainPoint, int>& weights, IndexSpace color_space,
386 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
387 const char* provenance = nullptr);
388 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
390 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
391 const std::map<Point<COLOR_DIM, COLOR_COORD_T>, int>& weights,
392 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
393 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
394 const char* provenance = nullptr);
395 // 64-bit versions
397 Context ctx, IndexSpace parent,
398 const std::map<DomainPoint, size_t>& weights, IndexSpace color_space,
399 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
400 const char* provenance = nullptr);
401 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
403 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
404 const std::map<Point<COLOR_DIM, COLOR_COORD_T>, size_t>& weights,
405 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
406 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
407 const char* provenance = nullptr);
408 // Alternate versions of the above method that take a future map where
409 // the values in the future map will be interpretted as integer weights
410 // You can use this method with both 32 and 64 bit weights
412 Context ctx, IndexSpace parent, const FutureMap& weights,
413 IndexSpace color_space, size_t granularity = 1,
414 Color color = LEGION_AUTO_GENERATE_ID,
415 const char* provenance = nullptr);
416 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
418 Context ctx, IndexSpaceT<DIM, COORD_T> parent, const FutureMap& weights,
419 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
420 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
421 const char* provenance = nullptr);
424
449 Context ctx, IndexSpace parent, IndexPartition handle1,
450 IndexPartition handle2, IndexSpace color_space,
451 PartitionKind part_kind = LEGION_COMPUTE_KIND,
452 Color color = LEGION_AUTO_GENERATE_ID,
453 const char* provenance = nullptr);
454 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
456 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
457 IndexPartitionT<DIM, COORD_T> handle1,
458 IndexPartitionT<DIM, COORD_T> handle2,
459 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
460 PartitionKind part_kind = LEGION_COMPUTE_KIND,
461 Color color = LEGION_AUTO_GENERATE_ID,
462 const char* provenance = nullptr);
465
491 Context ctx, IndexSpace parent, IndexPartition handle1,
492 IndexPartition handle2, IndexSpace color_space,
493 PartitionKind part_kind = LEGION_COMPUTE_KIND,
494 Color color = LEGION_AUTO_GENERATE_ID,
495 const char* provenance = nullptr);
496 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
498 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
499 IndexPartitionT<DIM, COORD_T> handle1,
500 IndexPartitionT<DIM, COORD_T> handle2,
501 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
502 PartitionKind part_kind = LEGION_COMPUTE_KIND,
503 Color color = LEGION_AUTO_GENERATE_ID,
504 const char* provenance = nullptr);
507
528 Context ctx, IndexSpace parent, IndexPartition partition,
529 PartitionKind part_kind = LEGION_COMPUTE_KIND,
530 Color color = LEGION_AUTO_GENERATE_ID, bool dominates = false,
531 const char* provenance = nullptr);
532 template<int DIM, typename COORD_T>
534 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
535 IndexPartitionT<DIM, COORD_T> partition,
536 PartitionKind part_kind = LEGION_COMPUTE_KIND,
537 Color color = LEGION_AUTO_GENERATE_ID, bool dominates = false,
538 const char* provenance = nullptr);
541
567 Context ctx, IndexSpace parent, IndexPartition handle1,
568 IndexPartition handle2, IndexSpace color_space,
569 PartitionKind part_kind = LEGION_COMPUTE_KIND,
570 Color color = LEGION_AUTO_GENERATE_ID,
571 const char* provenance = nullptr);
572 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
574 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
575 IndexPartitionT<DIM, COORD_T> handle1,
576 IndexPartitionT<DIM, COORD_T> handle2,
577 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
578 PartitionKind part_kind = LEGION_COMPUTE_KIND,
579 Color color = LEGION_AUTO_GENERATE_ID,
580 const char* provenance = nullptr);
583
609 Context ctx, IndexPartition handle1, IndexPartition handle2,
610 std::map<IndexSpace, IndexPartition>& handles,
611 PartitionKind part_kind = LEGION_COMPUTE_KIND,
612 Color color = LEGION_AUTO_GENERATE_ID,
613 const char* provenance = nullptr);
614 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
616 Context ctx, IndexPartitionT<DIM, COORD_T> handle1,
617 IndexPartitionT<DIM, COORD_T> handle2,
618 typename std::map<
619 IndexSpaceT<DIM, COORD_T>, IndexPartitionT<DIM, COORD_T> >& handles,
620 PartitionKind part_kind = LEGION_COMPUTE_KIND,
621 Color color = LEGION_AUTO_GENERATE_ID,
622 const char* provenance = nullptr);
625
650 Context ctx, LogicalRegion domain, LogicalRegion domain_parent,
651 FieldID domain_fid, IndexSpace range, MapperID id = 0,
652 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
653 const char* provenance = nullptr);
654 void create_bidirectional_association(
655 Context ctx, LogicalRegion domain, LogicalRegion domain_parent,
656 FieldID domain_fid, LogicalRegion range, LogicalRegion range_parent,
657 FieldID range_fid, MapperID id = 0, MappingTagID tag = 0,
658 UntypedBuffer map_arg = UntypedBuffer(),
659 const char* provenance = nullptr);
660 // Template versions
661 template<int DIM1, typename COORD_T1, int DIM2, typename COORD_T2>
663 Context ctx, LogicalRegionT<DIM1, COORD_T1> domain,
664 LogicalRegionT<DIM1, COORD_T1> domain_parent,
665 FieldID domain_fid, // type: Point<DIM2,COORD_T2>
666 IndexSpaceT<DIM2, COORD_T2> range, MapperID id = 0,
667 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
668 const char* provenance = nullptr);
669 template<int DIM1, typename COORD_T1, int DIM2, typename COORD_T2>
670 void create_bidirectional_association(
671 Context ctx, LogicalRegionT<DIM1, COORD_T1> domain,
672 LogicalRegionT<DIM1, COORD_T1> domain_parent,
673 FieldID domain_fid, // type: Point<DIM2,COORD_T2>
674 LogicalRegionT<DIM2, COORD_T2> range,
675 LogicalRegionT<DIM2, COORD_T2> range_parent,
676 FieldID range_fid, // type: Point<DIM1,COORD_T1>
677 MapperID id = 0, MappingTagID tag = 0,
678 UntypedBuffer map_arg = UntypedBuffer(),
679 const char* provenance = nullptr);
682
708 Context ctx, IndexSpace parent, IndexSpace color_space,
709 DomainTransform transform, Domain extent,
710 PartitionKind part_kind = LEGION_COMPUTE_KIND,
711 Color color = LEGION_AUTO_GENERATE_ID,
712 const char* provenance = nullptr);
713 // Template version
714 template<int DIM, int COLOR_DIM, typename COORD_T>
716 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
717 IndexSpaceT<COLOR_DIM, COORD_T> color_space,
718 Transform<DIM, COLOR_DIM, COORD_T> transform, Rect<DIM, COORD_T> extent,
719 PartitionKind part_kind = LEGION_COMPUTE_KIND,
720 Color color = LEGION_AUTO_GENERATE_ID,
721 const char* provenance = nullptr);
724
740 Context ctx, IndexSpace parent, DomainPoint blocking_factor,
741 Color color = LEGION_AUTO_GENERATE_ID,
742 const char* provenance = nullptr);
743 // Template version
744 template<int DIM, typename COORD_T>
746 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
747 Point<DIM, COORD_T> blocking_factor,
748 Color color = LEGION_AUTO_GENERATE_ID,
749 const char* provenance = nullptr);
763 Context ctx, IndexSpace parent, DomainPoint blockify_factor,
764 DomainPoint origin, Color color = LEGION_AUTO_GENERATE_ID,
765 const char* provenance = nullptr);
766 // Template version
767 template<int DIM, typename COORD_T>
769 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
770 Point<DIM, COORD_T> blocking_factor, Point<DIM, COORD_T> origin,
771 Color color = LEGION_AUTO_GENERATE_ID,
772 const char* provenance = nullptr);
775
798 Context ctx, IndexSpace parent,
799 const std::map<DomainPoint, Domain>& domains, IndexSpace color_space,
800 bool perform_intersections = true,
801 PartitionKind part_kind = LEGION_COMPUTE_KIND,
802 Color color = LEGION_AUTO_GENERATE_ID, const char* provenance = nullptr,
803 bool take_ownership = false);
804 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
806 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
807 const std::map<Point<COLOR_DIM, COLOR_COORD_T>, DomainT<DIM, COORD_T> >&
808 domains,
809 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
810 bool perform_intersections = true,
811 PartitionKind part_kind = LEGION_COMPUTE_KIND,
812 Color color = LEGION_AUTO_GENERATE_ID, const char* provenance = nullptr,
813 bool take_ownership = false);
832 Context ctx, IndexSpace parent, const FutureMap& domain_future_map,
833 IndexSpace color_space, bool perform_intersections = true,
834 PartitionKind part_kind = LEGION_COMPUTE_KIND,
835 Color color = LEGION_AUTO_GENERATE_ID,
836 const char* provenance = nullptr);
837 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
839 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
840 const FutureMap& domain_future_map,
841 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
842 bool perform_intersections = true,
843 PartitionKind part_kind = LEGION_COMPUTE_KIND,
844 Color color = LEGION_AUTO_GENERATE_ID,
845 const char* provenance = nullptr);
848
865 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
867 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
868 const std::map<
869 Point<COLOR_DIM, COLOR_COORD_T>, std::vector<Rect<DIM, COORD_T> > >&
870 rectangles,
871 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
872 bool perform_intersections = true,
873 PartitionKind part_kind = LEGION_COMPUTE_KIND,
874 Color color = LEGION_AUTO_GENERATE_ID, const char* provenance = nullptr,
875 bool collective = false);
878
907 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
908 IndexSpace color_space, Color color = LEGION_AUTO_GENERATE_ID,
909 MapperID id = 0, MappingTagID tag = 0,
910 PartitionKind part_kind = LEGION_DISJOINT_KIND,
911 UntypedBuffer map_arg = UntypedBuffer(),
912 const char* provenance = nullptr);
913 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
915 Context ctx, LogicalRegionT<DIM, COORD_T> handle,
916 LogicalRegionT<DIM, COORD_T> parent,
917 FieldID fid, // type: Point<COLOR_DIM,COLOR_COORD_T>
918 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
919 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
920 MappingTagID tag = 0, PartitionKind part_kind = LEGION_DISJOINT_KIND,
921 UntypedBuffer map_arg = UntypedBuffer(),
922 const char* provenance = nullptr);
925
959 Context ctx, IndexSpace handle, LogicalPartition projection,
960 LogicalRegion parent, FieldID fid, IndexSpace color_space,
961 PartitionKind part_kind = LEGION_COMPUTE_KIND,
962 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
963 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
964 const char* provenance = nullptr);
965 template<
966 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
967 typename COLOR_COORD_T>
969 Context ctx, IndexSpaceT<DIM2, COORD_T2> handle,
970 LogicalPartitionT<DIM1, COORD_T1> projection,
971 LogicalRegionT<DIM1, COORD_T1> parent,
972 FieldID fid, // type: Point<DIM2,COORD_T2>
973 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
974 PartitionKind part_kind = LEGION_COMPUTE_KIND,
975 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
976 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
977 const char* provenance = nullptr);
978 // Range versions of image
979 IndexPartition create_partition_by_image_range(
980 Context ctx, IndexSpace handle, LogicalPartition projection,
981 LogicalRegion parent, FieldID fid, IndexSpace color_space,
982 PartitionKind part_kind = LEGION_COMPUTE_KIND,
983 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
984 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
985 const char* provenance = nullptr);
986 template<
987 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
988 typename COLOR_COORD_T>
989 IndexPartitionT<DIM2, COORD_T2> create_partition_by_image_range(
990 Context ctx, IndexSpaceT<DIM2, COORD_T2> handle,
991 LogicalPartitionT<DIM1, COORD_T1> projection,
992 LogicalRegionT<DIM1, COORD_T1> parent,
993 FieldID fid, // type: Rect<DIM2,COORD_T2>
994 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
995 PartitionKind part_kind = LEGION_COMPUTE_KIND,
996 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
997 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
998 const char* provenance = nullptr);
1001
1032 Context ctx, IndexPartition projection, LogicalRegion handle,
1033 LogicalRegion parent, FieldID fid, IndexSpace color_space,
1034 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1035 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1036 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1037 const char* provenance = nullptr);
1038 template<
1039 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
1040 typename COLOR_COORD_T>
1042 Context ctx, IndexPartitionT<DIM2, COORD_T2> projection,
1043 LogicalRegionT<DIM1, COORD_T1> handle,
1044 LogicalRegionT<DIM1, COORD_T1> parent,
1045 FieldID fid, // type: Point<DIM2,COORD_T2>
1046 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
1047 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1048 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1049 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1050 const char* provenance = nullptr);
1051 // Range versions of preimage
1052 IndexPartition create_partition_by_preimage_range(
1053 Context ctx, IndexPartition projection, LogicalRegion handle,
1054 LogicalRegion parent, FieldID fid, IndexSpace color_space,
1055 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1056 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1057 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1058 const char* provenance = nullptr);
1059 template<
1060 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
1061 typename COLOR_COORD_T>
1062 IndexPartitionT<DIM1, COORD_T1> create_partition_by_preimage_range(
1063 Context ctx, IndexPartitionT<DIM2, COORD_T2> projection,
1064 LogicalRegionT<DIM1, COORD_T1> handle,
1065 LogicalRegionT<DIM1, COORD_T1> parent,
1066 FieldID fid, // type: Rect<DIM2,COORD_T2>
1067 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
1068 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1069 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1070 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1071 const char* provenance = nullptr);
1073 public:
1074 //------------------------------------------------------------------------
1075 // Computed Index Spaces and Partitions
1076 //------------------------------------------------------------------------
1078
1105 Context ctx, IndexSpace parent, IndexSpace color_space,
1106 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1107 Color color = LEGION_AUTO_GENERATE_ID,
1108 const char* provenance = nullptr);
1109 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1111 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
1112 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
1113 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1114 Color color = LEGION_AUTO_GENERATE_ID,
1115 const char* provenance = nullptr);
1118
1135 Context ctx, IndexPartition parent, const DomainPoint& color,
1136 const std::vector<IndexSpace>& handles,
1137 const char* provenance = nullptr);
1138 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1140 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1141 Point<COLOR_DIM, COLOR_COORD_T> color,
1142 const typename std::vector<IndexSpaceT<DIM, COORD_T> >& handles,
1143 const char* provenance = nullptr);
1146
1160 Context ctx, IndexPartition parent, const DomainPoint& color,
1161 IndexPartition handle, const char* provenance = nullptr);
1162 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1164 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1165 Point<COLOR_DIM, COLOR_COORD_T> color,
1166 IndexPartitionT<DIM, COORD_T> handle, const char* provenance = nullptr);
1169
1186 Context ctx, IndexPartition parent, const DomainPoint& color,
1187 const std::vector<IndexSpace>& handles,
1188 const char* provenance = nullptr);
1189 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1191 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1192 Point<COLOR_DIM, COLOR_COORD_T> color,
1193 const typename std::vector<IndexSpaceT<DIM, COORD_T> >& handles,
1194 const char* provenance = nullptr);
1197
1211 Context ctx, IndexPartition parent, const DomainPoint& color,
1212 IndexPartition handle, const char* provenannce = nullptr);
1213 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1215 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1216 Point<COLOR_DIM, COLOR_COORD_T> color,
1217 IndexPartitionT<DIM, COORD_T> handle, const char* provenance = nullptr);
1220
1242 Context ctx, IndexPartition parent, const DomainPoint& color,
1243 IndexSpace initial, const std::vector<IndexSpace>& handles,
1244 const char* provenancne = nullptr);
1245 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1247 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1248 Point<COLOR_DIM, COLOR_COORD_T> color,
1249 IndexSpaceT<DIM, COORD_T> initial,
1250 const typename std::vector<IndexSpaceT<DIM, COORD_T> >& handles,
1251 const char* provenance = nullptr);
1253 public:
1254 //------------------------------------------------------------------------
1255 // Index Tree Traversal Operations
1256 //------------------------------------------------------------------------
1258
1267 Context ctx, IndexSpace parent, Color color);
1269 Context ctx, IndexSpace parent, const DomainPoint& color);
1270 // Context free versions
1271 IndexPartition get_index_partition(IndexSpace parent, Color color);
1273 IndexSpace parent, const DomainPoint& color);
1274 // Template version
1275 template<int DIM, typename COORD_T>
1277 IndexSpaceT<DIM, COORD_T> parent, Color color);
1278
1280
1282
1290 bool has_index_partition(Context ctx, IndexSpace parent, Color color);
1292 Context ctx, IndexSpace parent, const DomainPoint& color);
1293 // Context free
1294 bool has_index_partition(IndexSpace parent, Color color);
1295 bool has_index_partition(IndexSpace parent, const DomainPoint& color);
1296 // Template version
1297 template<int DIM, typename COORD_T>
1298 bool has_index_partition(IndexSpaceT<DIM, COORD_T> parent, Color color);
1300
1302
1310 IndexSpace get_index_subspace(Context ctx, IndexPartition p, Color color);
1312 Context ctx, IndexPartition p, const DomainPoint& color);
1313 // Context free versions
1316 // Template version
1317 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1318 IndexSpaceT<DIM, COORD_T> get_index_subspace(
1319 IndexPartitionT<DIM, COORD_T> p, Point<COLOR_DIM, COLOR_COORD_T> color);
1321
1323
1332 Context ctx, IndexPartition p, const DomainPoint& color);
1333 // Context free
1334 bool has_index_subspace(IndexPartition p, const DomainPoint& color);
1335 // Template version
1336 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1337 bool has_index_subspace(
1338 IndexPartitionT<DIM, COORD_T> p, Point<COLOR_DIM, COLOR_COORD_T> color);
1340
1342
1352 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1353 bool has_multiple_domains(Context ctx, IndexSpace handle);
1354 // Context free
1355 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1356 bool has_multiple_domains(IndexSpace handle);
1358
1360
1368 // Context free
1370 // Template version
1371 template<int DIM, typename COORD_T>
1372 DomainT<DIM, COORD_T> get_index_space_domain(
1373 IndexSpaceT<DIM, COORD_T> handle);
1375
1377
1387 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1389 Context ctx, IndexSpace handle, std::vector<Domain>& domains);
1390 // Context free
1391 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1393 IndexSpace handle, std::vector<Domain>& domains);
1395
1397
1405 // Context free
1407 // Template version
1408 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1409 DomainT<COLOR_DIM, COLOR_COORD_T> get_index_partition_color_space(
1410 IndexPartitionT<DIM, COORD_T> p);
1412
1414
1421 Context ctx, IndexPartition p);
1422 // Context free
1424 // Template version
1425 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1426 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> get_index_partition_color_space_name(
1427 IndexPartitionT<DIM, COORD_T> p);
1429
1431
1441 Context ctx, IndexSpace sp, std::set<Color>& colors);
1443 Context ctx, IndexSpace sp, std::set<DomainPoint>& colors);
1444 // Context free versions
1446 IndexSpace sp, std::set<Color>& colors);
1448 IndexSpace sp, std::set<DomainPoint>& colors);
1450
1452
1459 // Context free
1462
1464
1471 // Context free
1474
1476
1484 Color get_index_space_color(Context ctx, IndexSpace handle);
1485 DomainPoint get_index_space_color_point(Context ctx, IndexSpace handle);
1486 // Context free
1487 Color get_index_space_color(IndexSpace handle);
1488 DomainPoint get_index_space_color_point(IndexSpace handle);
1489 // Template version
1490 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1491 Point<COLOR_DIM, COLOR_COORD_T> get_index_space_color(
1492 IndexSpaceT<DIM, COORD_T> handle);
1494
1496
1503 Color get_index_partition_color(Context ctx, IndexPartition handle);
1504 DomainPoint get_index_partition_color_point(
1505 Context ctx, IndexPartition handle);
1506 // Context free
1508 DomainPoint get_index_partition_color_point(IndexPartition handle);
1510
1512
1519 // Context free
1521 // Template version
1522 template<int DIM, typename COORD_T>
1523 IndexSpaceT<DIM, COORD_T> get_parent_index_space(
1524 IndexPartitionT<DIM, COORD_T> handle);
1526
1528
1534 bool has_parent_index_partition(Context ctx, IndexSpace handle);
1535 // Context free
1538
1540
1548 // Context free
1550 // Template version
1551 template<int DIM, typename COORD_T>
1553 IndexSpaceT<DIM, COORD_T> handle);
1555
1557
1563 unsigned get_index_space_depth(Context ctx, IndexSpace handle);
1564 // Context free
1565 unsigned get_index_space_depth(IndexSpace handle);
1567
1569
1575 unsigned get_index_partition_depth(Context ctx, IndexPartition handle);
1576 // Context free
1579 public:
1580 //------------------------------------------------------------------------
1581 // Safe Cast Operations
1582 //------------------------------------------------------------------------
1592 DomainPoint safe_cast(Context ctx, DomainPoint point, LogicalRegion region);
1593
1602 template<int DIM, typename COORD_T>
1604 Context ctx, Point<DIM, COORD_T> point,
1605 LogicalRegionT<DIM, COORD_T> region);
1606 public:
1607 //------------------------------------------------------------------------
1608 // Field Space Operations
1609 //------------------------------------------------------------------------
1618 Context ctx, const char* provenance = nullptr);
1631 Context ctx, const std::vector<size_t>& field_sizes,
1632 std::vector<FieldID>& resulting_fields, CustomSerdezID serdez_id = 0,
1633 const char* provenance = nullptr);
1646 Context ctx, const std::vector<Future>& field_sizes,
1647 std::vector<FieldID>& resulting_fields, CustomSerdezID serdez_id = 0,
1648 const char* provenance = nullptr);
1659 void create_shared_ownership(Context ctx, FieldSpace handle);
1670 Context ctx, FieldSpace handle, const bool unordered = false,
1671 const char* provenance = nullptr);
1672
1674
1681 size_t get_field_size(Context ctx, FieldSpace handle, FieldID fid);
1682 // Context free
1683 size_t get_field_size(FieldSpace handle, FieldID fid);
1685
1687
1694 Context ctx, FieldSpace handle, std::vector<FieldID>& fields);
1695 // Context free
1697 FieldSpace handle, std::vector<FieldID>& fields);
1699
1701
1708 Context ctx, FieldSpace handle, std::set<FieldID>& fields);
1709 // Context free
1710 void get_field_space_fields(FieldSpace handle, std::set<FieldID>& fields);
1712 public:
1713 //------------------------------------------------------------------------
1714 // Logical Region Operations
1715 //------------------------------------------------------------------------
1730 Context ctx, IndexSpace index, FieldSpace fields,
1731 bool task_local = false, const char* provenance = nullptr);
1732 // Template version
1733 template<int DIM, typename COORD_T>
1735 Context ctx, IndexSpaceT<DIM, COORD_T> index, FieldSpace fields,
1736 bool task_local = false, const char* provenance = nullptr);
1747 void create_shared_ownership(Context ctx, LogicalRegion handle);
1758 Context ctx, LogicalRegion handle, const bool unordered = false,
1759 const char* provenance = nullptr);
1760
1768 LEGION_DEPRECATED(
1769 "Destruction of logical partitions are no-ops now."
1770 "Logical partitions are automatically destroyed when their root "
1771 "logical region or their index spartition are destroyed.")
1773 Context ctx, LogicalPartition handle, const bool unordered = false);
1774
1794 Context ctx, LogicalRegion parent, LogicalRegion region,
1795 const std::set<FieldID>& fields);
1796 public:
1797 //------------------------------------------------------------------------
1798 // Logical Region Tree Traversal Operations
1799 //------------------------------------------------------------------------
1801
1811 Context ctx, LogicalRegion parent, IndexPartition handle);
1812 // Context free
1814 LogicalRegion parent, IndexPartition handle);
1815 // Template version
1816 template<int DIM, typename COORD_T>
1818 LogicalRegionT<DIM, COORD_T> parent,
1819 IndexPartitionT<DIM, COORD_T> handle);
1821
1823
1832 Context ctx, LogicalRegion parent, Color c);
1834 Context ctx, LogicalRegion parent, const DomainPoint& c);
1835 // Context free
1837 LogicalRegion parent, Color c);
1839 LogicalRegion parent, const DomainPoint& c);
1840 // Template version
1841 template<int DIM, typename COORD_T>
1843 LogicalRegionT<DIM, COORD_T> parent, Color c);
1845
1847
1856 Context ctx, LogicalRegion parent, const DomainPoint& c);
1857 // Context free
1859 LogicalRegion parent, const DomainPoint& c);
1861
1863
1873 Context ctx, IndexPartition handle, FieldSpace fspace,
1874 RegionTreeID tid);
1875 // Context free
1877 IndexPartition handle, FieldSpace fspace, RegionTreeID tid);
1878 // Template version
1879 template<int DIM, typename COORD_T>
1881 IndexPartitionT<DIM, COORD_T> handle, FieldSpace fspace,
1882 RegionTreeID tid);
1884
1886
1896 Context ctx, LogicalPartition parent, IndexSpace handle);
1897 // Context free
1899 LogicalPartition parent, IndexSpace handle);
1900 // Template version
1901 template<int DIM, typename COORD_T>
1903 LogicalPartitionT<DIM, COORD_T> parent,
1904 IndexSpaceT<DIM, COORD_T> handle);
1906
1908
1917 Context ctx, LogicalPartition parent, Color c);
1919 Context ctx, LogicalPartition parent, const DomainPoint& c);
1920 // Context free
1922 LogicalPartition parent, Color c);
1924 LogicalPartition parent, const DomainPoint& c);
1925 // Template version
1926 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1928 LogicalPartitionT<DIM, COORD_T> parent,
1929 Point<COLOR_DIM, COLOR_COORD_T> color);
1931
1933
1942 Context ctx, LogicalPartition parent, const DomainPoint& c);
1943 // Context free
1945 LogicalPartition parent, const DomainPoint& c);
1946 // Template version
1947 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1949 LogicalPartitionT<DIM, COORD_T> parent,
1950 Point<COLOR_DIM, COLOR_COORD_T> color);
1952
1954
1964 Context ctx, IndexSpace handle, FieldSpace fspace, RegionTreeID tid);
1965 // Context free
1967 IndexSpace handle, FieldSpace fspace, RegionTreeID tid);
1968 // Template version
1969 template<int DIM, typename COORD_T>
1971 IndexSpaceT<DIM, COORD_T> handle, FieldSpace space, RegionTreeID tid);
1973
1975
1983 Color get_logical_region_color(Context ctx, LogicalRegion handle);
1984 DomainPoint get_logical_region_color_point(
1985 Context ctx, LogicalRegion handle);
1986 // Context free versions
1988 DomainPoint get_logical_region_color_point(LogicalRegion handle);
1989 // Template version
1990 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1991 Point<COLOR_DIM, COLOR_COORD_T> get_logical_region_color_point(
1992 LogicalRegionT<DIM, COORD_T> handle);
1994
1996
2004 DomainPoint get_logical_partition_color_point(
2005 Context ctx, LogicalPartition handle);
2006 // Context free versions
2008 DomainPoint get_logical_partition_color_point(LogicalPartition handle);
2010
2012
2019 Context ctx, LogicalPartition handle);
2020 // Context free
2022 // Template version
2023 template<int DIM, typename COORD_T>
2025 LogicalPartitionT<DIM, COORD_T> handle);
2027
2029
2036 // Context free
2039
2041
2048 Context ctx, LogicalRegion handle);
2049 // Context free
2051 // Template version
2052 template<int DIM, typename COORD_T>
2054 LogicalRegionT<DIM, COORD_T> handle);
2056 public:
2057 //------------------------------------------------------------------------
2058 // Allocator and Argument Map Operations
2059 //------------------------------------------------------------------------
2067
2076 LEGION_DEPRECATED("ArgumentMap can be constructed directly.")
2078 public:
2079 //------------------------------------------------------------------------
2080 // Task Launch Operations
2081 //------------------------------------------------------------------------
2092 Context ctx, const TaskLauncher& launcher,
2093 std::vector<OutputRequirement>* outputs = nullptr);
2094
2106 Context ctx, const IndexTaskLauncher& launcher,
2107 std::vector<OutputRequirement>* outputs = nullptr);
2108
2132 Context ctx, const IndexTaskLauncher& launcher, ReductionOpID redop,
2133 bool ordered = true, std::vector<OutputRequirement>* outputs = nullptr);
2134
2159 Context ctx, const FutureMap& future_map, ReductionOpID redop,
2160 bool ordered = true, MapperID map_id = 0, MappingTagID tag = 0,
2161 const char* provenance = nullptr, Future initial_value = Future());
2162
2191 Context ctx, IndexSpace domain,
2192 const std::map<DomainPoint, UntypedBuffer>& data,
2193 bool collective = false, ShardingID sid = 0,
2194 bool implicit_sharding = false, const char* provenance = nullptr);
2195 LEGION_DEPRECATED("Use the version that takes an IndexSpace instead")
2197 Context ctx, const Domain& domain,
2198 const std::map<DomainPoint, UntypedBuffer>& data,
2199 bool collective = false, ShardingID sid = 0,
2200 bool implicit_sharding = false);
2201
2226 Context ctx, IndexSpace domain,
2227 const std::map<DomainPoint, Future>& futures, bool collective = false,
2228 ShardingID sid = 0, bool implicit_sharding = false,
2229 const char* provenance = nullptr);
2230 LEGION_DEPRECATED("Use the version that takes an IndexSpace instead")
2232 Context ctx, const Domain& domain,
2233 const std::map<DomainPoint, Future>& futures, bool collective = false,
2234 ShardingID sid = 0, bool implicit_sharding = false);
2235
2253 using PointTransformFunc = std::function<DomainPoint(
2254 const DomainPoint&, const Domain&, const Domain&)>;
2255 FutureMap transform_future_map(
2256 Context ctx, const FutureMap& fm, IndexSpace new_domain,
2257 PointTransformFunc func, const char* provenance = nullptr);
2275 FutureMap transform_future_map(
2276 Context ctx, const FutureMap& fm, IndexSpace new_domain,
2277 PointTransformFunctor* functor, bool take_ownership = false,
2278 const char* provenance = nullptr);
2279
2295 LEGION_DEPRECATED(
2296 "Launching tasks should be done with the new task "
2297 "launcher interface.")
2299 Context ctx, TaskID task_id,
2300 const std::vector<IndexSpaceRequirement>& indexes,
2301 const std::vector<FieldSpaceRequirement>& fields,
2302 const std::vector<RegionRequirement>& regions, const UntypedBuffer& arg,
2303 const Predicate& predicate = Predicate::TRUE_PRED, MapperID id = 0,
2304 MappingTagID tag = 0);
2305
2324 LEGION_DEPRECATED(
2325 "Launching tasks should be done with the new task "
2326 "launcher interface.")
2328 Context ctx, TaskID task_id, const Domain domain,
2329 const std::vector<IndexSpaceRequirement>& indexes,
2330 const std::vector<FieldSpaceRequirement>& fields,
2331 const std::vector<RegionRequirement>& regions,
2332 const UntypedBuffer& global_arg, const ArgumentMap& arg_map,
2333 const Predicate& predicate = Predicate::TRUE_PRED,
2334 bool must_paralleism = false, MapperID id = 0, MappingTagID tag = 0);
2335
2357 LEGION_DEPRECATED(
2358 "Launching tasks should be done with the new task "
2359 "launcher interface.")
2361 Context ctx, TaskID task_id, const Domain domain,
2362 const std::vector<IndexSpaceRequirement>& indexes,
2363 const std::vector<FieldSpaceRequirement>& fields,
2364 const std::vector<RegionRequirement>& regions,
2365 const UntypedBuffer& global_arg, const ArgumentMap& arg_map,
2366 ReductionOpID reduction, const UntypedBuffer& initial_value,
2367 const Predicate& predicate = Predicate::TRUE_PRED,
2368 bool must_parallelism = false, MapperID id = 0, MappingTagID tag = 0);
2369 public:
2370 //------------------------------------------------------------------------
2371 // Inline Mapping Operations
2372 //------------------------------------------------------------------------
2382 PhysicalRegion map_region(Context ctx, const InlineLauncher& launcher);
2383
2398 Context ctx, const RegionRequirement& req, MapperID id = 0,
2399 MappingTagID tag = 0, const char* provenance = nullptr);
2400
2413 Context ctx, unsigned idx, MapperID id = 0, MappingTagID tag = 0,
2414 const char* provenance = nullptr);
2415
2426 Context ctx, PhysicalRegion region, const char* provenance = nullptr);
2427
2435 void unmap_region(Context ctx, PhysicalRegion region);
2436
2444 void unmap_all_regions(Context ctx);
2445 public:
2446 //------------------------------------------------------------------------
2447 // Output Region Operations
2448 //------------------------------------------------------------------------
2454 OutputRegion get_output_region(Context ctx, unsigned index);
2455
2461 void get_output_regions(Context ctx, std::vector<OutputRegion>& regions);
2462 public:
2463 //------------------------------------------------------------------------
2464 // Fill Field Operations
2465 //------------------------------------------------------------------------
2480 template<typename T>
2482 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
2483 const T& value, Predicate pred = Predicate::TRUE_PRED);
2484
2499 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
2500 const void* value, size_t value_size,
2501 Predicate pred = Predicate::TRUE_PRED);
2502
2516 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
2517 Future f, Predicate pred = Predicate::TRUE_PRED);
2518
2529 template<typename T>
2531 Context ctx, LogicalRegion handle, LogicalRegion parent,
2532 const std::set<FieldID>& fields, const T& value,
2533 Predicate pred = Predicate::TRUE_PRED);
2534
2548 Context ctx, LogicalRegion handle, LogicalRegion parent,
2549 const std::set<FieldID>& fields, const void* value, size_t value_size,
2550 Predicate pred = Predicate::TRUE_PRED);
2551
2563 Context ctx, LogicalRegion handle, LogicalRegion parent,
2564 const std::set<FieldID>& fields, Future f,
2565 Predicate pred = Predicate::TRUE_PRED);
2566
2573 void fill_fields(Context ctx, const FillLauncher& launcher);
2574
2581 void fill_fields(Context ctx, const IndexFillLauncher& launcher);
2582
2588 void discard_fields(Context ctx, const DiscardLauncher& launcher);
2589 public:
2590 //------------------------------------------------------------------------
2591 // Attach Operations
2592 //------------------------------------------------------------------------
2593
2601 Context ctx, const AttachLauncher& launcher);
2602
2615 Context ctx, PhysicalRegion region, const bool flush = true,
2616 const bool unordered = false, const char* provenance = nullptr);
2617
2636 Context ctx, const IndexAttachLauncher& launcher);
2637
2651 Context ctx, ExternalResources external, const bool flush = true,
2652 const bool unordered = false, const char* provenance = nullptr);
2653
2661
2692 LEGION_DEPRECATED(
2693 "Attaching specific HDF5 file type is deprecated "
2694 "in favor of generic attach launcher interface.")
2696 Context ctx, const char* file_name, LogicalRegion handle,
2697 LogicalRegion parent, const std::map<FieldID, const char*>& field_map,
2698 LegionFileMode mode);
2699
2716 LEGION_DEPRECATED(
2717 "Detaching specific HDF5 file type is deprecated "
2718 "in favor of generic detach interface.")
2719 void detach_hdf5(Context ctx, PhysicalRegion region);
2720
2727 LEGION_DEPRECATED(
2728 "Attaching generic file type is deprecated "
2729 "in favor of generic attach launcher interface.")
2731 Context ctx, const char* file_name, LogicalRegion handle,
2732 LogicalRegion parent, const std::vector<FieldID>& field_vec,
2733 LegionFileMode mode);
2734
2740 LEGION_DEPRECATED(
2741 "Detaching generic file type is deprecated "
2742 "in favor of generic detach interface.")
2743 void detach_file(Context ctx, PhysicalRegion region);
2744 public:
2745 //------------------------------------------------------------------------
2746 // Copy Operations
2747 //------------------------------------------------------------------------
2755 void issue_copy_operation(Context ctx, const CopyLauncher& launcher);
2756
2764 void issue_copy_operation(Context ctx, const IndexCopyLauncher& launcher);
2765 public:
2766 //------------------------------------------------------------------------
2767 // Predicate Operations
2768 //------------------------------------------------------------------------
2779 Context ctx, const Future& f, const char* provenance = nullptr);
2780
2791 Context ctx, const Predicate& p, const char* provenance = nullptr);
2792
2804 Context ctx, const Predicate& p1, const Predicate& p2,
2805 const char* provenance = nullptr);
2806
2818 Context ctx, const Predicate& p1, const Predicate& p2,
2819 const char* provenance = nullptr);
2820
2827 Predicate create_predicate(Context ctx, const PredicateLauncher& launcher);
2828
2838 Context ctx, const Predicate& p, const char* provenance = nullptr);
2839 public:
2840 //------------------------------------------------------------------------
2841 // Lock Operations
2842 //------------------------------------------------------------------------
2848 Lock create_lock(Context ctx);
2849
2860 void destroy_lock(Context ctx, Lock l);
2861
2874 Grant acquire_grant(Context ctx, const std::vector<LockRequest>& requests);
2875
2885 void release_grant(Context ctx, Grant grant);
2886 public:
2887 //------------------------------------------------------------------------
2888 // Phase Barrier operations
2889 //------------------------------------------------------------------------
2899 PhaseBarrier create_phase_barrier(Context ctx, unsigned arrivals);
2900
2912
2929 public:
2930 //------------------------------------------------------------------------
2931 // Dynamic Collective operations
2932 //------------------------------------------------------------------------
2948 Context ctx, unsigned arrivals, ReductionOpID redop,
2949 const void* init_value, size_t init_size);
2950
2958
2969 Context ctx, DynamicCollective dc, const void* buffer, size_t size,
2970 unsigned count = 1);
2971
2982 Context ctx, DynamicCollective dc, const Future& f, unsigned count = 1);
2983
2995 Context ctx, DynamicCollective dc, const char* provenance = nullptr);
2996
3006 Context ctx, DynamicCollective dc);
3007 public:
3008 //------------------------------------------------------------------------
3009 // User-Managed Software Coherence
3010 //------------------------------------------------------------------------
3017 void issue_acquire(Context ctx, const AcquireLauncher& launcher);
3018
3025 void issue_release(Context ctx, const ReleaseLauncher& launcher);
3026 public:
3027 //------------------------------------------------------------------------
3028 // Fence Operations
3029 //------------------------------------------------------------------------
3038 Future issue_mapping_fence(Context ctx, const char* provenance = nullptr);
3039
3049 Future issue_execution_fence(Context ctx, const char* provenance = nullptr);
3050 public:
3051 //------------------------------------------------------------------------
3052 // Tracing Operations
3053 //------------------------------------------------------------------------
3084 Context ctx, TraceID tid, bool logical_only = false,
3085 bool static_trace = false,
3086 const std::set<RegionTreeID>* managed = nullptr,
3087 const char* provenance = nullptr);
3091 void end_trace(Context ctx, TraceID tid, const char* provenance = nullptr);
3106 LEGION_DEPRECATED("Use begin_trace with static_trace=true")
3108 Context ctx, const std::set<RegionTreeID>* managed = nullptr);
3113 LEGION_DEPRECATED("Use end_trace")
3114 void end_static_trace(Context ctx);
3115
3121
3132 TraceID generate_library_trace_ids(const char* name, size_t count);
3133
3141 static TraceID generate_static_trace_id(void);
3142 public:
3143 //------------------------------------------------------------------------
3144 // Frame Operations
3145 //------------------------------------------------------------------------
3159 void complete_frame(Context ctx, const char* provenance = nullptr);
3160 public:
3161 //------------------------------------------------------------------------
3162 // Must Parallelism
3163 //------------------------------------------------------------------------
3172 Context ctx, const MustEpochLauncher& launcher);
3173 public:
3174 //------------------------------------------------------------------------
3175 // Tunable Variables
3176 //------------------------------------------------------------------------
3177
3192 Context ctx, TunableID tid, MapperID mapper = 0, MappingTagID tag = 0,
3193 const void* args = nullptr, size_t argsize = 0);
3194 Future select_tunable_value(Context ctx, const TunableLauncher& launcher);
3195
3202 LEGION_DEPRECATED(
3203 "Tunable values should now be obtained via the "
3204 "generic interface that returns a future result.")
3206 Context ctx, TunableID tid, MapperID mapper = 0, MappingTagID tag = 0);
3207 public:
3208 //------------------------------------------------------------------------
3209 // Task Local Interface
3210 //------------------------------------------------------------------------
3216 const Task* get_local_task(Context ctx);
3217
3225 void* get_local_task_variable_untyped(Context ctx, LocalVariableID id);
3226 template<typename T>
3227 T* get_local_task_variable(Context ctx, LocalVariableID id);
3228
3240 Context ctx, LocalVariableID id, const void* value,
3241 void (*destructor)(void*) = nullptr);
3242 template<typename T>
3243 void set_local_task_variable(
3244 Context ctx, LocalVariableID id, const T* value,
3245 void (*destructor)(void*) = nullptr);
3246 public:
3247 //------------------------------------------------------------------------
3248 // Deferred Buffer/Value Creation/Destruction
3249 //------------------------------------------------------------------------
3261 Context ctx, const DeferredValueRequest& request);
3262
3273 Context ctx, UntypedDeferredValue& value,
3274 Realm::Event precondition = Realm::Event::NO_EVENT);
3275
3286 template<typename COORD_T = coord_t>
3288 Context ctx, const DeferredBufferRequest& request);
3289
3299 template<typename COORD_T = coord_t>
3301 Context ctx, UntypedDeferredBuffer<COORD_T>& buffer,
3302 Realm::Event precondition = Realm::Event::NO_EVENT);
3303 public:
3304 //------------------------------------------------------------------------
3305 // Timing Operations
3306 //------------------------------------------------------------------------
3315 Future get_current_time(Context ctx, Future precondition = Future());
3316
3326 Context ctx, Future precondition = Future());
3327
3337 Context ctx, Future precondition = Future());
3338
3346 Context ctx, const TimingLauncher& launcher);
3347
3354 static long long get_zero_time(void);
3355 public:
3356 //------------------------------------------------------------------------
3357 // Exception Handling
3358 //------------------------------------------------------------------------
3359
3363 void push_exception_handler(Context ctx, ExceptionHandlerID handler);
3364
3370 Future pop_exception_handler(Context ctx, const char* provenance = nullptr);
3371 public:
3372 //------------------------------------------------------------------------
3373 // Miscellaneous Operations
3374 //------------------------------------------------------------------------
3389 Mapping::Mapper* get_mapper(
3390 Context ctx, MapperID id, Processor target = Processor::NO_PROC);
3391
3405 Mapping::MapperContext begin_mapper_call(
3406 Context ctx, MapperID id, Processor target = Processor::NO_PROC);
3407
3413 void end_mapper_call(Mapping::MapperContext ctx);
3414
3421 Processor get_executing_processor(Context ctx);
3422
3429 const Task* get_current_task(Context ctx);
3430
3447 Context ctx, Memory target, bool escaping = true);
3448
3460 void release_memory_pool(Context ctx, Memory target);
3461
3479 Context ctx, PhysicalRegion region, bool nuclear);
3480
3491 void yield(Context ctx);
3492
3511 Context ctx, Realm::Event effect, const char* provenance = nullptr);
3512
3550 void concurrent_task_barrier(Context ctx);
3551
3563 void start_profiling_range(Context ctx);
3564 void stop_profiling_range(Context ctx, const char* provenance);
3565 public:
3566 //------------------------------------------------------------------------
3567 // MPI Interoperability
3568 //------------------------------------------------------------------------
3573
3581 const std::map<int /*rank*/, AddressSpace>& find_forward_MPI_mapping(void);
3582
3590 const std::map<AddressSpace, int /*rank*/>& find_reverse_MPI_mapping(void);
3591
3596 public:
3597 //------------------------------------------------------------------------
3598 // Semantic Information
3599 //------------------------------------------------------------------------
3610 TaskID task_id, SemanticTag tag, const void* buffer, size_t size,
3611 bool is_mutable = false, bool local_only = false);
3612
3622 IndexSpace handle, SemanticTag tag, const void* buffer, size_t size,
3623 bool is_mutable = false);
3624
3634 IndexPartition handle, SemanticTag tag, const void* buffer, size_t size,
3635 bool is_mutable = false);
3636
3646 FieldSpace handle, SemanticTag tag, const void* buffer, size_t size,
3647 bool is_mutable = false);
3648
3659 FieldSpace handle, FieldID fid, SemanticTag tag, const void* buffer,
3660 size_t size, bool is_mutable = false);
3661
3671 LogicalRegion handle, SemanticTag tag, const void* buffer, size_t size,
3672 bool is_mutable = false);
3673
3683 LogicalPartition handle, SemanticTag tag, const void* buffer,
3684 size_t size, bool is_mutable = false);
3685
3694 TaskID task_id, const char* name, bool is_mutable = false,
3695 bool local_only = false);
3696
3704 IndexSpace handle, const char* name, bool is_mutable = false);
3705
3713 IndexPartition handle, const char* name, bool is_mutable = false);
3714
3722 FieldSpace handle, const char* name, bool is_mutable = false);
3723
3732 FieldSpace handle, FieldID fid, const char* name,
3733 bool is_mutable = false);
3734
3742 LogicalRegion handle, const char* name, bool is_mutable = false);
3743
3751 LogicalPartition handle, const char* name, bool is_mutable = false);
3752
3764 TaskID task_id, SemanticTag tag, const void*& result, size_t& size,
3765 bool can_fail = false, bool wait_until_ready = false);
3766
3778 IndexSpace handle, SemanticTag tag, const void*& result, size_t& size,
3779 bool can_fail = false, bool wait_until_ready = false);
3780
3792 IndexPartition handle, SemanticTag tag, const void*& result,
3793 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3794
3806 FieldSpace handle, SemanticTag tag, const void*& result, size_t& size,
3807 bool can_fail = false, bool wait_until_ready = false);
3808
3821 FieldSpace handle, FieldID fid, SemanticTag tag, const void*& result,
3822 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3823
3835 LogicalRegion handle, SemanticTag tag, const void*& result,
3836 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3837
3849 LogicalPartition handle, SemanticTag tag, const void*& result,
3850 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3851
3857 void retrieve_name(TaskID task_id, const char*& result);
3858
3864 void retrieve_name(IndexSpace handle, const char*& result);
3865
3871 void retrieve_name(IndexPartition handle, const char*& result);
3872
3878 void retrieve_name(FieldSpace handle, const char*& result);
3879
3886 void retrieve_name(FieldSpace handle, FieldID fid, const char*& result);
3887
3893 void retrieve_name(LogicalRegion handle, const char*& result);
3894
3900 void retrieve_name(LogicalPartition handle, const char*& result);
3901 public:
3902 //------------------------------------------------------------------------
3903 // Printing operations, these are useful for only generating output
3904 // from a single task if the task has been replicated (either directly
3905 // or as part of control replication).
3906 //------------------------------------------------------------------------
3914 void print_once(Context ctx, FILE* f, const char* message);
3915
3922 void log_once(Context ctx, Realm::LoggerMessage& message);
3923 public:
3924 //------------------------------------------------------------------------
3925 // Registration Callback Operations
3926 // All of these calls must be made while in the registration
3927 // function called before start-up. This function is specified
3928 // by calling the 'set_registration_callback' static method.
3929 //------------------------------------------------------------------------
3930
3935 Mapping::MapperRuntime* get_mapper_runtime(void);
3936
3942
3953 MapperID generate_library_mapper_ids(const char* name, size_t count);
3954
3962 static MapperID generate_static_mapper_id(void);
3963
3976 MapperID map_id, Mapping::Mapper* mapper,
3977 Processor proc = Processor::NO_PROC);
3978
3991 Mapping::Mapper* mapper, Processor proc = Processor::NO_PROC);
3992 public:
3998
4010 const char* name, size_t count);
4011
4019 static ProjectionID generate_static_projection_id(void);
4020
4035 ProjectionID pid, ProjectionFunctor* functor,
4036 bool silence_warnings = false, const char* warning_string = nullptr);
4037
4048 ProjectionID pid, ProjectionFunctor* functor);
4049
4057 public:
4063
4074 ShardingID generate_library_sharding_ids(const char* name, size_t count);
4075
4083 static ShardingID generate_static_sharding_id(void);
4084
4098 ShardingID sid, ShardingFunctor* functor, bool silence_warnings = false,
4099 const char* warning_string = nullptr);
4100
4112 ShardingID sid, ShardingFunctor* functor);
4113
4120 static ShardingFunctor* get_sharding_functor(ShardingID sid);
4121 public:
4127
4139 const char* name, size_t count);
4140
4148 static ConcurrentID generate_static_concurrent_id(void);
4149
4164 ConcurrentID cid, ConcurrentColoringFunctor* functor,
4165 bool silence_warnings = false, const char* warning_string = nullptr);
4166
4177 ConcurrentID cid, ConcurrentColoringFunctor* functor);
4178
4186 ConcurrentID cid);
4187 public:
4194
4206 const char* name, size_t count);
4207
4215 static ExceptionHandlerID generate_static_exception_handler_id(void);
4216
4223 ExceptionHandlerID hid, ExceptionHandler* handler);
4224
4233 ExceptionHandlerID cid, ExceptionHandler* handler);
4234
4241 static ExceptionHandler* get_exception_handler(ExceptionHandlerID hid);
4242 public:
4248
4260 const char* name, size_t count);
4261
4269 static ReductionOpID generate_static_reduction_id(void);
4270
4285 template<typename REDOP>
4287 ReductionOpID redop_id, bool permit_duplicates = false);
4288
4310 ReductionOpID redop_id, ReductionOp* op,
4311 SerdezInitFunc init_fnptr = nullptr,
4312 SerdezFoldFunc fold_fnptr = nullptr, bool permit_duplicates = false);
4313
4319 static const ReductionOp* get_reduction_op(ReductionOpID redop_id);
4320
4321#ifdef LEGION_GPU_REDUCTIONS
4322 template<typename REDOP>
4323 LEGION_DEPRECATED("Use register_reduction_op instead")
4324 static void preregister_gpu_reduction_op(ReductionOpID redop_id);
4325#endif
4326 public:
4331 CustomSerdezID generate_dynamic_serdez_id(void);
4332
4343 CustomSerdezID generate_library_serdez_ids(const char* name, size_t count);
4344
4352 static CustomSerdezID generate_static_serdez_id(void);
4353
4367 template<typename SERDEZ>
4369 CustomSerdezID serdez_id, bool permit_duplicates = false);
4370
4384 CustomSerdezID serdez_id, SerdezOp* serdez_op,
4385 bool permit_duplicates = false);
4386
4392 static const SerdezOp* get_serdez_op(CustomSerdezID serdez_id);
4393 public:
4394 //------------------------------------------------------------------------
4395 // Start-up Operations
4396 // Everything below here is a static function that is used to configure
4397 // the runtime prior to calling the start method to begin execution.
4398 //------------------------------------------------------------------------
4399 public:
4405 static const char* get_legion_version(void);
4406
4624 static int start(
4625 int argc, char** argv, bool background = false,
4626 bool supply_default_mapper = true, bool filter = false,
4627 bool realm_initialize_network = true,
4628 bool realm_configure_machine = true);
4629
4650 static void initialize(
4651 int* argc, char*** argv, bool filter = false, bool parse = true,
4652 bool realm_initialize_network = true,
4653 bool realm_create_configure_machine = true);
4654
4660 static int wait_for_shutdown(void);
4661
4669 static void set_return_code(int return_code);
4670
4678 static void set_top_level_task_id(TaskID top_id);
4679
4686 static void set_top_level_task_mapper_id(MapperID mapper_id);
4687
4695
4715 TaskID top_task_id, MapperID mapper_id,
4716 Processor::Kind proc_kind = Processor::NO_KIND,
4717 const char* task_name = nullptr, bool control_replicable = false,
4718 unsigned shard_per_address_space = 1, int shard_id = -1,
4719 DomainPoint shard_point = DomainPoint());
4720
4729
4737
4749 Context ctx, Realm::Event effects = Realm::Event::NO_EVENT);
4750
4756 static size_t get_maximum_dimension(void);
4757
4767 static void configure_MPI_interoperability(int rank);
4768
4783 bool init_in_ext = true, int ext_participants = 1,
4784 int legion_participants = 1);
4785
4798 bool init_in_MPI = true, int mpi_participants = 1,
4799 int legion_participants = 1);
4800
4811 template<
4812 LogicalRegion (*PROJ_PTR)(LogicalRegion, const DomainPoint&, Runtime*)>
4813 LEGION_DEPRECATED(
4814 "Projection functions should now be specified "
4815 "using projection functor objects")
4816 static ProjectionID register_region_function(ProjectionID handle);
4817
4827 template<LogicalRegion (*PROJ_PTR)(
4829 LEGION_DEPRECATED(
4830 "Projection functions should now be specified "
4831 "using projection functor objects")
4832 static ProjectionID register_partition_function(ProjectionID handle);
4833 public:
4851 RegistrationCallback callback, bool dedup = true, size_t dedup_tag = 0);
4852 static void add_registration_callback(
4853 RegistrationWithArgsCallback callback, const UntypedBuffer& buffer,
4854 bool dedup = true, size_t dedup_tag = 0);
4855
4881 RegistrationCallback callback, bool global, bool deduplicate = true,
4882 size_t dedup_tag = 0);
4884 RegistrationWithArgsCallback callback, const UntypedBuffer& buffer,
4885 bool global, bool deduplicate = true, size_t dedup_tag = 0);
4886
4898 LEGION_DEPRECATED(
4899 "Legion now supports multiple registration callbacks "
4900 "added via the add_registration_callback method.")
4901 static void set_registration_callback(RegistrationCallback callback);
4902
4908 static const InputArgs& get_input_args(void);
4909 public:
4913 static void enable_profiling(void);
4917 static void disable_profiling(void);
4921 static void dump_profiling(void);
4922 public:
4923 //------------------------------------------------------------------------
4924 // Layout Registration Operations
4925 //------------------------------------------------------------------------
4934 LayoutConstraintID register_layout(
4935 const LayoutConstraintRegistrar& registrar);
4936
4942 void release_layout(LayoutConstraintID layout_id);
4943
4955 static LayoutConstraintID preregister_layout(
4956 const LayoutConstraintRegistrar& registrar,
4957 LayoutConstraintID layout_id = LEGION_AUTO_GENERATE_ID);
4958
4964 FieldSpace get_layout_constraint_field_space(LayoutConstraintID layout_id);
4965
4972 LayoutConstraintID layout_id, LayoutConstraintSet& layout_constraints);
4973
4979 const char* get_layout_constraints_name(LayoutConstraintID layout_id);
4980 public:
4981 //------------------------------------------------------------------------
4982 // Task Registration Operations
4983 //------------------------------------------------------------------------
4984
4990
5001 TaskID generate_library_task_ids(const char* name, size_t count);
5002
5010 static TaskID generate_static_task_id(void);
5011
5019 template<
5020 typename T,
5021 T (*TASK_PTR)(
5022 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5024 const TaskVariantRegistrar& registrar,
5025 VariantID vid = LEGION_AUTO_GENERATE_ID);
5026
5035 template<
5036 typename T, typename UDT,
5037 T (*TASK_PTR)(
5038 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*,
5039 const UDT&)>
5041 const TaskVariantRegistrar& registrar, const UDT& user_data,
5042 VariantID vid = LEGION_AUTO_GENERATE_ID);
5043
5051 template<void (*TASK_PTR)(
5052 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5054 const TaskVariantRegistrar& registrar,
5055 VariantID vid = LEGION_AUTO_GENERATE_ID);
5056
5065 template<
5066 typename UDT, void (*TASK_PTR)(
5067 const Task*, const std::vector<PhysicalRegion>&,
5068 Context, Runtime*, const UDT&)>
5070 const TaskVariantRegistrar& registrar, const UDT& user_data,
5071 VariantID vid = LEGION_AUTO_GENERATE_ID);
5072
5093 const TaskVariantRegistrar& registrar, const CodeDescriptor& codedesc,
5094 const void* user_data = nullptr, size_t user_len = 0,
5095 size_t return_type_size = LEGION_MAX_RETURN_SIZE,
5096 VariantID vid = LEGION_AUTO_GENERATE_ID,
5097 bool has_return_type_size = true);
5098
5109 template<
5110 typename T,
5111 T (*TASK_PTR)(
5112 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5114 const TaskVariantRegistrar& registrar, const char* task_name = nullptr,
5115 VariantID vid = LEGION_AUTO_GENERATE_ID);
5116
5128 template<
5129 typename T, typename UDT,
5130 T (*TASK_PTR)(
5131 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*,
5132 const UDT&)>
5134 const TaskVariantRegistrar& registrar, const UDT& user_data,
5135 const char* task_name = nullptr,
5136 VariantID vid = LEGION_AUTO_GENERATE_ID);
5137
5148 template<void (*TASK_PTR)(
5149 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5151 const TaskVariantRegistrar& registrar, const char* task_name = nullptr,
5152 VariantID vid = LEGION_AUTO_GENERATE_ID);
5153
5165 template<
5166 typename UDT, void (*TASK_PTR)(
5167 const Task*, const std::vector<PhysicalRegion>&,
5168 Context, Runtime*, const UDT&)>
5170 const TaskVariantRegistrar& registrar, const UDT& user_data,
5171 const char* task_name = nullptr,
5172 VariantID vid = LEGION_AUTO_GENERATE_ID);
5173
5196 const TaskVariantRegistrar& registrar, const CodeDescriptor& codedesc,
5197 const void* user_data = nullptr, size_t user_len = 0,
5198 const char* task_name = nullptr,
5199 VariantID vid = LEGION_AUTO_GENERATE_ID,
5200 size_t return_type_size = LEGION_MAX_RETURN_SIZE,
5201 bool has_return_type_size = true, bool check_task_id = true);
5202
5217 const void* data, size_t datalen, Processor p, const Task*& task,
5218 const std::vector<PhysicalRegion>*& reg, Context& ctx,
5219 Runtime*& runtime);
5220
5239 Context ctx, const void* retvalptr = nullptr, size_t retvalsize = 0,
5240 bool owned = false,
5241 Realm::RegionInstance inst = Realm::RegionInstance::NO_INST,
5242 const void* metadataptr = nullptr, size_t metadatasize = 0);
5243
5263 Context ctx, const void* retvalptr, size_t retvalsize, bool owned,
5264 const Realm::ExternalInstanceResource& allocation,
5265 void (*freefunc)(const Realm::ExternalInstanceResource&) = nullptr,
5266 const void* metadataptr = nullptr, size_t metadatasize = 0);
5267
5278 Context ctx, FutureFunctor* callback_functor, bool owned = false);
5279
5295 Context ctx, const Domain& domain, bool take_ownership,
5296 const void* metadataptr = nullptr, size_t metadatasize = 0);
5297 public:
5298 // ------------------ Deprecated task registration -----------------------
5312 template<
5313 typename T,
5314 T (*TASK_PTR)(
5315 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5316 LEGION_DEPRECATED(
5317 "Task registration should be done with "
5320 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5321 VariantID vid = LEGION_AUTO_GENERATE_ID,
5323 const char* task_name = nullptr);
5337 template<void (*TASK_PTR)(
5338 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5339 LEGION_DEPRECATED(
5340 "Task registration should be done with "
5343 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5344 VariantID vid = LEGION_AUTO_GENERATE_ID,
5346 const char* task_name = nullptr);
5362 template<
5363 typename T, typename UDT,
5364 T (*TASK_PTR)(
5365 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*,
5366 const UDT&)>
5367 LEGION_DEPRECATED(
5368 "Task registration should be done with "
5371 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5372 const UDT& user_data, VariantID vid = LEGION_AUTO_GENERATE_ID,
5374 const char* task_name = nullptr);
5390 template<
5391 typename UDT, void (*TASK_PTR)(
5392 const Task*, const std::vector<PhysicalRegion>&,
5393 Context, Runtime*, const UDT&)>
5394 LEGION_DEPRECATED(
5395 "Task registration should be done with "
5398 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5399 const UDT& user_data, VariantID vid = LEGION_AUTO_GENERATE_ID,
5401 const char* task_name = nullptr);
5402 public:
5409 static bool has_runtime(void);
5410
5418 static Runtime* get_runtime(Processor p = Processor::NO_PROC);
5419
5426 static bool has_context(void);
5427
5434 static Context get_context(void);
5435
5441 static const Task* get_context_task(Context ctx);
5442 private:
5443 IndexPartition create_restricted_partition(
5444 Context ctx, IndexSpace parent, IndexSpace color_space,
5445 const void* transform, size_t transform_size, const void* extent,
5446 size_t extent_size, PartitionKind part_kind, Color color,
5447 const char* provenance, const char* func_name, bool blockify);
5448 IndexSpace create_index_space_union_internal(
5449 Context ctx, IndexPartition parent, const void* realm_color,
5450 size_t color_size, TypeTag type_tag, const char* provenance,
5451 const char* func, const std::vector<IndexSpace>& handles);
5452 IndexSpace create_index_space_union_internal(
5453 Context ctx, IndexPartition parent, const void* realm_color,
5454 size_t color_size, TypeTag type_tag, const char* provenance,
5455 const char* func, IndexPartition handle);
5456 IndexSpace create_index_space_intersection_internal(
5457 Context ctx, IndexPartition parent, const void* realm_color,
5458 size_t color_size, TypeTag type_tag, const char* provenance,
5459 const char* func, const std::vector<IndexSpace>& handles);
5460 IndexSpace create_index_space_intersection_internal(
5461 Context ctx, IndexPartition parent, const void* realm_color,
5462 size_t color_size, TypeTag type_tag, const char* provenance,
5463 const char* func, IndexPartition handle);
5464 IndexSpace create_index_space_difference_internal(
5465 Context ctx, IndexPartition paretn, const void* realm_color,
5466 size_t color_size, TypeTag type_tag, const char* provenance,
5467 const char* func, IndexSpace initial,
5468 const std::vector<IndexSpace>& handles);
5469 IndexSpace get_index_subspace_internal(
5470 IndexPartition handle, const void* realm_color, TypeTag type_tag);
5471 bool has_index_subspace_internal(
5472 IndexPartition handle, const void* realm_color, TypeTag type_tag);
5473 void get_index_partition_color_space_internal(
5474 IndexPartition handle, void* realm_is, TypeTag type_tag);
5475 void get_index_space_domain_internal(
5476 IndexSpace handle, void* realm_is, TypeTag type_tag);
5477 void get_index_space_color_internal(
5478 IndexSpace handle, void* realm_color, TypeTag type_tag);
5479 bool safe_cast_internal(
5480 Context ctx, LogicalRegion region, const void* realm_point,
5481 TypeTag type_tag, const char* func_name);
5482 LogicalRegion get_logical_subregion_by_color_internal(
5483 LogicalPartition parent, const void* realm_color, TypeTag type_tag);
5484 bool has_logical_subregion_by_color_internal(
5485 LogicalPartition parent, const void* realm_color, TypeTag type_tag);
5486 private:
5487 // Methods for the wrapper functions to get information from the runtime
5488 friend class LegionTaskWrapper;
5489 friend class LegionSerialization;
5490 public:
5491 // This method is hidden down here and not publicly documented because
5492 // users shouldn't really need it for anything, however there are some
5493 // reasonable cases where it might be utilitized for things like doing
5494 // file I/O or printf that people might want it for so we've got it
5495 ShardID get_shard_id(Context ctx, bool I_know_what_I_am_doing = false);
5496 // We'll also allow users to get the total number of shards in the context
5497 // if they also ar willing to attest they know what they are doing
5498 size_t get_num_shards(Context ctx, bool I_know_what_I_am_doing = false);
5499 // This is another hidden method for control replication because it's
5500 // still somewhat experimental. In some cases there are unavoidable
5501 // sources of randomness that can mess with the needed invariants for
5502 // control replication (e.g. garbage collectors). This method will
5503 // allow the application to pass in an array of elements from each shard
5504 // and the runtime will fill in an output buffer with an ordered array of
5505 // elements that were passed in by every shard. Each shard will get the
5506 // same elements that were present in all the other shards in the same
5507 // order in the output array. The number of elements in the output buffer
5508 // is returned as a future (of type size_t) as the runtime will return
5509 // immediately and the application can continue running ahead. The
5510 // application must keep the input and output buffers allocated until
5511 // the future resolves. By definition the output buffer need be no bigger
5512 // than the input buffer since only elements that are in the input buffer
5513 // on any shard can appear in the output buffer. Note you can use this
5514 // method safely in contexts that are not control replicated as well:
5515 // the input will just be mem-copied to the output and num_elements
5516 // returned as the future result.
5517 Future consensus_match(
5518 Context ctx, const void* input, void* output, size_t num_elements,
5519 size_t element_size, const char* provenance = nullptr);
5520 private:
5521 friend class Mapper;
5522 Internal::Runtime* runtime;
5523 };
5524
5525} // namespace Legion
5526
5527#include "legion/api/runtime.inl"
5528
5529#endif // __LEGION_RUNTIME_H__
Definition argument_map.h:93
Definition functors.h:328
Definition geometry.h:159
Definition geometry.h:34
Definition transforms.h:123
Definition sync.h:183
Definition exception.h:175
Definition physical_region.h:185
Definition data.h:336
Definition data.h:152
Definition functors.h:361
Definition future.h:50
Definition future_map.h:41
Definition sync.h:102
Definition data.h:92
Definition data.h:127
Definition data.h:35
Definition data.h:70
Definition constraints.h:881
Definition interop.h:38
Definition sync.h:57
Definition data.h:260
Definition data.h:304
Definition data.h:189
Definition data.h:229
Definition interop.h:101
Definition output_region.h:34
Definition sync.h:147
Definition physical_region.h:38
Definition functors.h:381
Definition predicate.h:38
Definition functors.h:45
Definition runtime.h:108
void * get_local_task_variable_untyped(Context ctx, LocalVariableID id)
void attach_semantic_information(TaskID task_id, SemanticTag tag, const void *buffer, size_t size, bool is_mutable=false, bool local_only=false)
void destroy_index_partition(Context ctx, IndexPartition handle, const bool unordered=false, const bool recurse=true, const char *provenance=nullptr)
IndexPartition create_partition_by_weights(Context ctx, IndexSpace parent, const std::map< DomainPoint, int > &weights, IndexSpace color_space, size_t granularity=1, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
Future issue_mapping_fence(Context ctx, const char *provenance=nullptr)
static TaskID generate_static_task_id(void)
void end_mapper_call(Mapping::MapperContext ctx)
Future get_current_time_in_nanoseconds(Context ctx, Future precondition=Future())
void add_mapper(MapperID map_id, Mapping::Mapper *mapper, Processor proc=Processor::NO_PROC)
Future reduce_future_map(Context ctx, const FutureMap &future_map, ReductionOpID redop, bool ordered=true, MapperID map_id=0, MappingTagID tag=0, const char *provenance=nullptr, Future initial_value=Future())
static Context get_context(void)
unsigned get_index_partition_depth(Context ctx, IndexPartition handle)
ConcurrentID generate_dynamic_concurrent_id(void)
DynamicCollective advance_dynamic_collective(Context ctx, DynamicCollective dc)
void concurrent_task_barrier(Context ctx)
IndexSpace create_index_space(Context ctx, size_t dimensions, const Future &f, TypeTag type_tag=0, const char *provenance=nullptr)
void fill_fields(Context ctx, LogicalRegion handle, LogicalRegion parent, const std::set< FieldID > &fields, const T &value, Predicate pred=Predicate::TRUE_PRED)
static void preregister_concurrent_coloring_functor(ConcurrentID cid, ConcurrentColoringFunctor *functor)
void arrive_dynamic_collective(Context ctx, DynamicCollective dc, const void *buffer, size_t size, unsigned count=1)
void fill_field(Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid, const T &value, Predicate pred=Predicate::TRUE_PRED)
IndexPartition create_partition_by_restriction(Context ctx, IndexSpace parent, IndexSpace color_space, DomainTransform transform, Domain extent, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
const char * get_layout_constraints_name(LayoutConstraintID layout_id)
void get_index_space_partition_colors(Context ctx, IndexSpace sp, std::set< Color > &colors)
FutureMap execute_index_space(Context ctx, const IndexTaskLauncher &launcher, std::vector< OutputRequirement > *outputs=nullptr)
int get_tunable_value(Context ctx, TunableID tid, MapperID mapper=0, MappingTagID tag=0)
PhysicalRegion attach_hdf5(Context ctx, const char *file_name, LogicalRegion handle, LogicalRegion parent, const std::map< FieldID, const char * > &field_map, LegionFileMode mode)
const Task * get_local_task(Context ctx)
Color get_logical_partition_color(Context ctx, LogicalPartition handle)
Future get_dynamic_collective_result(Context ctx, DynamicCollective dc, const char *provenance=nullptr)
void get_index_space_domains(Context ctx, IndexSpace handle, std::vector< Domain > &domains)
bool has_parent_index_partition(Context ctx, IndexSpace handle)
MapperID generate_library_mapper_ids(const char *name, size_t count)
void issue_acquire(Context ctx, const AcquireLauncher &launcher)
FieldSpace create_field_space(Context ctx, const char *provenance=nullptr)
IndexSpace create_index_space(Context ctx, const Domain &bounds, TypeTag type_tag=0, const char *provenance=nullptr, const bool take_ownership=false)
void print_once(Context ctx, FILE *f, const char *message)
TaskID generate_dynamic_task_id(void)
IndexPartition get_index_partition(Context ctx, IndexSpace parent, Color color)
void release_grant(Context ctx, Grant grant)
static const SerdezOp * get_serdez_op(CustomSerdezID serdez_id)
static TraceID generate_static_trace_id(void)
bool is_index_partition_disjoint(Context ctx, IndexPartition p)
bool has_index_partition(Context ctx, IndexSpace parent, Color color)
static void register_custom_serdez_op(CustomSerdezID serdez_id, bool permit_duplicates=false)
IndexPartition create_partition_by_blockify(Context ctx, IndexSpace parent, DomainPoint blocking_factor, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
PhaseBarrier create_phase_barrier(Context ctx, unsigned arrivals)
Context begin_implicit_task(TaskID top_task_id, MapperID mapper_id, Processor::Kind proc_kind=Processor::NO_KIND, const char *task_name=nullptr, bool control_replicable=false, unsigned shard_per_address_space=1, int shard_id=-1, DomainPoint shard_point=DomainPoint())
ShardingID generate_dynamic_sharding_id(void)
void create_shared_ownership(Context ctx, IndexSpace handle)
ExceptionHandlerID generate_dynamic_exception_handler_id(void)
IndexSpace create_index_space(Context ctx, const std::vector< DomainPoint > &points, const char *provenance=nullptr)
static void enable_profiling(void)
IndexSpace intersect_index_spaces(Context ctx, const std::vector< IndexSpace > &spaces, const char *provenance=nullptr)
void create_association(Context ctx, LogicalRegion domain, LogicalRegion domain_parent, FieldID domain_fid, IndexSpace range, MapperID id=0, MappingTagID tag=0, UntypedBuffer map_arg=UntypedBuffer(), const char *provenance=nullptr)
bool is_index_partition_complete(Context ctx, IndexPartition p)
IndexPartition create_partition_by_union(Context ctx, IndexSpace parent, IndexPartition handle1, IndexPartition handle2, IndexSpace color_space, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
void register_projection_functor(ProjectionID pid, ProjectionFunctor *functor, bool silence_warnings=false, const char *warning_string=nullptr)
FieldAllocator create_field_allocator(Context ctx, FieldSpace handle)
void get_field_space_fields(Context ctx, FieldSpace handle, std::vector< FieldID > &fields)
ArgumentMap create_argument_map(Context ctx)
ConcurrentID generate_library_concurrent_ids(const char *name, size_t count)
static void add_registration_callback(RegistrationCallback callback, bool dedup=true, size_t dedup_tag=0)
static void disable_profiling(void)
static int wait_for_shutdown(void)
void unbind_implicit_task_from_external_thread(Context ctx)
static Runtime * get_runtime(Processor p=Processor::NO_PROC)
void complete_frame(Context ctx, const char *provenance=nullptr)
void register_concurrent_coloring_functor(ConcurrentID cid, ConcurrentColoringFunctor *functor, bool silence_warnings=false, const char *warning_string=nullptr)
const Task * get_current_task(Context ctx)
IndexSpace get_index_partition_color_space_name(Context ctx, IndexPartition p)
void issue_copy_operation(Context ctx, const CopyLauncher &launcher)
static ExceptionHandlerID generate_static_exception_handler_id(void)
void reset_equivalence_sets(Context ctx, LogicalRegion parent, LogicalRegion region, const std::set< FieldID > &fields)
Mapping::Mapper * get_mapper(Context ctx, MapperID id, Processor target=Processor::NO_PROC)
void destroy_field_space(Context ctx, FieldSpace handle, const bool unordered=false, const char *provenance=nullptr)
IndexPartition create_partition_by_difference(Context ctx, IndexSpace parent, IndexPartition handle1, IndexPartition handle2, IndexSpace color_space, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
OutputRegion get_output_region(Context ctx, unsigned index)
bool has_parent_logical_partition(Context ctx, LogicalRegion handle)
IndexPartition create_partition_by_field(Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid, IndexSpace color_space, Color color=LEGION_AUTO_GENERATE_ID, MapperID id=0, MappingTagID tag=0, PartitionKind part_kind=LEGION_DISJOINT_KIND, UntypedBuffer map_arg=UntypedBuffer(), const char *provenance=nullptr)
CustomSerdezID generate_dynamic_serdez_id(void)
IndexSpace subtract_index_spaces(Context ctx, IndexSpace left, IndexSpace right, const char *provenance=nullptr)
void unmap_region(Context ctx, PhysicalRegion region)
FutureMap execute_must_epoch(Context ctx, const MustEpochLauncher &launcher)
void release_memory_pool(Context ctx, Memory target)
static void set_return_code(int return_code)
static LegionHandshake create_external_handshake(bool init_in_ext=true, int ext_participants=1, int legion_participants=1)
LogicalPartition get_parent_logical_partition(Context ctx, LogicalRegion handle)
Predicate predicate_not(Context ctx, const Predicate &p, const char *provenance=nullptr)
void destroy_lock(Context ctx, Lock l)
IndexPartition create_equal_partition(Context ctx, IndexSpace parent, IndexSpace color_space, size_t granularity=1, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
IndexSpace create_index_space(Context ctx, const std::vector< Domain > &rects, const char *provenance=nullptr)
IndexSpace create_index_space_intersection(Context ctx, IndexPartition parent, const DomainPoint &color, const std::vector< IndexSpace > &handles, const char *provenance=nullptr)
Future get_predicate_future(Context ctx, const Predicate &p, const char *provenance=nullptr)
void begin_trace(Context ctx, TraceID tid, bool logical_only=false, bool static_trace=false, const std::set< RegionTreeID > *managed=nullptr, const char *provenance=nullptr)
static void initialize(int *argc, char ***argv, bool filter=false, bool parse=true, bool realm_initialize_network=true, bool realm_create_configure_machine=true)
UntypedDeferredValue allocate_deferred_value(Context ctx, const DeferredValueRequest &request)
Color create_cross_product_partitions(Context ctx, IndexPartition handle1, IndexPartition handle2, std::map< IndexSpace, IndexPartition > &handles, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
static ConcurrentID generate_static_concurrent_id(void)
IndexSpace union_index_spaces(Context ctx, const std::vector< IndexSpace > &spaces, const char *provenance=nullptr)
static void configure_MPI_interoperability(int rank)
const std::map< AddressSpace, int > & find_reverse_MPI_mapping(void)
LogicalRegion get_logical_subregion(Context ctx, LogicalPartition parent, IndexSpace handle)
Future execute_task(Context ctx, const TaskLauncher &launcher, std::vector< OutputRequirement > *outputs=nullptr)
static void set_top_level_task_id(TaskID top_id)
LogicalRegion get_logical_subregion_by_tree(Context ctx, IndexSpace handle, FieldSpace fspace, RegionTreeID tid)
static const Task * get_context_task(Context ctx)
TraceID generate_dynamic_trace_id(void)
void replace_default_mapper(Mapping::Mapper *mapper, Processor proc=Processor::NO_PROC)
Future select_tunable_value(Context ctx, TunableID tid, MapperID mapper=0, MappingTagID tag=0, const void *args=nullptr, size_t argsize=0)
void get_layout_constraints(LayoutConstraintID layout_id, LayoutConstraintSet &layout_constraints)
UntypedDeferredBuffer< COORD_T > allocate_deferred_buffer(Context ctx, const DeferredBufferRequest &request)
static void legion_task_postamble(Context ctx, const void *retvalptr=nullptr, size_t retvalsize=0, bool owned=false, Realm::RegionInstance inst=Realm::RegionInstance::NO_INST, const void *metadataptr=nullptr, size_t metadatasize=0)
MapperID generate_dynamic_mapper_id(void)
void defer_dynamic_collective_arrival(Context ctx, DynamicCollective dc, const Future &f, unsigned count=1)
void destroy_logical_region(Context ctx, LogicalRegion handle, const bool unordered=false, const char *provenance=nullptr)
void log_once(Context ctx, Realm::LoggerMessage &message)
PhysicalRegion map_region(Context ctx, const InlineLauncher &launcher)
static void legion_task_preamble(const void *data, size_t datalen, Processor p, const Task *&task, const std::vector< PhysicalRegion > *&reg, Context &ctx, Runtime *&runtime)
void end_trace(Context ctx, TraceID tid, const char *provenance=nullptr)
IndexPartition create_partition_by_image(Context ctx, IndexSpace handle, LogicalPartition projection, LogicalRegion parent, FieldID fid, IndexSpace color_space, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, MapperID id=0, MappingTagID tag=0, UntypedBuffer map_arg=UntypedBuffer(), const char *provenance=nullptr)
void destroy_deferred_value(Context ctx, UntypedDeferredValue &value, Realm::Event precondition=Realm::Event::NO_EVENT)
Future issue_execution_fence(Context ctx, const char *provenance=nullptr)
void destroy_dynamic_collective(Context ctx, DynamicCollective dc)
void start_profiling_range(Context ctx)
size_t query_available_memory(Context ctx, Memory target, bool escaping=true)
static ConcurrentColoringFunctor * get_concurrent_coloring_functor(ConcurrentID cid)
Color get_index_partition_color(Context ctx, IndexPartition handle)
static void register_reduction_op(ReductionOpID redop_id, bool permit_duplicates=false)
void destroy_phase_barrier(Context ctx, PhaseBarrier pb)
PhysicalRegion attach_file(Context ctx, const char *file_name, LogicalRegion handle, LogicalRegion parent, const std::vector< FieldID > &field_vec, LegionFileMode mode)
Future detach_external_resource(Context ctx, PhysicalRegion region, const bool flush=true, const bool unordered=false, const char *provenance=nullptr)
static LayoutConstraintID preregister_layout(const LayoutConstraintRegistrar &registrar, LayoutConstraintID layout_id=LEGION_AUTO_GENERATE_ID)
bool retrieve_semantic_information(TaskID task_id, SemanticTag tag, const void *&result, size_t &size, bool can_fail=false, bool wait_until_ready=false)
ExternalResources attach_external_resources(Context ctx, const IndexAttachLauncher &launcher)
Predicate create_predicate(Context ctx, const Future &f, const char *provenance=nullptr)
Future pop_exception_handler(Context ctx, const char *provenance=nullptr)
void begin_static_trace(Context ctx, const std::set< RegionTreeID > *managed=nullptr)
static ShardingFunctor * get_sharding_functor(ShardingID sid)
TaskID generate_library_task_ids(const char *name, size_t count)
CustomSerdezID generate_library_serdez_ids(const char *name, size_t count)
Color get_index_space_color(Context ctx, IndexSpace handle)
void get_output_regions(Context ctx, std::vector< OutputRegion > &regions)
void discard_fields(Context ctx, const DiscardLauncher &launcher)
void finish_implicit_task(Context ctx, Realm::Event effects=Realm::Event::NO_EVENT)
size_t get_field_size(Context ctx, FieldSpace handle, FieldID fid)
void attach_name(TaskID task_id, const char *name, bool is_mutable=false, bool local_only=false)
DomainPoint safe_cast(Context ctx, DomainPoint point, LogicalRegion region)
static const ReductionOp * get_reduction_op(ReductionOpID redop_id)
VariantID register_task_variant(const TaskVariantRegistrar &registrar, VariantID vid=LEGION_AUTO_GENERATE_ID)
PhaseBarrier advance_phase_barrier(Context ctx, PhaseBarrier pb)
static CustomSerdezID generate_static_serdez_id(void)
IndexPartition create_partition_by_preimage(Context ctx, IndexPartition projection, LogicalRegion handle, LogicalRegion parent, FieldID fid, IndexSpace color_space, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, MapperID id=0, MappingTagID tag=0, UntypedBuffer map_arg=UntypedBuffer(), const char *provenance=nullptr)
IndexPartition create_partition_by_domain(Context ctx, IndexSpace parent, const std::map< DomainPoint, Domain > &domains, IndexSpace color_space, bool perform_intersections=true, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr, bool take_ownership=false)
IndexPartition create_pending_partition(Context ctx, IndexSpace parent, IndexSpace color_space, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
ReductionOpID generate_library_reduction_ids(const char *name, size_t count)
Future launch_top_level_task(const TaskLauncher &launcher)
FieldSpace get_layout_constraint_field_space(LayoutConstraintID layout_id)
static ProjectionID register_region_function(ProjectionID handle)
static ProjectionFunctor * get_projection_functor(ProjectionID pid)
LogicalPartition get_logical_partition_by_tree(Context ctx, IndexPartition handle, FieldSpace fspace, RegionTreeID tid)
IndexPartition get_parent_index_partition(Context ctx, IndexSpace handle)
bool is_MPI_interop_configured(void)
static ProjectionID register_partition_function(ProjectionID handle)
Future issue_timing_measurement(Context ctx, const TimingLauncher &launcher)
void issue_release(Context ctx, const ReleaseLauncher &launcher)
int find_local_MPI_rank(void)
bool has_index_subspace(Context ctx, IndexPartition p, const DomainPoint &color)
static void register_custom_serdez_op(CustomSerdezID serdez_id, SerdezOp *serdez_op, bool permit_duplicates=false)
static void set_top_level_task_mapper_id(MapperID mapper_id)
static void preregister_projection_functor(ProjectionID pid, ProjectionFunctor *functor)
void set_local_task_variable_untyped(Context ctx, LocalVariableID id, const void *value, void(*destructor)(void *)=nullptr)
ProjectionID generate_library_projection_ids(const char *name, size_t count)
Future detach_external_resources(Context ctx, ExternalResources external, const bool flush=true, const bool unordered=false, const char *provenance=nullptr)
void bind_implicit_task_to_external_thread(Context ctx)
static TaskID register_legion_task(TaskID id, Processor::Kind proc_kind, bool single, bool index, VariantID vid=LEGION_AUTO_GENERATE_ID, TaskConfigOptions options=TaskConfigOptions(), const char *task_name=nullptr)
LayoutConstraintID register_layout(const LayoutConstraintRegistrar &registrar)
Processor get_executing_processor(Context ctx)
IndexSpace get_index_subspace(Context ctx, IndexPartition p, Color color)
const std::map< int, AddressSpace > & find_forward_MPI_mapping(void)
Domain get_index_space_domain(Context ctx, IndexSpace handle)
DynamicCollective create_dynamic_collective(Context ctx, unsigned arrivals, ReductionOpID redop, const void *init_value, size_t init_size)
TraceID generate_library_trace_ids(const char *name, size_t count)
void unmap_all_regions(Context ctx)
bool has_logical_partition_by_color(Context ctx, LogicalRegion parent, const DomainPoint &c)
Predicate predicate_or(Context ctx, const Predicate &p1, const Predicate &p2, const char *provenance=nullptr)
static const char * get_legion_version(void)
void remap_region(Context ctx, PhysicalRegion region, const char *provenance=nullptr)
PhysicalRegion attach_external_resource(Context ctx, const AttachLauncher &launcher)
void destroy_deferred_buffer(Context ctx, UntypedDeferredBuffer< COORD_T > &buffer, Realm::Event precondition=Realm::Event::NO_EVENT)
bool has_logical_subregion_by_color(Context ctx, LogicalPartition parent, const DomainPoint &c)
Future get_current_time(Context ctx, Future precondition=Future())
static bool has_context(void)
void register_exception_handler(ExceptionHandlerID hid, ExceptionHandler *handler)
ExceptionHandlerID generate_library_exception_handler_ids(const char *name, size_t count)
static MPILegionHandshake create_handshake(bool init_in_MPI=true, int mpi_participants=1, int legion_participants=1)
IndexSpace get_parent_index_space(Context ctx, IndexPartition handle)
LogicalPartition get_logical_partition(Context ctx, LogicalRegion parent, IndexPartition handle)
IndexSpace create_index_space_union(Context ctx, IndexPartition parent, const DomainPoint &color, const std::vector< IndexSpace > &handles, const char *provenance=nullptr)
Domain get_index_partition_color_space(Context ctx, IndexPartition p)
LogicalRegion create_logical_region(Context ctx, IndexSpace index, FieldSpace fields, bool task_local=false, const char *provenance=nullptr)
void end_static_trace(Context ctx)
static const InputArgs & get_input_args(void)
ShardingID generate_library_sharding_ids(const char *name, size_t count)
static ShardingID generate_static_sharding_id(void)
FutureMap construct_future_map(Context ctx, IndexSpace domain, const std::map< DomainPoint, UntypedBuffer > &data, bool collective=false, ShardingID sid=0, bool implicit_sharding=false, const char *provenance=nullptr)
IndexSpace create_index_space_difference(Context ctx, IndexPartition parent, const DomainPoint &color, IndexSpace initial, const std::vector< IndexSpace > &handles, const char *provenancne=nullptr)
static ExceptionHandler * get_exception_handler(ExceptionHandlerID hid)
static VariantID preregister_task_variant(const TaskVariantRegistrar &registrar, const char *task_name=nullptr, VariantID vid=LEGION_AUTO_GENERATE_ID)
void yield(Context ctx)
void detach_hdf5(Context ctx, PhysicalRegion region)
void retrieve_name(TaskID task_id, const char *&result)
bool has_multiple_domains(Context ctx, IndexSpace handle)
LogicalRegion get_logical_subregion_by_color(Context ctx, LogicalPartition parent, Color c)
Color get_logical_region_color(Context ctx, LogicalRegion handle)
static size_t get_maximum_dimension(void)
LogicalPartition get_logical_partition_by_color(Context ctx, LogicalRegion parent, Color c)
static ReductionOpID generate_static_reduction_id(void)
static void dump_profiling(void)
void raise_region_exception(Context ctx, PhysicalRegion region, bool nuclear)
void release_layout(LayoutConstraintID layout_id)
static long long get_zero_time(void)
void destroy_logical_partition(Context ctx, LogicalPartition handle, const bool unordered=false)
Grant acquire_grant(Context ctx, const std::vector< LockRequest > &requests)
unsigned get_index_space_depth(Context ctx, IndexSpace handle)
static MapperID generate_static_mapper_id(void)
Mapping::MapperRuntime * get_mapper_runtime(void)
Lock create_lock(Context ctx)
void register_sharding_functor(ShardingID sid, ShardingFunctor *functor, bool silence_warnings=false, const char *warning_string=nullptr)
LogicalRegion get_parent_logical_region(Context ctx, LogicalPartition handle)
static int start(int argc, char **argv, bool background=false, bool supply_default_mapper=true, bool filter=false, bool realm_initialize_network=true, bool realm_configure_machine=true)
static void set_registration_callback(RegistrationCallback callback)
static bool has_runtime(void)
IndexPartition create_partition_by_intersection(Context ctx, IndexSpace parent, IndexPartition handle1, IndexPartition handle2, IndexSpace color_space, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr)
static void preregister_exception_handler(ExceptionHandlerID cid, ExceptionHandler *handler)
void progress_unordered_operations(Context ctx)
Future get_current_time_in_microseconds(Context ctx, Future precondition=Future())
void detach_file(Context ctx, PhysicalRegion region)
static void perform_registration_callback(RegistrationCallback callback, bool global, bool deduplicate=true, size_t dedup_tag=0)
static void preregister_sharding_functor(ShardingID sid, ShardingFunctor *functor)
IndexPartitionT< DIM, COORD_T > create_partition_by_rectangles(Context ctx, IndexSpaceT< DIM, COORD_T > parent, const std::map< Point< COLOR_DIM, COLOR_COORD_T >, std::vector< Rect< DIM, COORD_T > > > &rectangles, IndexSpaceT< COLOR_DIM, COLOR_COORD_T > color_space, bool perform_intersections=true, PartitionKind part_kind=LEGION_COMPUTE_KIND, Color color=LEGION_AUTO_GENERATE_ID, const char *provenance=nullptr, bool collective=false)
static ProjectionID generate_static_projection_id(void)
void record_asynchronous_effect(Context ctx, Realm::Event effect, const char *provenance=nullptr)
std::function< DomainPoint(const DomainPoint &, const Domain &, const Domain &)> PointTransformFunc
Definition runtime.h:2254
void push_exception_handler(Context ctx, ExceptionHandlerID handler)
void destroy_index_space(Context ctx, IndexSpace handle, const bool unordered=false, const bool recurse=true, const char *provenance=nullptr)
ProjectionID generate_dynamic_projection_id(void)
ReductionOpID generate_dynamic_reduction_id(void)
Mapping::MapperContext begin_mapper_call(Context ctx, MapperID id, Processor target=Processor::NO_PROC)
Predicate predicate_and(Context ctx, const Predicate &p1, const Predicate &p2, const char *provenance=nullptr)
Definition functors.h:286
Definition mapping.h:112
Definition argument_map.h:40
Definition buffers.h:190
Definition values.h:61
Definition accessors.h:29
Definition launchers.h:965
Definition launchers.h:726
Definition launchers.h:362
Definition buffers.h:33
Definition values.h:33
Definition launchers.h:683
Definition requirements.h:316
Definition launchers.h:527
Definition launchers.h:817
Definition launchers.h:441
Definition launchers.h:587
Definition requirements.h:289
Definition launchers.h:183
Definition launchers.h:304
Definition runtime.h:46
Definition registrars.h:39
Definition sync.h:81
Definition launchers.h:1066
Definition requirements.h:250
Definition launchers.h:903
Definition requirements.h:42
Definition runtime.h:56
Definition launchers.h:1012
Definition runtime.h:75
Definition launchers.h:78
Definition registrars.h:111
Definition launchers.h:919
Definition launchers.h:937