Skip to content

Commit 0f18b6d

Browse files
authored
Merge pull request #2262 from DARMA-tasking/2261-add-settime-to-elmlbdata
2261 Add support code for simulating load from within an application
2 parents d9b6b24 + 8814790 commit 0f18b6d

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/vt/elm/elm_lb_data.cc

+17-1
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,27 @@ void ElementLBData::addTime(LoadType const timeLoad) {
133133
vt_debug_print(
134134
verbose,lb,
135135
"ElementLBData: addTime: time={}, cur_load={}\n",
136-
time,
136+
timeLoad,
137137
phase_timings_[cur_phase_]
138138
);
139139
}
140140

141+
void ElementLBData::setTime(
142+
LoadType const timeLoad,
143+
std::vector<LoadType> const& subphaseLoads
144+
) {
145+
// warning: this will override any existing time that might be there
146+
phase_timings_[cur_phase_] = timeLoad;
147+
148+
subphase_timings_[cur_phase_] = subphaseLoads;
149+
150+
vt_debug_print(
151+
verbose,lb,
152+
"ElementLBData: setTime: time={}\n",
153+
timeLoad
154+
);
155+
}
156+
141157
void ElementLBData::setPhase(PhaseType const& new_phase) {
142158
cur_phase_ = new_phase;
143159

src/vt/elm/elm_lb_data.h

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ struct ElementLBData {
6464
void start(TimeType time);
6565
void stop(TimeType time);
6666
void addTime(LoadType const timeLoad);
67+
/// warning: this will override any existing time that might be there
68+
void setTime(
69+
LoadType const timeLoad, std::vector<LoadType> const& subphaseLoads
70+
);
6771

6872
void sendToEntity(ElementIDStruct to, ElementIDStruct from, double bytes);
6973
void sendComm(elm::CommKey key, double bytes);

0 commit comments

Comments
 (0)