Skip to content

Commit

Permalink
format fixes learning-process#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin-Grudzin committed Oct 27, 2024
1 parent 67b0364 commit 010cffd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ std::vector<int> getRandomVector(int sz);

class TestMPITaskSequential : public ppc::core::Task {
public:
explicit TestMPITaskSequential(std::shared_ptr<ppc::core::TaskData> taskData_)
: Task(std::move(taskData_)) {}
explicit TestMPITaskSequential(std::shared_ptr<ppc::core::TaskData> taskData_) : Task(std::move(taskData_)){}
bool pre_processing() override;
bool validation() override;
bool run() override;
bool post_processing() override;

private:
std::vector<std::pair<int,int>> input_;
std::pair<int,int> res{};
std::vector<std::pair<int, int>> input_;
std::pair<int, int> res{};
};

class TestMPITaskParallel : public ppc::core::Task {
Expand All @@ -41,9 +40,9 @@ class TestMPITaskParallel : public ppc::core::Task {
bool post_processing() override;

private:
std::vector<std::pair<int,int>> input_, local_input_;
std::pair<int,int> res;
std::vector<std::pair<int, int>> input_, local_input_;
std::pair<int, int> res;
boost::mpi::communicator world;
};

}
} // namespace grudzin_k_nearest_neighbor_elements_mpi
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bool grudzin_k_nearest_neighbor_elements_mpi::TestMPITaskParallel::pre_processin

if (world.rank() == 0) {
// Init vectors
input_ = std::vector<std::pair<int,int>>(world.size()*delta);
input_ = std::vector<std::pair<int, int>>(world.size() * delta);
auto* tmp_ptr = reinterpret_cast<int*>(taskData->inputs[0]);
for (unsigned int i = 0; i < taskData->inputs_count[0] - 1; i++) {
input_[i] = {abs(tmp_ptr[i + 1] - tmp_ptr[i]), i};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@ TEST(grudzin_k_nearest_neighbor_elements_seq, Test_Close_Negative) {
testTaskSequential.post_processing();
ASSERT_EQ(ans, out[0]);
}

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class TestTaskSequential : public ppc::core::Task {
void gen_random_vector(const std::vector<int>& v);

private:
std::vector<std::pair<int,int>> input_{};
std::vector<std::pair<int, int>> input_{};
std::pair<int, int> res{};
};
};

} // namespace grudzin_k_nearest_neighbor_elements_seq

0 comments on commit 010cffd

Please sign in to comment.