Skip to content

Commit

Permalink
Merge pull request #3 from gshipman/fix-tracing
Browse files Browse the repository at this point in the history
Fix tracing
  • Loading branch information
lightsighter authored Feb 28, 2023
2 parents 9fcbb64 + 2606373 commit 3957c37
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ void Driver::run(void) {
Future f_time = Future::from_value(runtime, time_init);
const int cycle_init = 0;
Future f_cycle = Future::from_value(runtime, cycle_init);
Future f_dt, f_cdt; // initialized by first iteration
// Need to give these dummy values so we can trace consistently
Future f_dt = Future::from_value(runtime, 0.0);
Future f_cdt = Future::from_value(runtime, 0.0);
Future f_prev_report;
// Create a trace ID for all of Pennant to use
const TraceID trace_id =
Expand Down Expand Up @@ -204,10 +206,10 @@ Future Driver::calcGlobalDt(
TaskLauncher launcher(TID_CALCGLOBALDT, TaskArgument(&args, sizeof(args)), pred);
launcher.set_predicate_false_future(f_dt);
launcher.add_future(f_time);
if (cycle > 0) {
launcher.add_future(f_dt);
launcher.add_future(f_cdt);
}
// These won't be read on the first cycle but add them anyway so that the
// trace is valid
launcher.add_future(f_dt);
launcher.add_future(f_cdt);
return runtime->execute_task(ctx, launcher);
}

Expand Down

0 comments on commit 3957c37

Please sign in to comment.