From 86d47fb539805f1ccccb0432b57472b7abc30de3 Mon Sep 17 00:00:00 2001 From: Nicole Lemaster Slattengren Date: Mon, 25 Mar 2024 12:06:49 -0700 Subject: [PATCH 1/2] #2261: elm: add settime to elmlbdata --- src/vt/elm/elm_lb_data.cc | 17 ++++++++++++++++- src/vt/elm/elm_lb_data.h | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/vt/elm/elm_lb_data.cc b/src/vt/elm/elm_lb_data.cc index a15ee4d3eb..aaf303377d 100644 --- a/src/vt/elm/elm_lb_data.cc +++ b/src/vt/elm/elm_lb_data.cc @@ -133,11 +133,26 @@ void ElementLBData::addTime(LoadType const timeLoad) { vt_debug_print( verbose,lb, "ElementLBData: addTime: time={}, cur_load={}\n", - time, + timeLoad, phase_timings_[cur_phase_] ); } +void ElementLBData::setTime( + LoadType const timeLoad, + std::vector const& subphaseLoads +) { + phase_timings_[cur_phase_] = timeLoad; + + subphase_timings_[cur_phase_] = subphaseLoads; + + vt_debug_print( + verbose,lb, + "ElementLBData: setTime: time={}\n", + timeLoad + ); +} + void ElementLBData::setPhase(PhaseType const& new_phase) { cur_phase_ = new_phase; diff --git a/src/vt/elm/elm_lb_data.h b/src/vt/elm/elm_lb_data.h index 1ae770e484..92907ee519 100644 --- a/src/vt/elm/elm_lb_data.h +++ b/src/vt/elm/elm_lb_data.h @@ -64,6 +64,9 @@ struct ElementLBData { void start(TimeType time); void stop(TimeType time); void addTime(LoadType const timeLoad); + void setTime( + LoadType const timeLoad, std::vector const& subphaseLoads + ); void sendToEntity(ElementIDStruct to, ElementIDStruct from, double bytes); void sendComm(elm::CommKey key, double bytes); From 8814790895e9c2bc2132c96c7f339dc706257325 Mon Sep 17 00:00:00 2001 From: Nicole Lemaster Slattengren Date: Mon, 25 Mar 2024 13:04:59 -0700 Subject: [PATCH 2/2] #2261: elm: add warning about settime --- src/vt/elm/elm_lb_data.cc | 1 + src/vt/elm/elm_lb_data.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/vt/elm/elm_lb_data.cc b/src/vt/elm/elm_lb_data.cc index aaf303377d..71796b3b60 100644 --- a/src/vt/elm/elm_lb_data.cc +++ b/src/vt/elm/elm_lb_data.cc @@ -142,6 +142,7 @@ void ElementLBData::setTime( LoadType const timeLoad, std::vector const& subphaseLoads ) { + // warning: this will override any existing time that might be there phase_timings_[cur_phase_] = timeLoad; subphase_timings_[cur_phase_] = subphaseLoads; diff --git a/src/vt/elm/elm_lb_data.h b/src/vt/elm/elm_lb_data.h index 92907ee519..01b6c4c8b6 100644 --- a/src/vt/elm/elm_lb_data.h +++ b/src/vt/elm/elm_lb_data.h @@ -64,6 +64,7 @@ struct ElementLBData { void start(TimeType time); void stop(TimeType time); void addTime(LoadType const timeLoad); + /// warning: this will override any existing time that might be there void setTime( LoadType const timeLoad, std::vector const& subphaseLoads );