Skip to content

Commit

Permalink
Merge pull request #2262 from DARMA-tasking/2261-add-settime-to-elmlb…
Browse files Browse the repository at this point in the history
…data

2261 Add support code for simulating load from within an application
  • Loading branch information
nlslatt authored Mar 26, 2024
2 parents d9b6b24 + 8814790 commit 0f18b6d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/vt/elm/elm_lb_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,27 @@ 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<LoadType> const& subphaseLoads
) {
// warning: this will override any existing time that might be there
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;

Expand Down
4 changes: 4 additions & 0 deletions src/vt/elm/elm_lb_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ 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<LoadType> const& subphaseLoads
);

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

0 comments on commit 0f18b6d

Please sign in to comment.