Skip to content

Commit

Permalink
#1835: lb: rename CommModel
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Jun 15, 2022
1 parent 2309939 commit 25d4c28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@HEADER
// *****************************************************************************
//
// comm_model.cc
// weighted_messages.cc
// DARMA/vt => Virtual Transport
//
// Copyright 2019-2021 National Technology & Engineering Solutions of Sandia, LLC
Expand Down Expand Up @@ -41,11 +41,11 @@
//@HEADER
*/

#include "vt/vrt/collection/balance/model/comm_model.h"
#include "vt/vrt/collection/balance/model/weighted_messages.h"

namespace vt { namespace vrt { namespace collection { namespace balance {

TimeType CommModel::getModeledComm(ElementIDStruct object, PhaseOffset when) {
TimeType WeightedMessages::getModeledComm(ElementIDStruct object, PhaseOffset when) {
auto phase = getNumCompletedPhases() + when.phases;
auto& comm = proc_comm_->at(phase);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@HEADER
// *****************************************************************************
//
// comm_model.h
// weighted_messages.h
// DARMA/vt => Virtual Transport
//
// Copyright 2019-2021 National Technology & Engineering Solutions of Sandia, LLC
Expand Down Expand Up @@ -41,23 +41,23 @@
//@HEADER
*/

#if !defined INCLUDED_VT_VRT_COLLECTION_BALANCE_MODEL_COMM_MODEL_H
#define INCLUDED_VT_VRT_COLLECTION_BALANCE_MODEL_COMM_MODEL_H
#if !defined INCLUDED_VT_VRT_COLLECTION_BALANCE_MODEL_WEIGHTED_MESSAGES_H
#define INCLUDED_VT_VRT_COLLECTION_BALANCE_MODEL_WEIGHTED_MESSAGES_H

#include "vt/vrt/collection/balance/model/composed_model.h"
#include <unordered_map>

namespace vt { namespace vrt { namespace collection { namespace balance {

struct CommModel : public ComposedModel {
struct WeightedMessages : public ComposedModel {
/**
* \brief Constructor
*
* \param[in] base: the underlying source of object work loads
* \param[in] in_per_msg_weight weight to add per message received
* \param[in] in_per_byte_weight weight to add per byte received
*/
explicit CommModel(
explicit WeightedMessages(
std::shared_ptr<balance::LoadModel> base,
TimeType in_per_msg_weight, TimeType in_per_byte_weight
) : ComposedModel(base),
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/collection/test_model_comm_model.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/

#include <vt/vrt/collection/balance/model/load_model.h>
#include <vt/vrt/collection/balance/model/comm_model.h>
#include <vt/vrt/collection/balance/model/weighted_messages.h>

#include <gtest/gtest.h>

Expand All @@ -52,13 +52,13 @@

namespace vt { namespace tests { namespace unit { namespace comm { namespace model {

using TestModelCommModel = TestHarness;
using TestModelWeightedMessages = TestHarness;

using vt::elm::CommKeyType;
using vt::elm::CommMapType;
using vt::elm::CommVolume;
using vt::elm::ElementIDStruct;
using vt::vrt::collection::balance::CommModel;
using vt::vrt::collection::balance::WeightedMessages;
using vt::vrt::collection::balance::LoadMapType;
using vt::vrt::collection::balance::LoadModel;
using vt::vrt::collection::balance::ObjectIterator;
Expand Down Expand Up @@ -107,7 +107,7 @@ struct StubModel : LoadModel {
ProcLoadMap const* proc_load_ = nullptr;
};

TEST_F(TestModelCommModel, test_comm_model) {
TEST_F(TestModelWeightedMessages, test_model) {

// For simplicity's sake, the elements are on the home node
// Element 1 (home node == 1)
Expand Down Expand Up @@ -146,7 +146,7 @@ TEST_F(TestModelCommModel, test_comm_model) {
constexpr auto per_msg_weight = 3.0;
constexpr auto per_byte_weight = 5.0;

auto test_model = std::make_shared<CommModel>(
auto test_model = std::make_shared<WeightedMessages>(
std::make_shared<StubModel>(), per_msg_weight, per_byte_weight
);
test_model->setLoads(&proc_load, &proc_comm);
Expand Down

0 comments on commit 25d4c28

Please sign in to comment.