Skip to content

Commit

Permalink
#32: remove summary and summarizeUnidirectional from vttv
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Aug 7, 2024
1 parent 33ca721 commit 53df383
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 65 deletions.
43 changes: 0 additions & 43 deletions src/vt-tv/api/object_communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,6 @@ struct ObjectCommunicator {
sent_(sent_in)
{ }

/**
* \brief Summarize one-way communicator properties and check for errors.
*
* \param[in] direction the direction to summarize edges
*/
std::vector<double> summarizeUnidirectional(std::string direction) const {
// Initialize list of volumes
std::vector<double> volumes;

// Iterate over one-way communications
std::multimap<ElementIDType, double> communications;
if(direction == "to") {
communications = this->sent_;
} else {
communications = this->received_;
}

// for (const auto& [key, value] : communications) {
// sanity check
// if(key->get_id() == this->object_id_) {
// throw nb::index_error(
// "object " + this->object_id_ +
// " cannot send communication to itself.");
// }
// volumes.push_back(value);
// }

return volumes;
}

/**
* \brief Get the id of object for this communicator
*
Expand Down Expand Up @@ -127,19 +97,6 @@ struct ObjectCommunicator {
return results;
}

/**
* \brief Summarize communicator properties and check for errors.
*/
std::pair<std::vector<double>, std::vector<double>> summarize() const {
// Summarize sent communications
std::vector<double> w_sent = this->summarizeUnidirectional("to");

// Summarize received communications
std::vector<double> w_recv = this->summarizeUnidirectional("from");

return std::make_pair(w_sent, w_recv);
}

/**
* \brief Add received edge
*
Expand Down
22 changes: 0 additions & 22 deletions tests/unit/api/test_object_communicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,6 @@ TEST_F(ObjectCommunicatorTest, test_initial_state) {
EXPECT_EQ(comm_1.getTotalSentVolume(), 50.0);
}

/**
* Test ObjectCommunicator initial state
*/
TEST_F(ObjectCommunicatorTest, test_summarize_communications_count_empty_communicator) {
// std::make_pair(w_sent, w_recv);
auto summary = comm_0.summarize();
EXPECT_EQ(summary.first.size(), 0);
EXPECT_EQ(summary.second.size(), 0);
}

/**
* Test ObjectCommunicator initial state
*/
TEST_F(ObjectCommunicatorTest, test_summarize_communications_count) {
GTEST_SKIP() << "ObjectCommunicator::summarize seems in WIP and is never called";

// std::make_pair(w_sent, w_recv);
auto summary = comm_0.summarize();
EXPECT_EQ(summary.first.size(), 3);
EXPECT_EQ(summary.second.size(), 2);
}

TEST_F(ObjectCommunicatorTest, test_serialization) {
BasicSerializer<std::variant<ElementIDType,std::multimap<ElementIDType, double>>> s = BasicSerializer<std::variant<ElementIDType,std::multimap<ElementIDType, double>>>();

Expand Down

0 comments on commit 53df383

Please sign in to comment.