20
20
21
21
#include " deterministic_random.h"
22
22
#include " legion.h"
23
+ #include " logging_wrapper.h"
23
24
#include " mapper.h"
24
25
25
26
using namespace Legion ;
@@ -52,6 +53,7 @@ static Logger log_fuzz("fuzz");
52
53
53
54
static RngSeed root_seed;
54
55
static uint64_t replicate_levels = 0 ;
56
+ static bool mapper_logging = false ;
55
57
56
58
static long long parse_long_long (const std::string &flag, const std::string &arg) {
57
59
long long result;
@@ -84,6 +86,7 @@ struct FuzzerConfig {
84
86
uint64_t replicate_levels = 0 ;
85
87
uint64_t num_ops = 1 ;
86
88
uint64_t skip_ops = 0 ;
89
+ bool mapper_logging = false ;
87
90
88
91
static FuzzerConfig parse_args (int argc, char **argv) {
89
92
FuzzerConfig config;
@@ -116,6 +119,8 @@ struct FuzzerConfig {
116
119
} else if (flag == " -fuzz:skip" ) {
117
120
std::string arg (argv[++i]);
118
121
config.skip_ops = parse_uint64_t (flag, arg);
122
+ } else if (flag == " -fuzz:mapper_logging" ) {
123
+ config.mapper_logging = true ;
119
124
}
120
125
}
121
126
return config;
@@ -135,6 +140,7 @@ struct FuzzerConfig {
135
140
LOG_ONCE (log_fuzz.print () << " config.replicate_levels = " << replicate_levels);
136
141
LOG_ONCE (log_fuzz.print () << " config.num_ops = " << num_ops);
137
142
LOG_ONCE (log_fuzz.print () << " config.skip_ops = " << skip_ops);
143
+ LOG_ONCE (log_fuzz.print () << " config.mapper_logging = " << mapper_logging);
138
144
}
139
145
};
140
146
@@ -1211,9 +1217,12 @@ void top_level(const Task *task, const std::vector<PhysicalRegion> ®ions, Con
1211
1217
static void create_mappers (Machine machine, Runtime *runtime,
1212
1218
const std::set<Processor> &local_procs) {
1213
1219
for (Processor proc : local_procs) {
1214
- FuzzMapper::FuzzMapper *mapper =
1220
+ Mapping::Mapper *mapper =
1215
1221
new FuzzMapper::FuzzMapper (runtime->get_mapper_runtime (), machine, proc,
1216
1222
root_seed.make_stream (), replicate_levels);
1223
+ if (mapper_logging) {
1224
+ mapper = new Mapping::LoggingWrapper (mapper);
1225
+ }
1217
1226
runtime->replace_default_mapper (mapper, proc);
1218
1227
}
1219
1228
}
@@ -1227,6 +1236,7 @@ int main(int argc, char **argv) {
1227
1236
FuzzerConfig config = FuzzerConfig::parse_args (argc, argv);
1228
1237
root_seed = RngSeed (config.initial_seed );
1229
1238
replicate_levels = config.replicate_levels ;
1239
+ mapper_logging = config.mapper_logging ;
1230
1240
1231
1241
Runtime::preregister_projection_functor (PROJECTION_OFFSET_1_ID,
1232
1242
new OffsetProjection (1 ));
0 commit comments