Legion Runtime
Loading...
Searching...
No Matches
runtime.h
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
19#include "legion/api/buffers.h"
20#include "legion/api/functors.h"
21#include "legion/api/future.h"
22#include "legion/api/launchers.h"
23#include "legion/api/registrars.h"
24#include "legion/api/transforms.h"
25#include "legion/api/values.h"
26
27#define LEGION_PRINT_ONCE(runtime, ctx, file, fmt, ...) \
28 { \
29 char message[4096]; \
30 snprintf(message, 4096, fmt, ##__VA_ARGS__); \
31 runtime->print_once(ctx, file, message); \
32 }
33
34namespace Legion {
35
41 struct InputArgs {
42 public:
43 char** argv;
44 int argc;
45 };
46
52 Machine machine;
53 Runtime* runtime;
54 std::set<Processor> local_procs;
55 UntypedBuffer buffer;
56 };
57
71 public:
73 bool leaf = false, bool inner = false, bool idempotent = false);
74 public:
75 bool leaf;
76 bool inner;
77 bool idempotent;
78 };
79
103 class Runtime {
104 protected:
105 // The Runtime bootstraps itself and should
106 // never need to be explicitly created.
107 friend class Internal::Runtime;
108 friend class Future;
109 Runtime(Internal::Runtime* rt);
110 public:
111 //------------------------------------------------------------------------
112 // Index Space Operations
113 //------------------------------------------------------------------------
115
130 Context ctx, const Domain& bounds, TypeTag type_tag = 0,
131 const char* provenance = nullptr, const bool take_ownership = false);
132 // Template version
133 template<int DIM, typename COORD_T>
134 IndexSpaceT<DIM, COORD_T> create_index_space(
135 Context ctx, const Rect<DIM, COORD_T>& bounds,
136 const char* provenance = nullptr);
137 template<int DIM, typename COORD_T>
138 IndexSpaceT<DIM, COORD_T> create_index_space(
139 Context ctx, const DomainT<DIM, COORD_T>& bounds,
140 const char* provenance = nullptr, const bool take_ownership = false);
143
157 Context ctx, size_t dimensions, const Future& f, TypeTag type_tag = 0,
158 const char* provenance = nullptr);
159 template<int DIM, typename COORD_T>
160 IndexSpaceT<DIM, COORD_T> create_index_space(
161 Context ctx, const Future& f, const char* provenance = nullptr);
164
173 Context ctx, const std::vector<DomainPoint>& points,
174 const char* provenance = nullptr);
175 // Template version
176 template<int DIM, typename COORD_T>
177 IndexSpaceT<DIM, COORD_T> create_index_space(
178 Context ctx, const std::vector<Point<DIM, COORD_T> >& points,
179 const char* provenance = nullptr);
182
191 Context ctx, const std::vector<Domain>& rects,
192 const char* provenance = nullptr);
193 // Template version
194 template<int DIM, typename COORD_T>
195 IndexSpaceT<DIM, COORD_T> create_index_space(
196 Context ctx, const std::vector<Rect<DIM, COORD_T> >& rects,
197 const char* provenance = nullptr);
200
210 Context ctx, const std::vector<IndexSpace>& spaces,
211 const char* provenance = nullptr);
212 // Template version
213 template<int DIM, typename COORD_T>
214 IndexSpaceT<DIM, COORD_T> union_index_spaces(
215 Context ctx, const std::vector<IndexSpaceT<DIM, COORD_T> >& spaces,
216 const char* provenance = nullptr);
219
229 Context ctx, const std::vector<IndexSpace>& spaces,
230 const char* provenance = nullptr);
231 // Template version
232 template<int DIM, typename COORD_T>
233 IndexSpaceT<DIM, COORD_T> intersect_index_spaces(
234 Context ctx, const std::vector<IndexSpaceT<DIM, COORD_T> >& spaces,
235 const char* provenance = nullptr);
238
245 Context ctx, IndexSpace left, IndexSpace right,
246 const char* provenance = nullptr);
247 // Template version
248 template<int DIM, typename COORD_T>
249 IndexSpaceT<DIM, COORD_T> subtract_index_spaces(
250 Context ctx, IndexSpaceT<DIM, COORD_T> left,
251 IndexSpaceT<DIM, COORD_T> right, const char* provenance = nullptr);
253
260 LEGION_DEPRECATED(
261 "Use the new index space creation routines with a "
262 "single domain or rectangle.")
263 IndexSpace create_index_space(Context ctx, size_t max_num_elmts);
271 LEGION_DEPRECATED(
272 "Use the new index space creation routines with a "
273 "single domain or rectangle.")
274 IndexSpace create_index_space(Context ctx, const std::set<Domain>& domains);
285 void create_shared_ownership(Context ctx, IndexSpace handle);
297 Context ctx, IndexSpace handle, const bool unordered = false,
298 const bool recurse = true, const char* provenance = nullptr);
299 public:
310 void create_shared_ownership(Context ctx, IndexPartition handle);
322 Context ctx, IndexPartition handle, const bool unordered = false,
323 const bool recurse = true, const char* provenance = nullptr);
324 public:
325 //------------------------------------------------------------------------
326 // Dependent Partitioning Operations
327 //------------------------------------------------------------------------
329
350 Context ctx, IndexSpace parent, IndexSpace color_space,
351 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
352 const char* provenance = nullptr);
353 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
355 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
356 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
357 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
358 const char* provenance = nullptr);
361
379 Context ctx, IndexSpace parent,
380 const std::map<DomainPoint, int>& weights, IndexSpace color_space,
381 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
382 const char* provenance = nullptr);
383 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
385 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
386 const std::map<Point<COLOR_DIM, COLOR_COORD_T>, int>& weights,
387 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
388 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
389 const char* provenance = nullptr);
390 // 64-bit versions
392 Context ctx, IndexSpace parent,
393 const std::map<DomainPoint, size_t>& weights, IndexSpace color_space,
394 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
395 const char* provenance = nullptr);
396 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
398 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
399 const std::map<Point<COLOR_DIM, COLOR_COORD_T>, size_t>& weights,
400 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
401 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
402 const char* provenance = nullptr);
403 // Alternate versions of the above method that take a future map where
404 // the values in the future map will be interpretted as integer weights
405 // You can use this method with both 32 and 64 bit weights
407 Context ctx, IndexSpace parent, const FutureMap& weights,
408 IndexSpace color_space, size_t granularity = 1,
409 Color color = LEGION_AUTO_GENERATE_ID,
410 const char* provenance = nullptr);
411 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
413 Context ctx, IndexSpaceT<DIM, COORD_T> parent, const FutureMap& weights,
414 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
415 size_t granularity = 1, Color color = LEGION_AUTO_GENERATE_ID,
416 const char* provenance = nullptr);
419
444 Context ctx, IndexSpace parent, IndexPartition handle1,
445 IndexPartition handle2, IndexSpace color_space,
446 PartitionKind part_kind = LEGION_COMPUTE_KIND,
447 Color color = LEGION_AUTO_GENERATE_ID,
448 const char* provenance = nullptr);
449 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
451 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
452 IndexPartitionT<DIM, COORD_T> handle1,
453 IndexPartitionT<DIM, COORD_T> handle2,
454 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
455 PartitionKind part_kind = LEGION_COMPUTE_KIND,
456 Color color = LEGION_AUTO_GENERATE_ID,
457 const char* provenance = nullptr);
460
486 Context ctx, IndexSpace parent, IndexPartition handle1,
487 IndexPartition handle2, IndexSpace color_space,
488 PartitionKind part_kind = LEGION_COMPUTE_KIND,
489 Color color = LEGION_AUTO_GENERATE_ID,
490 const char* provenance = nullptr);
491 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
493 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
494 IndexPartitionT<DIM, COORD_T> handle1,
495 IndexPartitionT<DIM, COORD_T> handle2,
496 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
497 PartitionKind part_kind = LEGION_COMPUTE_KIND,
498 Color color = LEGION_AUTO_GENERATE_ID,
499 const char* provenance = nullptr);
502
523 Context ctx, IndexSpace parent, IndexPartition partition,
524 PartitionKind part_kind = LEGION_COMPUTE_KIND,
525 Color color = LEGION_AUTO_GENERATE_ID, bool dominates = false,
526 const char* provenance = nullptr);
527 template<int DIM, typename COORD_T>
529 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
530 IndexPartitionT<DIM, COORD_T> partition,
531 PartitionKind part_kind = LEGION_COMPUTE_KIND,
532 Color color = LEGION_AUTO_GENERATE_ID, bool dominates = false,
533 const char* provenance = nullptr);
536
562 Context ctx, IndexSpace parent, IndexPartition handle1,
563 IndexPartition handle2, IndexSpace color_space,
564 PartitionKind part_kind = LEGION_COMPUTE_KIND,
565 Color color = LEGION_AUTO_GENERATE_ID,
566 const char* provenance = nullptr);
567 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
569 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
570 IndexPartitionT<DIM, COORD_T> handle1,
571 IndexPartitionT<DIM, COORD_T> handle2,
572 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
573 PartitionKind part_kind = LEGION_COMPUTE_KIND,
574 Color color = LEGION_AUTO_GENERATE_ID,
575 const char* provenance = nullptr);
578
604 Context ctx, IndexPartition handle1, IndexPartition handle2,
605 std::map<IndexSpace, IndexPartition>& handles,
606 PartitionKind part_kind = LEGION_COMPUTE_KIND,
607 Color color = LEGION_AUTO_GENERATE_ID,
608 const char* provenance = nullptr);
609 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
611 Context ctx, IndexPartitionT<DIM, COORD_T> handle1,
612 IndexPartitionT<DIM, COORD_T> handle2,
613 typename std::map<
614 IndexSpaceT<DIM, COORD_T>, IndexPartitionT<DIM, COORD_T> >& handles,
615 PartitionKind part_kind = LEGION_COMPUTE_KIND,
616 Color color = LEGION_AUTO_GENERATE_ID,
617 const char* provenance = nullptr);
620
645 Context ctx, LogicalRegion domain, LogicalRegion domain_parent,
646 FieldID domain_fid, IndexSpace range, MapperID id = 0,
647 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
648 const char* provenance = nullptr);
649 void create_bidirectional_association(
650 Context ctx, LogicalRegion domain, LogicalRegion domain_parent,
651 FieldID domain_fid, LogicalRegion range, LogicalRegion range_parent,
652 FieldID range_fid, MapperID id = 0, MappingTagID tag = 0,
653 UntypedBuffer map_arg = UntypedBuffer(),
654 const char* provenance = nullptr);
655 // Template versions
656 template<int DIM1, typename COORD_T1, int DIM2, typename COORD_T2>
658 Context ctx, LogicalRegionT<DIM1, COORD_T1> domain,
659 LogicalRegionT<DIM1, COORD_T1> domain_parent,
660 FieldID domain_fid, // type: Point<DIM2,COORD_T2>
661 IndexSpaceT<DIM2, COORD_T2> range, MapperID id = 0,
662 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
663 const char* provenance = nullptr);
664 template<int DIM1, typename COORD_T1, int DIM2, typename COORD_T2>
665 void create_bidirectional_association(
666 Context ctx, LogicalRegionT<DIM1, COORD_T1> domain,
667 LogicalRegionT<DIM1, COORD_T1> domain_parent,
668 FieldID domain_fid, // type: Point<DIM2,COORD_T2>
669 LogicalRegionT<DIM2, COORD_T2> range,
670 LogicalRegionT<DIM2, COORD_T2> range_parent,
671 FieldID range_fid, // type: Point<DIM1,COORD_T1>
672 MapperID id = 0, MappingTagID tag = 0,
673 UntypedBuffer map_arg = UntypedBuffer(),
674 const char* provenance = nullptr);
677
703 Context ctx, IndexSpace parent, IndexSpace color_space,
704 DomainTransform transform, Domain extent,
705 PartitionKind part_kind = LEGION_COMPUTE_KIND,
706 Color color = LEGION_AUTO_GENERATE_ID,
707 const char* provenance = nullptr);
708 // Template version
709 template<int DIM, int COLOR_DIM, typename COORD_T>
711 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
712 IndexSpaceT<COLOR_DIM, COORD_T> color_space,
713 Transform<DIM, COLOR_DIM, COORD_T> transform, Rect<DIM, COORD_T> extent,
714 PartitionKind part_kind = LEGION_COMPUTE_KIND,
715 Color color = LEGION_AUTO_GENERATE_ID,
716 const char* provenance = nullptr);
719
735 Context ctx, IndexSpace parent, DomainPoint blocking_factor,
736 Color color = LEGION_AUTO_GENERATE_ID,
737 const char* provenance = nullptr);
738 // Template version
739 template<int DIM, typename COORD_T>
741 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
742 Point<DIM, COORD_T> blocking_factor,
743 Color color = LEGION_AUTO_GENERATE_ID,
744 const char* provenance = nullptr);
758 Context ctx, IndexSpace parent, DomainPoint blockify_factor,
759 DomainPoint origin, Color color = LEGION_AUTO_GENERATE_ID,
760 const char* provenance = nullptr);
761 // Template version
762 template<int DIM, typename COORD_T>
764 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
765 Point<DIM, COORD_T> blocking_factor, Point<DIM, COORD_T> origin,
766 Color color = LEGION_AUTO_GENERATE_ID,
767 const char* provenance = nullptr);
770
793 Context ctx, IndexSpace parent,
794 const std::map<DomainPoint, Domain>& domains, IndexSpace color_space,
795 bool perform_intersections = true,
796 PartitionKind part_kind = LEGION_COMPUTE_KIND,
797 Color color = LEGION_AUTO_GENERATE_ID, const char* provenance = nullptr,
798 bool take_ownership = false);
799 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
801 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
802 const std::map<Point<COLOR_DIM, COLOR_COORD_T>, DomainT<DIM, COORD_T> >&
803 domains,
804 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
805 bool perform_intersections = true,
806 PartitionKind part_kind = LEGION_COMPUTE_KIND,
807 Color color = LEGION_AUTO_GENERATE_ID, const char* provenance = nullptr,
808 bool take_ownership = false);
827 Context ctx, IndexSpace parent, const FutureMap& domain_future_map,
828 IndexSpace color_space, bool perform_intersections = true,
829 PartitionKind part_kind = LEGION_COMPUTE_KIND,
830 Color color = LEGION_AUTO_GENERATE_ID,
831 const char* provenance = nullptr);
832 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
834 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
835 const FutureMap& domain_future_map,
836 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
837 bool perform_intersections = true,
838 PartitionKind part_kind = LEGION_COMPUTE_KIND,
839 Color color = LEGION_AUTO_GENERATE_ID,
840 const char* provenance = nullptr);
843
860 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
862 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
863 const std::map<
864 Point<COLOR_DIM, COLOR_COORD_T>, std::vector<Rect<DIM, COORD_T> > >&
865 rectangles,
866 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
867 bool perform_intersections = true,
868 PartitionKind part_kind = LEGION_COMPUTE_KIND,
869 Color color = LEGION_AUTO_GENERATE_ID, const char* provenance = nullptr,
870 bool collective = false);
873
902 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
903 IndexSpace color_space, Color color = LEGION_AUTO_GENERATE_ID,
904 MapperID id = 0, MappingTagID tag = 0,
905 PartitionKind part_kind = LEGION_DISJOINT_KIND,
906 UntypedBuffer map_arg = UntypedBuffer(),
907 const char* provenance = nullptr);
908 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
910 Context ctx, LogicalRegionT<DIM, COORD_T> handle,
911 LogicalRegionT<DIM, COORD_T> parent,
912 FieldID fid, // type: Point<COLOR_DIM,COLOR_COORD_T>
913 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
914 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
915 MappingTagID tag = 0, PartitionKind part_kind = LEGION_DISJOINT_KIND,
916 UntypedBuffer map_arg = UntypedBuffer(),
917 const char* provenance = nullptr);
920
954 Context ctx, IndexSpace handle, LogicalPartition projection,
955 LogicalRegion parent, FieldID fid, IndexSpace color_space,
956 PartitionKind part_kind = LEGION_COMPUTE_KIND,
957 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
958 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
959 const char* provenance = nullptr);
960 template<
961 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
962 typename COLOR_COORD_T>
964 Context ctx, IndexSpaceT<DIM2, COORD_T2> handle,
965 LogicalPartitionT<DIM1, COORD_T1> projection,
966 LogicalRegionT<DIM1, COORD_T1> parent,
967 FieldID fid, // type: Point<DIM2,COORD_T2>
968 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
969 PartitionKind part_kind = LEGION_COMPUTE_KIND,
970 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
971 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
972 const char* provenance = nullptr);
973 // Range versions of image
974 IndexPartition create_partition_by_image_range(
975 Context ctx, IndexSpace handle, LogicalPartition projection,
976 LogicalRegion parent, FieldID fid, IndexSpace color_space,
977 PartitionKind part_kind = LEGION_COMPUTE_KIND,
978 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
979 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
980 const char* provenance = nullptr);
981 template<
982 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
983 typename COLOR_COORD_T>
984 IndexPartitionT<DIM2, COORD_T2> create_partition_by_image_range(
985 Context ctx, IndexSpaceT<DIM2, COORD_T2> handle,
986 LogicalPartitionT<DIM1, COORD_T1> projection,
987 LogicalRegionT<DIM1, COORD_T1> parent,
988 FieldID fid, // type: Rect<DIM2,COORD_T2>
989 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
990 PartitionKind part_kind = LEGION_COMPUTE_KIND,
991 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
992 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
993 const char* provenance = nullptr);
996
1027 Context ctx, IndexPartition projection, LogicalRegion handle,
1028 LogicalRegion parent, FieldID fid, IndexSpace color_space,
1029 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1030 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1031 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1032 const char* provenance = nullptr);
1033 template<
1034 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
1035 typename COLOR_COORD_T>
1037 Context ctx, IndexPartitionT<DIM2, COORD_T2> projection,
1038 LogicalRegionT<DIM1, COORD_T1> handle,
1039 LogicalRegionT<DIM1, COORD_T1> parent,
1040 FieldID fid, // type: Point<DIM2,COORD_T2>
1041 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
1042 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1043 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1044 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1045 const char* provenance = nullptr);
1046 // Range versions of preimage
1047 IndexPartition create_partition_by_preimage_range(
1048 Context ctx, IndexPartition projection, LogicalRegion handle,
1049 LogicalRegion parent, FieldID fid, IndexSpace color_space,
1050 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1051 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1052 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1053 const char* provenance = nullptr);
1054 template<
1055 int DIM1, typename COORD_T1, int DIM2, typename COORD_T2, int COLOR_DIM,
1056 typename COLOR_COORD_T>
1057 IndexPartitionT<DIM1, COORD_T1> create_partition_by_preimage_range(
1058 Context ctx, IndexPartitionT<DIM2, COORD_T2> projection,
1059 LogicalRegionT<DIM1, COORD_T1> handle,
1060 LogicalRegionT<DIM1, COORD_T1> parent,
1061 FieldID fid, // type: Rect<DIM2,COORD_T2>
1062 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
1063 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1064 Color color = LEGION_AUTO_GENERATE_ID, MapperID id = 0,
1065 MappingTagID tag = 0, UntypedBuffer map_arg = UntypedBuffer(),
1066 const char* provenance = nullptr);
1068 public:
1069 //------------------------------------------------------------------------
1070 // Computed Index Spaces and Partitions
1071 //------------------------------------------------------------------------
1073
1100 Context ctx, IndexSpace parent, IndexSpace color_space,
1101 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1102 Color color = LEGION_AUTO_GENERATE_ID,
1103 const char* provenance = nullptr);
1104 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1106 Context ctx, IndexSpaceT<DIM, COORD_T> parent,
1107 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> color_space,
1108 PartitionKind part_kind = LEGION_COMPUTE_KIND,
1109 Color color = LEGION_AUTO_GENERATE_ID,
1110 const char* provenance = nullptr);
1113
1130 Context ctx, IndexPartition parent, const DomainPoint& color,
1131 const std::vector<IndexSpace>& handles,
1132 const char* provenance = nullptr);
1133 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1135 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1136 Point<COLOR_DIM, COLOR_COORD_T> color,
1137 const typename std::vector<IndexSpaceT<DIM, COORD_T> >& handles,
1138 const char* provenance = nullptr);
1141
1155 Context ctx, IndexPartition parent, const DomainPoint& color,
1156 IndexPartition handle, const char* provenance = nullptr);
1157 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1159 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1160 Point<COLOR_DIM, COLOR_COORD_T> color,
1161 IndexPartitionT<DIM, COORD_T> handle, const char* provenance = nullptr);
1164
1181 Context ctx, IndexPartition parent, const DomainPoint& color,
1182 const std::vector<IndexSpace>& handles,
1183 const char* provenance = nullptr);
1184 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1186 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1187 Point<COLOR_DIM, COLOR_COORD_T> color,
1188 const typename std::vector<IndexSpaceT<DIM, COORD_T> >& handles,
1189 const char* provenance = nullptr);
1192
1206 Context ctx, IndexPartition parent, const DomainPoint& color,
1207 IndexPartition handle, const char* provenannce = nullptr);
1208 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1210 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1211 Point<COLOR_DIM, COLOR_COORD_T> color,
1212 IndexPartitionT<DIM, COORD_T> handle, const char* provenance = nullptr);
1215
1237 Context ctx, IndexPartition parent, const DomainPoint& color,
1238 IndexSpace initial, const std::vector<IndexSpace>& handles,
1239 const char* provenancne = nullptr);
1240 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1242 Context ctx, IndexPartitionT<DIM, COORD_T> parent,
1243 Point<COLOR_DIM, COLOR_COORD_T> color,
1244 IndexSpaceT<DIM, COORD_T> initial,
1245 const typename std::vector<IndexSpaceT<DIM, COORD_T> >& handles,
1246 const char* provenance = nullptr);
1248 public:
1249 //------------------------------------------------------------------------
1250 // Index Tree Traversal Operations
1251 //------------------------------------------------------------------------
1253
1262 Context ctx, IndexSpace parent, Color color);
1264 Context ctx, IndexSpace parent, const DomainPoint& color);
1265 // Context free versions
1266 IndexPartition get_index_partition(IndexSpace parent, Color color);
1268 IndexSpace parent, const DomainPoint& color);
1269 // Template version
1270 template<int DIM, typename COORD_T>
1272 IndexSpaceT<DIM, COORD_T> parent, Color color);
1273
1275
1277
1285 bool has_index_partition(Context ctx, IndexSpace parent, Color color);
1287 Context ctx, IndexSpace parent, const DomainPoint& color);
1288 // Context free
1289 bool has_index_partition(IndexSpace parent, Color color);
1290 bool has_index_partition(IndexSpace parent, const DomainPoint& color);
1291 // Template version
1292 template<int DIM, typename COORD_T>
1293 bool has_index_partition(IndexSpaceT<DIM, COORD_T> parent, Color color);
1295
1297
1305 IndexSpace get_index_subspace(Context ctx, IndexPartition p, Color color);
1307 Context ctx, IndexPartition p, const DomainPoint& color);
1308 // Context free versions
1311 // Template version
1312 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1313 IndexSpaceT<DIM, COORD_T> get_index_subspace(
1314 IndexPartitionT<DIM, COORD_T> p, Point<COLOR_DIM, COLOR_COORD_T> color);
1316
1318
1327 Context ctx, IndexPartition p, const DomainPoint& color);
1328 // Context free
1329 bool has_index_subspace(IndexPartition p, const DomainPoint& color);
1330 // Template version
1331 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1332 bool has_index_subspace(
1333 IndexPartitionT<DIM, COORD_T> p, Point<COLOR_DIM, COLOR_COORD_T> color);
1335
1337
1347 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1348 bool has_multiple_domains(Context ctx, IndexSpace handle);
1349 // Context free
1350 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1351 bool has_multiple_domains(IndexSpace handle);
1353
1355
1363 // Context free
1365 // Template version
1366 template<int DIM, typename COORD_T>
1367 DomainT<DIM, COORD_T> get_index_space_domain(
1368 IndexSpaceT<DIM, COORD_T> handle);
1370
1372
1382 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1384 Context ctx, IndexSpace handle, std::vector<Domain>& domains);
1385 // Context free
1386 LEGION_DEPRECATED("Multiple domains are no longer supported.")
1388 IndexSpace handle, std::vector<Domain>& domains);
1390
1392
1400 // Context free
1402 // Template version
1403 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1404 DomainT<COLOR_DIM, COLOR_COORD_T> get_index_partition_color_space(
1405 IndexPartitionT<DIM, COORD_T> p);
1407
1409
1416 Context ctx, IndexPartition p);
1417 // Context free
1419 // Template version
1420 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1421 IndexSpaceT<COLOR_DIM, COLOR_COORD_T> get_index_partition_color_space_name(
1422 IndexPartitionT<DIM, COORD_T> p);
1424
1426
1436 Context ctx, IndexSpace sp, std::set<Color>& colors);
1438 Context ctx, IndexSpace sp, std::set<DomainPoint>& colors);
1439 // Context free versions
1441 IndexSpace sp, std::set<Color>& colors);
1443 IndexSpace sp, std::set<DomainPoint>& colors);
1445
1447
1454 // Context free
1457
1459
1466 // Context free
1469
1471
1479 Color get_index_space_color(Context ctx, IndexSpace handle);
1480 DomainPoint get_index_space_color_point(Context ctx, IndexSpace handle);
1481 // Context free
1482 Color get_index_space_color(IndexSpace handle);
1483 DomainPoint get_index_space_color_point(IndexSpace handle);
1484 // Template version
1485 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1486 Point<COLOR_DIM, COLOR_COORD_T> get_index_space_color(
1487 IndexSpaceT<DIM, COORD_T> handle);
1489
1491
1498 Color get_index_partition_color(Context ctx, IndexPartition handle);
1499 DomainPoint get_index_partition_color_point(
1500 Context ctx, IndexPartition handle);
1501 // Context free
1503 DomainPoint get_index_partition_color_point(IndexPartition handle);
1505
1507
1514 // Context free
1516 // Template version
1517 template<int DIM, typename COORD_T>
1518 IndexSpaceT<DIM, COORD_T> get_parent_index_space(
1519 IndexPartitionT<DIM, COORD_T> handle);
1521
1523
1529 bool has_parent_index_partition(Context ctx, IndexSpace handle);
1530 // Context free
1533
1535
1543 // Context free
1545 // Template version
1546 template<int DIM, typename COORD_T>
1548 IndexSpaceT<DIM, COORD_T> handle);
1550
1552
1558 unsigned get_index_space_depth(Context ctx, IndexSpace handle);
1559 // Context free
1560 unsigned get_index_space_depth(IndexSpace handle);
1562
1564
1570 unsigned get_index_partition_depth(Context ctx, IndexPartition handle);
1571 // Context free
1574 public:
1575 //------------------------------------------------------------------------
1576 // Safe Cast Operations
1577 //------------------------------------------------------------------------
1587 DomainPoint safe_cast(Context ctx, DomainPoint point, LogicalRegion region);
1588
1597 template<int DIM, typename COORD_T>
1599 Context ctx, Point<DIM, COORD_T> point,
1600 LogicalRegionT<DIM, COORD_T> region);
1601 public:
1602 //------------------------------------------------------------------------
1603 // Field Space Operations
1604 //------------------------------------------------------------------------
1613 Context ctx, const char* provenance = nullptr);
1626 Context ctx, const std::vector<size_t>& field_sizes,
1627 std::vector<FieldID>& resulting_fields, CustomSerdezID serdez_id = 0,
1628 const char* provenance = nullptr);
1641 Context ctx, const std::vector<Future>& field_sizes,
1642 std::vector<FieldID>& resulting_fields, CustomSerdezID serdez_id = 0,
1643 const char* provenance = nullptr);
1654 void create_shared_ownership(Context ctx, FieldSpace handle);
1665 Context ctx, FieldSpace handle, const bool unordered = false,
1666 const char* provenance = nullptr);
1667
1669
1676 size_t get_field_size(Context ctx, FieldSpace handle, FieldID fid);
1677 // Context free
1678 size_t get_field_size(FieldSpace handle, FieldID fid);
1680
1682
1689 Context ctx, FieldSpace handle, std::vector<FieldID>& fields);
1690 // Context free
1692 FieldSpace handle, std::vector<FieldID>& fields);
1694
1696
1703 Context ctx, FieldSpace handle, std::set<FieldID>& fields);
1704 // Context free
1705 void get_field_space_fields(FieldSpace handle, std::set<FieldID>& fields);
1707 public:
1708 //------------------------------------------------------------------------
1709 // Logical Region Operations
1710 //------------------------------------------------------------------------
1725 Context ctx, IndexSpace index, FieldSpace fields,
1726 bool task_local = false, const char* provenance = nullptr);
1727 // Template version
1728 template<int DIM, typename COORD_T>
1730 Context ctx, IndexSpaceT<DIM, COORD_T> index, FieldSpace fields,
1731 bool task_local = false, const char* provenance = nullptr);
1742 void create_shared_ownership(Context ctx, LogicalRegion handle);
1753 Context ctx, LogicalRegion handle, const bool unordered = false,
1754 const char* provenance = nullptr);
1755
1763 LEGION_DEPRECATED(
1764 "Destruction of logical partitions are no-ops now."
1765 "Logical partitions are automatically destroyed when their root "
1766 "logical region or their index spartition are destroyed.")
1768 Context ctx, LogicalPartition handle, const bool unordered = false);
1769
1789 Context ctx, LogicalRegion parent, LogicalRegion region,
1790 const std::set<FieldID>& fields);
1791 public:
1792 //------------------------------------------------------------------------
1793 // Logical Region Tree Traversal Operations
1794 //------------------------------------------------------------------------
1796
1806 Context ctx, LogicalRegion parent, IndexPartition handle);
1807 // Context free
1809 LogicalRegion parent, IndexPartition handle);
1810 // Template version
1811 template<int DIM, typename COORD_T>
1813 LogicalRegionT<DIM, COORD_T> parent,
1814 IndexPartitionT<DIM, COORD_T> handle);
1816
1818
1827 Context ctx, LogicalRegion parent, Color c);
1829 Context ctx, LogicalRegion parent, const DomainPoint& c);
1830 // Context free
1832 LogicalRegion parent, Color c);
1834 LogicalRegion parent, const DomainPoint& c);
1835 // Template version
1836 template<int DIM, typename COORD_T>
1838 LogicalRegionT<DIM, COORD_T> parent, Color c);
1840
1842
1851 Context ctx, LogicalRegion parent, const DomainPoint& c);
1852 // Context free
1854 LogicalRegion parent, const DomainPoint& c);
1856
1858
1868 Context ctx, IndexPartition handle, FieldSpace fspace,
1869 RegionTreeID tid);
1870 // Context free
1872 IndexPartition handle, FieldSpace fspace, RegionTreeID tid);
1873 // Template version
1874 template<int DIM, typename COORD_T>
1876 IndexPartitionT<DIM, COORD_T> handle, FieldSpace fspace,
1877 RegionTreeID tid);
1879
1881
1891 Context ctx, LogicalPartition parent, IndexSpace handle);
1892 // Context free
1894 LogicalPartition parent, IndexSpace handle);
1895 // Template version
1896 template<int DIM, typename COORD_T>
1898 LogicalPartitionT<DIM, COORD_T> parent,
1899 IndexSpaceT<DIM, COORD_T> handle);
1901
1903
1912 Context ctx, LogicalPartition parent, Color c);
1914 Context ctx, LogicalPartition parent, const DomainPoint& c);
1915 // Context free
1917 LogicalPartition parent, Color c);
1919 LogicalPartition parent, const DomainPoint& c);
1920 // Template version
1921 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1923 LogicalPartitionT<DIM, COORD_T> parent,
1924 Point<COLOR_DIM, COLOR_COORD_T> color);
1926
1928
1937 Context ctx, LogicalPartition parent, const DomainPoint& c);
1938 // Context free
1940 LogicalPartition parent, const DomainPoint& c);
1941 // Template version
1942 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1944 LogicalPartitionT<DIM, COORD_T> parent,
1945 Point<COLOR_DIM, COLOR_COORD_T> color);
1947
1949
1959 Context ctx, IndexSpace handle, FieldSpace fspace, RegionTreeID tid);
1960 // Context free
1962 IndexSpace handle, FieldSpace fspace, RegionTreeID tid);
1963 // Template version
1964 template<int DIM, typename COORD_T>
1966 IndexSpaceT<DIM, COORD_T> handle, FieldSpace space, RegionTreeID tid);
1968
1970
1978 Color get_logical_region_color(Context ctx, LogicalRegion handle);
1979 DomainPoint get_logical_region_color_point(
1980 Context ctx, LogicalRegion handle);
1981 // Context free versions
1983 DomainPoint get_logical_region_color_point(LogicalRegion handle);
1984 // Template version
1985 template<int DIM, typename COORD_T, int COLOR_DIM, typename COLOR_COORD_T>
1986 Point<COLOR_DIM, COLOR_COORD_T> get_logical_region_color_point(
1987 LogicalRegionT<DIM, COORD_T> handle);
1989
1991
1999 DomainPoint get_logical_partition_color_point(
2000 Context ctx, LogicalPartition handle);
2001 // Context free versions
2003 DomainPoint get_logical_partition_color_point(LogicalPartition handle);
2005
2007
2014 Context ctx, LogicalPartition handle);
2015 // Context free
2017 // Template version
2018 template<int DIM, typename COORD_T>
2020 LogicalPartitionT<DIM, COORD_T> handle);
2022
2024
2031 // Context free
2034
2036
2043 Context ctx, LogicalRegion handle);
2044 // Context free
2046 // Template version
2047 template<int DIM, typename COORD_T>
2049 LogicalRegionT<DIM, COORD_T> handle);
2051 public:
2052 //------------------------------------------------------------------------
2053 // Allocator and Argument Map Operations
2054 //------------------------------------------------------------------------
2062
2071 LEGION_DEPRECATED("ArgumentMap can be constructed directly.")
2073 public:
2074 //------------------------------------------------------------------------
2075 // Task Launch Operations
2076 //------------------------------------------------------------------------
2087 Context ctx, const TaskLauncher& launcher,
2088 std::vector<OutputRequirement>* outputs = nullptr);
2089
2101 Context ctx, const IndexTaskLauncher& launcher,
2102 std::vector<OutputRequirement>* outputs = nullptr);
2103
2127 Context ctx, const IndexTaskLauncher& launcher, ReductionOpID redop,
2128 bool ordered = true, std::vector<OutputRequirement>* outputs = nullptr);
2129
2154 Context ctx, const FutureMap& future_map, ReductionOpID redop,
2155 bool ordered = true, MapperID map_id = 0, MappingTagID tag = 0,
2156 const char* provenance = nullptr, Future initial_value = Future());
2157
2186 Context ctx, IndexSpace domain,
2187 const std::map<DomainPoint, UntypedBuffer>& data,
2188 bool collective = false, ShardingID sid = 0,
2189 bool implicit_sharding = false, const char* provenance = nullptr);
2190 LEGION_DEPRECATED("Use the version that takes an IndexSpace instead")
2192 Context ctx, const Domain& domain,
2193 const std::map<DomainPoint, UntypedBuffer>& data,
2194 bool collective = false, ShardingID sid = 0,
2195 bool implicit_sharding = false);
2196
2221 Context ctx, IndexSpace domain,
2222 const std::map<DomainPoint, Future>& futures, bool collective = false,
2223 ShardingID sid = 0, bool implicit_sharding = false,
2224 const char* provenance = nullptr);
2225 LEGION_DEPRECATED("Use the version that takes an IndexSpace instead")
2227 Context ctx, const Domain& domain,
2228 const std::map<DomainPoint, Future>& futures, bool collective = false,
2229 ShardingID sid = 0, bool implicit_sharding = false);
2230
2248 using PointTransformFunc = std::function<DomainPoint(
2249 const DomainPoint&, const Domain&, const Domain&)>;
2250 FutureMap transform_future_map(
2251 Context ctx, const FutureMap& fm, IndexSpace new_domain,
2252 PointTransformFunc func, const char* provenance = nullptr);
2270 FutureMap transform_future_map(
2271 Context ctx, const FutureMap& fm, IndexSpace new_domain,
2272 PointTransformFunctor* functor, bool take_ownership = false,
2273 const char* provenance = nullptr);
2274
2290 LEGION_DEPRECATED(
2291 "Launching tasks should be done with the new task "
2292 "launcher interface.")
2294 Context ctx, TaskID task_id,
2295 const std::vector<IndexSpaceRequirement>& indexes,
2296 const std::vector<FieldSpaceRequirement>& fields,
2297 const std::vector<RegionRequirement>& regions, const UntypedBuffer& arg,
2298 const Predicate& predicate = Predicate::TRUE_PRED, MapperID id = 0,
2299 MappingTagID tag = 0);
2300
2319 LEGION_DEPRECATED(
2320 "Launching tasks should be done with the new task "
2321 "launcher interface.")
2323 Context ctx, TaskID task_id, const Domain domain,
2324 const std::vector<IndexSpaceRequirement>& indexes,
2325 const std::vector<FieldSpaceRequirement>& fields,
2326 const std::vector<RegionRequirement>& regions,
2327 const UntypedBuffer& global_arg, const ArgumentMap& arg_map,
2328 const Predicate& predicate = Predicate::TRUE_PRED,
2329 bool must_paralleism = false, MapperID id = 0, MappingTagID tag = 0);
2330
2352 LEGION_DEPRECATED(
2353 "Launching tasks should be done with the new task "
2354 "launcher interface.")
2356 Context ctx, TaskID task_id, const Domain domain,
2357 const std::vector<IndexSpaceRequirement>& indexes,
2358 const std::vector<FieldSpaceRequirement>& fields,
2359 const std::vector<RegionRequirement>& regions,
2360 const UntypedBuffer& global_arg, const ArgumentMap& arg_map,
2361 ReductionOpID reduction, const UntypedBuffer& initial_value,
2362 const Predicate& predicate = Predicate::TRUE_PRED,
2363 bool must_parallelism = false, MapperID id = 0, MappingTagID tag = 0);
2364 public:
2365 //------------------------------------------------------------------------
2366 // Inline Mapping Operations
2367 //------------------------------------------------------------------------
2377 PhysicalRegion map_region(Context ctx, const InlineLauncher& launcher);
2378
2393 Context ctx, const RegionRequirement& req, MapperID id = 0,
2394 MappingTagID tag = 0, const char* provenance = nullptr);
2395
2408 Context ctx, unsigned idx, MapperID id = 0, MappingTagID tag = 0,
2409 const char* provenance = nullptr);
2410
2421 Context ctx, PhysicalRegion region, const char* provenance = nullptr);
2422
2430 void unmap_region(Context ctx, PhysicalRegion region);
2431
2439 void unmap_all_regions(Context ctx);
2440 public:
2441 //------------------------------------------------------------------------
2442 // Output Region Operations
2443 //------------------------------------------------------------------------
2449 OutputRegion get_output_region(Context ctx, unsigned index);
2450
2456 void get_output_regions(Context ctx, std::vector<OutputRegion>& regions);
2457 public:
2458 //------------------------------------------------------------------------
2459 // Fill Field Operations
2460 //------------------------------------------------------------------------
2475 template<typename T>
2477 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
2478 const T& value, Predicate pred = Predicate::TRUE_PRED);
2479
2494 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
2495 const void* value, size_t value_size,
2496 Predicate pred = Predicate::TRUE_PRED);
2497
2511 Context ctx, LogicalRegion handle, LogicalRegion parent, FieldID fid,
2512 Future f, Predicate pred = Predicate::TRUE_PRED);
2513
2524 template<typename T>
2526 Context ctx, LogicalRegion handle, LogicalRegion parent,
2527 const std::set<FieldID>& fields, const T& value,
2528 Predicate pred = Predicate::TRUE_PRED);
2529
2543 Context ctx, LogicalRegion handle, LogicalRegion parent,
2544 const std::set<FieldID>& fields, const void* value, size_t value_size,
2545 Predicate pred = Predicate::TRUE_PRED);
2546
2558 Context ctx, LogicalRegion handle, LogicalRegion parent,
2559 const std::set<FieldID>& fields, Future f,
2560 Predicate pred = Predicate::TRUE_PRED);
2561
2568 void fill_fields(Context ctx, const FillLauncher& launcher);
2569
2576 void fill_fields(Context ctx, const IndexFillLauncher& launcher);
2577
2583 void discard_fields(Context ctx, const DiscardLauncher& launcher);
2584 public:
2585 //------------------------------------------------------------------------
2586 // Attach Operations
2587 //------------------------------------------------------------------------
2588
2596 Context ctx, const AttachLauncher& launcher);
2597
2610 Context ctx, PhysicalRegion region, const bool flush = true,
2611 const bool unordered = false, const char* provenance = nullptr);
2612
2631 Context ctx, const IndexAttachLauncher& launcher);
2632
2646 Context ctx, ExternalResources external, const bool flush = true,
2647 const bool unordered = false, const char* provenance = nullptr);
2648
2656
2687 LEGION_DEPRECATED(
2688 "Attaching specific HDF5 file type is deprecated "
2689 "in favor of generic attach launcher interface.")
2691 Context ctx, const char* file_name, LogicalRegion handle,
2692 LogicalRegion parent, const std::map<FieldID, const char*>& field_map,
2693 LegionFileMode mode);
2694
2711 LEGION_DEPRECATED(
2712 "Detaching specific HDF5 file type is deprecated "
2713 "in favor of generic detach interface.")
2714 void detach_hdf5(Context ctx, PhysicalRegion region);
2715
2722 LEGION_DEPRECATED(
2723 "Attaching generic file type is deprecated "
2724 "in favor of generic attach launcher interface.")
2726 Context ctx, const char* file_name, LogicalRegion handle,
2727 LogicalRegion parent, const std::vector<FieldID>& field_vec,
2728 LegionFileMode mode);
2729
2735 LEGION_DEPRECATED(
2736 "Detaching generic file type is deprecated "
2737 "in favor of generic detach interface.")
2738 void detach_file(Context ctx, PhysicalRegion region);
2739 public:
2740 //------------------------------------------------------------------------
2741 // Copy Operations
2742 //------------------------------------------------------------------------
2750 void issue_copy_operation(Context ctx, const CopyLauncher& launcher);
2751
2759 void issue_copy_operation(Context ctx, const IndexCopyLauncher& launcher);
2760 public:
2761 //------------------------------------------------------------------------
2762 // Predicate Operations
2763 //------------------------------------------------------------------------
2774 Context ctx, const Future& f, const char* provenance = nullptr);
2775
2786 Context ctx, const Predicate& p, const char* provenance = nullptr);
2787
2799 Context ctx, const Predicate& p1, const Predicate& p2,
2800 const char* provenance = nullptr);
2801
2813 Context ctx, const Predicate& p1, const Predicate& p2,
2814 const char* provenance = nullptr);
2815
2822 Predicate create_predicate(Context ctx, const PredicateLauncher& launcher);
2823
2833 Context ctx, const Predicate& p, const char* provenance = nullptr);
2834 public:
2835 //------------------------------------------------------------------------
2836 // Lock Operations
2837 //------------------------------------------------------------------------
2843 Lock create_lock(Context ctx);
2844
2855 void destroy_lock(Context ctx, Lock l);
2856
2869 Grant acquire_grant(Context ctx, const std::vector<LockRequest>& requests);
2870
2880 void release_grant(Context ctx, Grant grant);
2881 public:
2882 //------------------------------------------------------------------------
2883 // Phase Barrier operations
2884 //------------------------------------------------------------------------
2894 PhaseBarrier create_phase_barrier(Context ctx, unsigned arrivals);
2895
2907
2924 public:
2925 //------------------------------------------------------------------------
2926 // Dynamic Collective operations
2927 //------------------------------------------------------------------------
2943 Context ctx, unsigned arrivals, ReductionOpID redop,
2944 const void* init_value, size_t init_size);
2945
2953
2964 Context ctx, DynamicCollective dc, const void* buffer, size_t size,
2965 unsigned count = 1);
2966
2977 Context ctx, DynamicCollective dc, const Future& f, unsigned count = 1);
2978
2990 Context ctx, DynamicCollective dc, const char* provenance = nullptr);
2991
3001 Context ctx, DynamicCollective dc);
3002 public:
3003 //------------------------------------------------------------------------
3004 // User-Managed Software Coherence
3005 //------------------------------------------------------------------------
3012 void issue_acquire(Context ctx, const AcquireLauncher& launcher);
3013
3020 void issue_release(Context ctx, const ReleaseLauncher& launcher);
3021 public:
3022 //------------------------------------------------------------------------
3023 // Fence Operations
3024 //------------------------------------------------------------------------
3033 Future issue_mapping_fence(Context ctx, const char* provenance = nullptr);
3034
3044 Future issue_execution_fence(Context ctx, const char* provenance = nullptr);
3045 public:
3046 //------------------------------------------------------------------------
3047 // Tracing Operations
3048 //------------------------------------------------------------------------
3079 Context ctx, TraceID tid, bool logical_only = false,
3080 bool static_trace = false,
3081 const std::set<RegionTreeID>* managed = nullptr,
3082 const char* provenance = nullptr);
3086 void end_trace(Context ctx, TraceID tid, const char* provenance = nullptr);
3101 LEGION_DEPRECATED("Use begin_trace with static_trace=true")
3103 Context ctx, const std::set<RegionTreeID>* managed = nullptr);
3108 LEGION_DEPRECATED("Use end_trace")
3109 void end_static_trace(Context ctx);
3110
3116
3127 TraceID generate_library_trace_ids(const char* name, size_t count);
3128
3136 static TraceID generate_static_trace_id(void);
3137 public:
3138 //------------------------------------------------------------------------
3139 // Frame Operations
3140 //------------------------------------------------------------------------
3154 void complete_frame(Context ctx, const char* provenance = nullptr);
3155 public:
3156 //------------------------------------------------------------------------
3157 // Must Parallelism
3158 //------------------------------------------------------------------------
3167 Context ctx, const MustEpochLauncher& launcher);
3168 public:
3169 //------------------------------------------------------------------------
3170 // Tunable Variables
3171 //------------------------------------------------------------------------
3172
3187 Context ctx, TunableID tid, MapperID mapper = 0, MappingTagID tag = 0,
3188 const void* args = nullptr, size_t argsize = 0);
3189 Future select_tunable_value(Context ctx, const TunableLauncher& launcher);
3190
3197 LEGION_DEPRECATED(
3198 "Tunable values should now be obtained via the "
3199 "generic interface that returns a future result.")
3201 Context ctx, TunableID tid, MapperID mapper = 0, MappingTagID tag = 0);
3202 public:
3203 //------------------------------------------------------------------------
3204 // Task Local Interface
3205 //------------------------------------------------------------------------
3211 const Task* get_local_task(Context ctx);
3212
3220 void* get_local_task_variable_untyped(Context ctx, LocalVariableID id);
3221 template<typename T>
3222 T* get_local_task_variable(Context ctx, LocalVariableID id);
3223
3235 Context ctx, LocalVariableID id, const void* value,
3236 void (*destructor)(void*) = nullptr);
3237 template<typename T>
3238 void set_local_task_variable(
3239 Context ctx, LocalVariableID id, const T* value,
3240 void (*destructor)(void*) = nullptr);
3241 public:
3242 //------------------------------------------------------------------------
3243 // Deferred Buffer/Value Creation/Destruction
3244 //------------------------------------------------------------------------
3256 Context ctx, const DeferredValueRequest& request);
3257
3268 Context ctx, UntypedDeferredValue& value,
3269 Realm::Event precondition = Realm::Event::NO_EVENT);
3270
3281 template<typename COORD_T = coord_t>
3283 Context ctx, const DeferredBufferRequest& request);
3284
3294 template<typename COORD_T = coord_t>
3296 Context ctx, UntypedDeferredBuffer<COORD_T>& buffer,
3297 Realm::Event precondition = Realm::Event::NO_EVENT);
3298 public:
3299 //------------------------------------------------------------------------
3300 // Timing Operations
3301 //------------------------------------------------------------------------
3310 Future get_current_time(Context ctx, Future precondition = Future());
3311
3321 Context ctx, Future precondition = Future());
3322
3332 Context ctx, Future precondition = Future());
3333
3341 Context ctx, const TimingLauncher& launcher);
3342
3349 static long long get_zero_time(void);
3350 public:
3351 //------------------------------------------------------------------------
3352 // Exception Handling
3353 //------------------------------------------------------------------------
3354
3358 void push_exception_handler(Context ctx, ExceptionHandlerID handler);
3359
3365 Future pop_exception_handler(Context ctx, const char* provenance = nullptr);
3366 public:
3367 //------------------------------------------------------------------------
3368 // Miscellaneous Operations
3369 //------------------------------------------------------------------------
3384 Mapping::Mapper* get_mapper(
3385 Context ctx, MapperID id, Processor target = Processor::NO_PROC);
3386
3400 Mapping::MapperContext begin_mapper_call(
3401 Context ctx, MapperID id, Processor target = Processor::NO_PROC);
3402
3408 void end_mapper_call(Mapping::MapperContext ctx);
3409
3416 Processor get_executing_processor(Context ctx);
3417
3424 const Task* get_current_task(Context ctx);
3425
3442 Context ctx, Memory target, bool escaping = true);
3443
3455 void release_memory_pool(Context ctx, Memory target);
3456
3474 Context ctx, PhysicalRegion region, bool nuclear);
3475
3486 void yield(Context ctx);
3487
3506 Context ctx, Realm::Event effect, const char* provenance = nullptr);
3507
3545 void concurrent_task_barrier(Context ctx);
3546
3558 void start_profiling_range(Context ctx);
3559 void stop_profiling_range(Context ctx, const char* provenance);
3560 public:
3561 //------------------------------------------------------------------------
3562 // MPI Interoperability
3563 //------------------------------------------------------------------------
3568
3576 const std::map<int /*rank*/, AddressSpace>& find_forward_MPI_mapping(void);
3577
3585 const std::map<AddressSpace, int /*rank*/>& find_reverse_MPI_mapping(void);
3586
3591 public:
3592 //------------------------------------------------------------------------
3593 // Semantic Information
3594 //------------------------------------------------------------------------
3605 TaskID task_id, SemanticTag tag, const void* buffer, size_t size,
3606 bool is_mutable = false, bool local_only = false);
3607
3617 IndexSpace handle, SemanticTag tag, const void* buffer, size_t size,
3618 bool is_mutable = false);
3619
3629 IndexPartition handle, SemanticTag tag, const void* buffer, size_t size,
3630 bool is_mutable = false);
3631
3641 FieldSpace handle, SemanticTag tag, const void* buffer, size_t size,
3642 bool is_mutable = false);
3643
3654 FieldSpace handle, FieldID fid, SemanticTag tag, const void* buffer,
3655 size_t size, bool is_mutable = false);
3656
3666 LogicalRegion handle, SemanticTag tag, const void* buffer, size_t size,
3667 bool is_mutable = false);
3668
3678 LogicalPartition handle, SemanticTag tag, const void* buffer,
3679 size_t size, bool is_mutable = false);
3680
3689 TaskID task_id, const char* name, bool is_mutable = false,
3690 bool local_only = false);
3691
3699 IndexSpace handle, const char* name, bool is_mutable = false);
3700
3708 IndexPartition handle, const char* name, bool is_mutable = false);
3709
3717 FieldSpace handle, const char* name, bool is_mutable = false);
3718
3727 FieldSpace handle, FieldID fid, const char* name,
3728 bool is_mutable = false);
3729
3737 LogicalRegion handle, const char* name, bool is_mutable = false);
3738
3746 LogicalPartition handle, const char* name, bool is_mutable = false);
3747
3759 TaskID task_id, SemanticTag tag, const void*& result, size_t& size,
3760 bool can_fail = false, bool wait_until_ready = false);
3761
3773 IndexSpace handle, SemanticTag tag, const void*& result, size_t& size,
3774 bool can_fail = false, bool wait_until_ready = false);
3775
3787 IndexPartition handle, SemanticTag tag, const void*& result,
3788 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3789
3801 FieldSpace handle, SemanticTag tag, const void*& result, size_t& size,
3802 bool can_fail = false, bool wait_until_ready = false);
3803
3816 FieldSpace handle, FieldID fid, SemanticTag tag, const void*& result,
3817 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3818
3830 LogicalRegion handle, SemanticTag tag, const void*& result,
3831 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3832
3844 LogicalPartition handle, SemanticTag tag, const void*& result,
3845 size_t& size, bool can_fail = false, bool wait_until_ready = false);
3846
3852 void retrieve_name(TaskID task_id, const char*& result);
3853
3859 void retrieve_name(IndexSpace handle, const char*& result);
3860
3866 void retrieve_name(IndexPartition handle, const char*& result);
3867
3873 void retrieve_name(FieldSpace handle, const char*& result);
3874
3881 void retrieve_name(FieldSpace handle, FieldID fid, const char*& result);
3882
3888 void retrieve_name(LogicalRegion handle, const char*& result);
3889
3895 void retrieve_name(LogicalPartition handle, const char*& result);
3896 public:
3897 //------------------------------------------------------------------------
3898 // Printing operations, these are useful for only generating output
3899 // from a single task if the task has been replicated (either directly
3900 // or as part of control replication).
3901 //------------------------------------------------------------------------
3909 void print_once(Context ctx, FILE* f, const char* message);
3910
3917 void log_once(Context ctx, Realm::LoggerMessage& message);
3918 public:
3919 //------------------------------------------------------------------------
3920 // Registration Callback Operations
3921 // All of these calls must be made while in the registration
3922 // function called before start-up. This function is specified
3923 // by calling the 'set_registration_callback' static method.
3924 //------------------------------------------------------------------------
3925
3930 Mapping::MapperRuntime* get_mapper_runtime(void);
3931
3937
3948 MapperID generate_library_mapper_ids(const char* name, size_t count);
3949
3957 static MapperID generate_static_mapper_id(void);
3958
3971 MapperID map_id, Mapping::Mapper* mapper,
3972 Processor proc = Processor::NO_PROC);
3973
3986 Mapping::Mapper* mapper, Processor proc = Processor::NO_PROC);
3987 public:
3993
4005 const char* name, size_t count);
4006
4014 static ProjectionID generate_static_projection_id(void);
4015
4030 ProjectionID pid, ProjectionFunctor* functor,
4031 bool silence_warnings = false, const char* warning_string = nullptr);
4032
4043 ProjectionID pid, ProjectionFunctor* functor);
4044
4052 public:
4058
4069 ShardingID generate_library_sharding_ids(const char* name, size_t count);
4070
4078 static ShardingID generate_static_sharding_id(void);
4079
4093 ShardingID sid, ShardingFunctor* functor, bool silence_warnings = false,
4094 const char* warning_string = nullptr);
4095
4107 ShardingID sid, ShardingFunctor* functor);
4108
4115 static ShardingFunctor* get_sharding_functor(ShardingID sid);
4116 public:
4122
4134 const char* name, size_t count);
4135
4143 static ConcurrentID generate_static_concurrent_id(void);
4144
4159 ConcurrentID cid, ConcurrentColoringFunctor* functor,
4160 bool silence_warnings = false, const char* warning_string = nullptr);
4161
4172 ConcurrentID cid, ConcurrentColoringFunctor* functor);
4173
4181 ConcurrentID cid);
4182 public:
4189
4201 const char* name, size_t count);
4202
4210 static ExceptionHandlerID generate_static_exception_handler_id(void);
4211
4218 ExceptionHandlerID hid, ExceptionHandler* handler);
4219
4228 ExceptionHandlerID cid, ExceptionHandler* handler);
4229
4236 static ExceptionHandler* get_exception_handler(ExceptionHandlerID hid);
4237 public:
4243
4255 const char* name, size_t count);
4256
4264 static ReductionOpID generate_static_reduction_id(void);
4265
4280 template<typename REDOP>
4282 ReductionOpID redop_id, bool permit_duplicates = false);
4283
4305 ReductionOpID redop_id, ReductionOp* op,
4306 SerdezInitFunc init_fnptr = nullptr,
4307 SerdezFoldFunc fold_fnptr = nullptr, bool permit_duplicates = false);
4308
4314 static const ReductionOp* get_reduction_op(ReductionOpID redop_id);
4315
4316#ifdef LEGION_GPU_REDUCTIONS
4317 template<typename REDOP>
4318 LEGION_DEPRECATED("Use register_reduction_op instead")
4319 static void preregister_gpu_reduction_op(ReductionOpID redop_id);
4320#endif
4321 public:
4326 CustomSerdezID generate_dynamic_serdez_id(void);
4327
4338 CustomSerdezID generate_library_serdez_ids(const char* name, size_t count);
4339
4347 static CustomSerdezID generate_static_serdez_id(void);
4348
4362 template<typename SERDEZ>
4364 CustomSerdezID serdez_id, bool permit_duplicates = false);
4365
4379 CustomSerdezID serdez_id, SerdezOp* serdez_op,
4380 bool permit_duplicates = false);
4381
4387 static const SerdezOp* get_serdez_op(CustomSerdezID serdez_id);
4388 public:
4389 //------------------------------------------------------------------------
4390 // Start-up Operations
4391 // Everything below here is a static function that is used to configure
4392 // the runtime prior to calling the start method to begin execution.
4393 //------------------------------------------------------------------------
4394 public:
4400 static const char* get_legion_version(void);
4401
4619 static int start(
4620 int argc, char** argv, bool background = false,
4621 bool supply_default_mapper = true, bool filter = false,
4622 bool realm_initialize_network = true,
4623 bool realm_configure_machine = true);
4624
4645 static void initialize(
4646 int* argc, char*** argv, bool filter = false, bool parse = true,
4647 bool realm_initialize_network = true,
4648 bool realm_create_configure_machine = true);
4649
4655 static int wait_for_shutdown(void);
4656
4664 static void set_return_code(int return_code);
4665
4673 static void set_top_level_task_id(TaskID top_id);
4674
4681 static void set_top_level_task_mapper_id(MapperID mapper_id);
4682
4690
4710 TaskID top_task_id, MapperID mapper_id,
4711 Processor::Kind proc_kind = Processor::NO_KIND,
4712 const char* task_name = nullptr, bool control_replicable = false,
4713 unsigned shard_per_address_space = 1, int shard_id = -1,
4714 DomainPoint shard_point = DomainPoint());
4715
4724
4732
4744 Context ctx, Realm::Event effects = Realm::Event::NO_EVENT);
4745
4751 static size_t get_maximum_dimension(void);
4752
4762 static void configure_MPI_interoperability(int rank);
4763
4778 bool init_in_ext = true, int ext_participants = 1,
4779 int legion_participants = 1);
4780
4793 bool init_in_MPI = true, int mpi_participants = 1,
4794 int legion_participants = 1);
4795
4806 template<
4807 LogicalRegion (*PROJ_PTR)(LogicalRegion, const DomainPoint&, Runtime*)>
4808 LEGION_DEPRECATED(
4809 "Projection functions should now be specified "
4810 "using projection functor objects")
4811 static ProjectionID register_region_function(ProjectionID handle);
4812
4822 template<LogicalRegion (*PROJ_PTR)(
4824 LEGION_DEPRECATED(
4825 "Projection functions should now be specified "
4826 "using projection functor objects")
4827 static ProjectionID register_partition_function(ProjectionID handle);
4828 public:
4846 RegistrationCallback callback, bool dedup = true, size_t dedup_tag = 0);
4847 static void add_registration_callback(
4848 RegistrationWithArgsCallback callback, const UntypedBuffer& buffer,
4849 bool dedup = true, size_t dedup_tag = 0);
4850
4876 RegistrationCallback callback, bool global, bool deduplicate = true,
4877 size_t dedup_tag = 0);
4879 RegistrationWithArgsCallback callback, const UntypedBuffer& buffer,
4880 bool global, bool deduplicate = true, size_t dedup_tag = 0);
4881
4893 LEGION_DEPRECATED(
4894 "Legion now supports multiple registration callbacks "
4895 "added via the add_registration_callback method.")
4896 static void set_registration_callback(RegistrationCallback callback);
4897
4903 static const InputArgs& get_input_args(void);
4904 public:
4908 static void enable_profiling(void);
4912 static void disable_profiling(void);
4916 static void dump_profiling(void);
4917 public:
4918 //------------------------------------------------------------------------
4919 // Layout Registration Operations
4920 //------------------------------------------------------------------------
4929 LayoutConstraintID register_layout(
4930 const LayoutConstraintRegistrar& registrar);
4931
4937 void release_layout(LayoutConstraintID layout_id);
4938
4950 static LayoutConstraintID preregister_layout(
4951 const LayoutConstraintRegistrar& registrar,
4952 LayoutConstraintID layout_id = LEGION_AUTO_GENERATE_ID);
4953
4959 FieldSpace get_layout_constraint_field_space(LayoutConstraintID layout_id);
4960
4967 LayoutConstraintID layout_id, LayoutConstraintSet& layout_constraints);
4968
4974 const char* get_layout_constraints_name(LayoutConstraintID layout_id);
4975 public:
4976 //------------------------------------------------------------------------
4977 // Task Registration Operations
4978 //------------------------------------------------------------------------
4979
4985
4996 TaskID generate_library_task_ids(const char* name, size_t count);
4997
5005 static TaskID generate_static_task_id(void);
5006
5014 template<
5015 typename T,
5016 T (*TASK_PTR)(
5017 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5019 const TaskVariantRegistrar& registrar,
5020 VariantID vid = LEGION_AUTO_GENERATE_ID);
5021
5030 template<
5031 typename T, typename UDT,
5032 T (*TASK_PTR)(
5033 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*,
5034 const UDT&)>
5036 const TaskVariantRegistrar& registrar, const UDT& user_data,
5037 VariantID vid = LEGION_AUTO_GENERATE_ID);
5038
5046 template<void (*TASK_PTR)(
5047 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5049 const TaskVariantRegistrar& registrar,
5050 VariantID vid = LEGION_AUTO_GENERATE_ID);
5051
5060 template<
5061 typename UDT, void (*TASK_PTR)(
5062 const Task*, const std::vector<PhysicalRegion>&,
5063 Context, Runtime*, const UDT&)>
5065 const TaskVariantRegistrar& registrar, const UDT& user_data,
5066 VariantID vid = LEGION_AUTO_GENERATE_ID);
5067
5088 const TaskVariantRegistrar& registrar, const CodeDescriptor& codedesc,
5089 const void* user_data = nullptr, size_t user_len = 0,
5090 size_t return_type_size = LEGION_MAX_RETURN_SIZE,
5091 VariantID vid = LEGION_AUTO_GENERATE_ID,
5092 bool has_return_type_size = true);
5093
5104 template<
5105 typename T,
5106 T (*TASK_PTR)(
5107 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5109 const TaskVariantRegistrar& registrar, const char* task_name = nullptr,
5110 VariantID vid = LEGION_AUTO_GENERATE_ID);
5111
5123 template<
5124 typename T, typename UDT,
5125 T (*TASK_PTR)(
5126 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*,
5127 const UDT&)>
5129 const TaskVariantRegistrar& registrar, const UDT& user_data,
5130 const char* task_name = nullptr,
5131 VariantID vid = LEGION_AUTO_GENERATE_ID);
5132
5143 template<void (*TASK_PTR)(
5144 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5146 const TaskVariantRegistrar& registrar, const char* task_name = nullptr,
5147 VariantID vid = LEGION_AUTO_GENERATE_ID);
5148
5160 template<
5161 typename UDT, void (*TASK_PTR)(
5162 const Task*, const std::vector<PhysicalRegion>&,
5163 Context, Runtime*, const UDT&)>
5165 const TaskVariantRegistrar& registrar, const UDT& user_data,
5166 const char* task_name = nullptr,
5167 VariantID vid = LEGION_AUTO_GENERATE_ID);
5168
5191 const TaskVariantRegistrar& registrar, const CodeDescriptor& codedesc,
5192 const void* user_data = nullptr, size_t user_len = 0,
5193 const char* task_name = nullptr,
5194 VariantID vid = LEGION_AUTO_GENERATE_ID,
5195 size_t return_type_size = LEGION_MAX_RETURN_SIZE,
5196 bool has_return_type_size = true, bool check_task_id = true);
5197
5212 const void* data, size_t datalen, Processor p, const Task*& task,
5213 const std::vector<PhysicalRegion>*& reg, Context& ctx,
5214 Runtime*& runtime);
5215
5234 Context ctx, const void* retvalptr = nullptr, size_t retvalsize = 0,
5235 bool owned = false,
5236 Realm::RegionInstance inst = Realm::RegionInstance::NO_INST,
5237 const void* metadataptr = nullptr, size_t metadatasize = 0);
5238
5258 Context ctx, const void* retvalptr, size_t retvalsize, bool owned,
5259 const Realm::ExternalInstanceResource& allocation,
5260 void (*freefunc)(const Realm::ExternalInstanceResource&) = nullptr,
5261 const void* metadataptr = nullptr, size_t metadatasize = 0);
5262
5273 Context ctx, FutureFunctor* callback_functor, bool owned = false);
5274
5290 Context ctx, const Domain& domain, bool take_ownership,
5291 const void* metadataptr = nullptr, size_t metadatasize = 0);
5292 public:
5293 // ------------------ Deprecated task registration -----------------------
5307 template<
5308 typename T,
5309 T (*TASK_PTR)(
5310 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5311 LEGION_DEPRECATED(
5312 "Task registration should be done with "
5315 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5316 VariantID vid = LEGION_AUTO_GENERATE_ID,
5318 const char* task_name = nullptr);
5332 template<void (*TASK_PTR)(
5333 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*)>
5334 LEGION_DEPRECATED(
5335 "Task registration should be done with "
5338 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5339 VariantID vid = LEGION_AUTO_GENERATE_ID,
5341 const char* task_name = nullptr);
5357 template<
5358 typename T, typename UDT,
5359 T (*TASK_PTR)(
5360 const Task*, const std::vector<PhysicalRegion>&, Context, Runtime*,
5361 const UDT&)>
5362 LEGION_DEPRECATED(
5363 "Task registration should be done with "
5366 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5367 const UDT& user_data, VariantID vid = LEGION_AUTO_GENERATE_ID,
5369 const char* task_name = nullptr);
5385 template<
5386 typename UDT, void (*TASK_PTR)(
5387 const Task*, const std::vector<PhysicalRegion>&,
5388 Context, Runtime*, const UDT&)>
5389 LEGION_DEPRECATED(
5390 "Task registration should be done with "
5393 TaskID id, Processor::Kind proc_kind, bool single, bool index,
5394 const UDT& user_data, VariantID vid = LEGION_AUTO_GENERATE_ID,
5396 const char* task_name = nullptr);
5397 public:
5404 static bool has_runtime(void);
5405
5413 static Runtime* get_runtime(Processor p = Processor::NO_PROC);
5414
5421 static bool has_context(void);
5422
5429 static Context get_context(void);
5430
5436 static const Task* get_context_task(Context ctx);
5437 private:
5438 IndexPartition create_restricted_partition(
5439 Context ctx, IndexSpace parent, IndexSpace color_space,
5440 const void* transform, size_t transform_size, const void* extent,
5441 size_t extent_size, PartitionKind part_kind, Color color,
5442 const char* provenance, const char* func_name, bool blockify);
5443 IndexSpace create_index_space_union_internal(
5444 Context ctx, IndexPartition parent, const void* realm_color,
5445 size_t color_size, TypeTag type_tag, const char* provenance,
5446 const char* func, const std::vector<IndexSpace>& handles);
5447 IndexSpace create_index_space_union_internal(
5448 Context ctx, IndexPartition parent, const void* realm_color,
5449 size_t color_size, TypeTag type_tag, const char* provenance,
5450 const char* func, IndexPartition handle);
5451 IndexSpace create_index_space_intersection_internal(
5452 Context ctx, IndexPartition parent, const void* realm_color,
5453 size_t color_size, TypeTag type_tag, const char* provenance,
5454 const char* func, const std::vector<IndexSpace>& handles);
5455 IndexSpace create_index_space_intersection_internal(
5456 Context ctx, IndexPartition parent, const void* realm_color,
5457 size_t color_size, TypeTag type_tag, const char* provenance,
5458 const char* func, IndexPartition handle);
5459 IndexSpace create_index_space_difference_internal(
5460 Context ctx, IndexPartition paretn, const void* realm_color,
5461 size_t color_size, TypeTag type_tag, const char* provenance,
5462 const char* func, IndexSpace initial,
5463 const std::vector<IndexSpace>& handles);
5464 IndexSpace get_index_subspace_internal(
5465 IndexPartition handle, const void* realm_color, TypeTag type_tag);
5466 bool has_index_subspace_internal(
5467 IndexPartition handle, const void* realm_color, TypeTag type_tag);
5468 void get_index_partition_color_space_internal(
5469 IndexPartition handle, void* realm_is, TypeTag type_tag);
5470 void get_index_space_domain_internal(
5471 IndexSpace handle, void* realm_is, TypeTag type_tag);
5472 void get_index_space_color_internal(
5473 IndexSpace handle, void* realm_color, TypeTag type_tag);
5474 bool safe_cast_internal(
5475 Context ctx, LogicalRegion region, const void* realm_point,
5476 TypeTag type_tag, const char* func_name);
5477 LogicalRegion get_logical_subregion_by_color_internal(
5478 LogicalPartition parent, const void* realm_color, TypeTag type_tag);
5479 bool has_logical_subregion_by_color_internal(
5480 LogicalPartition parent, const void* realm_color, TypeTag type_tag);
5481 private:
5482 // Methods for the wrapper functions to get information from the runtime
5483 friend class LegionTaskWrapper;
5484 friend class LegionSerialization;
5485 public:
5486 // This method is hidden down here and not publicly documented because
5487 // users shouldn't really need it for anything, however there are some
5488 // reasonable cases where it might be utilitized for things like doing
5489 // file I/O or printf that people might want it for so we've got it
5490 ShardID get_shard_id(Context ctx, bool I_know_what_I_am_doing = false);
5491 // We'll also allow users to get the total number of shards in the context
5492 // if they also ar willing to attest they know what they are doing
5493 size_t get_num_shards(Context ctx, bool I_know_what_I_am_doing = false);
5494 // This is another hidden method for control replication because it's
5495 // still somewhat experimental. In some cases there are unavoidable
5496 // sources of randomness that can mess with the needed invariants for
5497 // control replication (e.g. garbage collectors). This method will
5498 // allow the application to pass in an array of elements from each shard
5499 // and the runtime will fill in an output buffer with an ordered array of
5500 // elements that were passed in by every shard. Each shard will get the
5501 // same elements that were present in all the other shards in the same
5502 // order in the output array. The number of elements in the output buffer
5503 // is returned as a future (of type size_t) as the runtime will return
5504 // immediately and the application can continue running ahead. The
5505 // application must keep the input and output buffers allocated until
5506 // the future resolves. By definition the output buffer need be no bigger
5507 // than the input buffer since only elements that are in the input buffer
5508 // on any shard can appear in the output buffer. Note you can use this
5509 // method safely in contexts that are not control replicated as well:
5510 // the input will just be mem-copied to the output and num_elements
5511 // returned as the future result.
5512 Future consensus_match(
5513 Context ctx, const void* input, void* output, size_t num_elements,
5514 size_t element_size, const char* provenance = nullptr);
5515 private:
5516 friend class Mapper;
5517 Internal::Runtime* runtime;
5518 };
5519
5520} // namespace Legion
5521
5522#include "legion/api/runtime.inl"
5523
5524#endif // __LEGION_RUNTIME_H__
Definition argument_map.h:88
Definition functors.h:323
Definition geometry.h:154
Definition geometry.h:29
Definition transforms.h:118
Definition sync.h:178
Definition exception.h:170
Definition physical_region.h:180
Definition data.h:331
Definition data.h:147
Definition functors.h:356
Definition future.h:45
Definition future_map.h:36
Definition sync.h:97
Definition data.h:87
Definition data.h:122
Definition data.h:30
Definition data.h:65
Definition constraints.h:881
Definition interop.h:33
Definition sync.h:52
Definition data.h:255
Definition data.h:299
Definition data.h:184
Definition data.h:224
Definition interop.h:96
Definition output_region.h:29
Definition sync.h:142
Definition physical_region.h:33
Definition functors.h:376
Definition predicate.h:33
Definition functors.h:40
Definition runtime.h:103
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:2249
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:281
Definition mapping.h:107
Definition argument_map.h:35
Definition buffers.h:185
Definition values.h:56
Definition launchers.h:960
Definition launchers.h:721
Definition launchers.h:357
Definition buffers.h:28
Definition values.h:28
Definition launchers.h:678
Definition requirements.h:311
Definition launchers.h:522
Definition launchers.h:812
Definition launchers.h:436
Definition launchers.h:582
Definition requirements.h:284
Definition launchers.h:178
Definition launchers.h:299
Definition runtime.h:41
Definition registrars.h:34
Definition sync.h:76
Definition launchers.h:1061
Definition requirements.h:245
Definition launchers.h:898
Definition requirements.h:37
Definition runtime.h:51
Definition launchers.h:1007
Definition runtime.h:70
Definition launchers.h:73
Definition registrars.h:106
Definition launchers.h:914
Definition launchers.h:932