Skip to content

Commit 6f710cb

Browse files
Merge branch 'master' into rc
2 parents 0407519 + 0b27339 commit 6f710cb

File tree

4 files changed

+36
-13
lines changed

4 files changed

+36
-13
lines changed

runtime/legion/api/argument_map.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ namespace Legion {
515515
}
516516
else
517517
future_map = ctx->construct_future_map(
518-
point_set->handle, arguments, provenance, true /*internal*/);
518+
point_set->handle, arguments, provenance, false /*collective*/,
519+
0 /*sharding id*/, true /*internal*/, false /*check space*/);
519520
equivalent = true; // mark that these are equivalent
520521
dependent_futures = 0; // reset this for the next unpack
521522
return future_map;

runtime/legion/kernel/runtime.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ namespace Legion {
113113
void LgEvent::end_wait(Context ctx, bool from_application) const
114114
//--------------------------------------------------------------------------
115115
{
116+
if ((runtime->profiler != nullptr) && (implicit_profiler == nullptr) &&
117+
implicit_fevent.exists())
118+
{
119+
// This can occur when a (meta-)task that was previously running,
120+
// but waited on a event, and Realm wakes it up on a new kernel
121+
// thread that has never run a task before and therefore hasn't
122+
// been assigned an implicit profiler yet
123+
implicit_profiler =
124+
runtime->profiler->find_or_create_profiling_instance();
125+
}
116126
if (ctx != nullptr)
117127
ctx->end_wait(*this, from_application);
118128
else if (

runtime/legion/tools/profiler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ namespace Legion {
237237
owner(own)
238238
//--------------------------------------------------------------------------
239239
{
240-
if (external_fevent.exists())
240+
if (external_fevent.exists() && !implicit_fevent.exists())
241241
implicit_fevent = external_fevent;
242242
}
243243

tools/legion_prof_rs/src/backend/analyze.rs

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::cmp::{Reverse, max, min};
22
use std::collections::BTreeMap;
33

4-
use crate::state::{Proc, ProcEntry, ProcEntryKind, State, Timestamp};
4+
use crate::state::{Container, Proc, ProcEntry, ProcEntryKind, State, Timestamp};
55

66
#[derive(Debug, Copy, Clone)]
77
struct ProcEntryStats {
@@ -61,11 +61,7 @@ fn accumulate_statistics(
6161
for wait in &entry.waiters.wait_intervals {
6262
let waiting = wait.end - wait.start;
6363
assert!(waiting <= total);
64-
if waiting <= total {
65-
total -= waiting;
66-
} else {
67-
total = Timestamp::ZERO;
68-
}
64+
total -= waiting;
6965
}
7066
stats.running_time += total;
7167
}
@@ -141,11 +137,27 @@ fn print_statistics(
141137
state.meta_variants.get(variant_id).unwrap().name
142138
);
143139
}
144-
ProcEntryKind::MapperCall(_, _, call_kind) => {
145-
println!(
146-
" Mapper Call {}",
147-
state.mapper_call_kinds.get(call_kind).unwrap().name
148-
);
140+
ProcEntryKind::MapperCall(mapper_id, proc_id, call_kind) => {
141+
let proc_name = if let Some(proc) = state.procs.get(&proc_id) {
142+
&proc.name(state)
143+
} else {
144+
"NO_PROC"
145+
};
146+
if let Some(mapper) = state.mappers.get(&(*mapper_id, *proc_id)) {
147+
println!(
148+
" Mapper Call {} for mapper {} on proc {}",
149+
state.mapper_call_kinds.get(call_kind).unwrap().name,
150+
mapper.name,
151+
proc_name
152+
);
153+
} else {
154+
println!(
155+
" Mapper Call {} for mapper {} on proc {}",
156+
state.mapper_call_kinds.get(call_kind).unwrap().name,
157+
mapper_id.0,
158+
proc_name
159+
);
160+
}
149161
}
150162
ProcEntryKind::RuntimeCall(call_kind) => {
151163
println!(

0 commit comments

Comments
 (0)