Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Соловьев Алексей. Задача 2. Вариант 12. Топология сети Звезда. #327

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

Alexey-Solovev
Copy link
Contributor

Нулевой процесс, который является root процессом, получает на вход вектор целых чисел, который записывается в переменную input_, затем передаёт эту переменную всем остальным процессам, в свою очередь остальные процессы принимают эту переменную и передают её обратно в нулевой процесс, при получении этих данных нулевой процесс записывает их в переменную res, которая изначально инициализируется как вектор нулей такого же размера как и входные данные. В тестах происходит поэлементное сравнение входных данных и итогового результата.

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.33%. Comparing base (b456b24) to head (0b739c5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #327      +/-   ##
==========================================
+ Coverage   96.31%   96.33%   +0.01%     
==========================================
  Files         437      439       +2     
  Lines       11236    11283      +47     
  Branches     4739     4759      +20     
==========================================
+ Hits        10822    10869      +47     
  Misses        136      136              
  Partials      278      278              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

#include "core/perf/include/perf.hpp"
#include "mpi/solovev_a_star_topology/include/ops_mpi.hpp"

std::vector<int> generate_random_vector(size_t size) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function should also be used in a func_tests to generate a random vector for tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


#include "mpi/solovev_a_star_topology/include/ops_mpi.hpp"

std::vector<int> generate_random_vector(size_t size) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it either static or wrap with namespace

testMpiTaskParallel.post_processing();
if (world.rank() == 0) {
for (size_t i = 0; i < input.size(); ++i) {
ASSERT_EQ(output[i], input[i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add checks of received data on each data

#include <vector>

#include "mpi/solovev_a_star_topology/include/ops_mpi.hpp"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add tests that verify data transfer order


TEST(solovev_a_star_topology_mpi, Test_order) {
boost::mpi::communicator world;
if (world.size() > 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check in validation please

Copy link
Contributor

@PutinVVV PutinVVV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a test to check the first condition in validation, that is, so that its input and output data are of different sizes but not empty
, and delete the library random in the implementation of func_test and perf_test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants