-
Notifications
You must be signed in to change notification settings - Fork 80
Гусев Дмитрий. Технология SEQ, MPI. Поразрядная сортировка для вещественных чисел (тип double) с простым слиянием. Вариант 20 #279
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #279 +/- ##
===========================================
- Coverage 94.03% 16.11% -77.92%
===========================================
Files 15 189 +174
Lines 486 7278 +6792
Branches 181 2817 +2636
===========================================
+ Hits 457 1173 +716
- Misses 0 6028 +6028
- Partials 29 77 +48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
просьба увеличить покрытие кода - сейчас 0% |
|
@allnes я ещё начиная с первой лабы на протяжении месяца пытался покрыть код хоть где-то хоть как-то и проверял локально -- я искренне не понимаю какие траблы произошли, что всё, кроме покрытия ок, но порой даже локально файлы не появляются в gcov |
|
@userskins у вас ни один тест не запустился, поэтому у вас 0, вы не правильно написали конфигурацию теста, упущено |
|
@allnes помогло, спасибо большое! покручу ещё для прошлых работ |
tasks/gusev_d_radix_double/report.md
Outdated
| - Используются массивы смещений (displs) и размеров (send_counts) для обработки случая, когда $N \% P \neq 0$. | ||
| - **Коммуникация**: | ||
| - Рассылка (Scatter): MPI_Scatterv распределяет исходный массив по процессам. | ||
| - Сбор (Gather): MPI_Gatherv собирает локально отсортированные массивы обратно на Rank 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where can I find this in your implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В отчёте в разделе 4 "Параллельная схема" описан общий принцип алгоритма с простым слиянием. Однако в разделе 5 "Реализация" я уточнил, что для повышения эффективности сбор данных был заменен на оптимизированный Tree Merge, чтобы избежать аллокации лишней памяти на главном узле. Нужные строчки кода находятся в ops_mpi.cpp
Массивы смещений и размеров:
std::vector<int> send_counts(size);
std::vector<int> displs(size);Рассылка:
MPI_Scatterv(GetInput().data(), send_counts.data(), displs.data(), MPI_DOUBLE, local_data.data(), send_counts[rank], MPI_DOUBLE, 0, MPI_COMM_WORLD);Улучшенный сбор:
while (step < size) {
if (rank % (2 * step) == 0) {
int source = rank + step;
if (source < size) {
int recv_count = 0;
MPI_Recv(&recv_count, 1, MPI_INT, source, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
size_t current_size = local_data.size();
local_data.resize(current_size + recv_count);
MPI_Recv(local_data.data() + current_size, recv_count, MPI_DOUBLE, source, 0, MPI_COMM_WORLD,
MPI_STATUS_IGNORE);
std::inplace_merge(local_data.begin(), local_data.begin() + static_cast<std::ptrdiff_t>(current_size),
local_data.end());
}
} else if (rank % (2 * step) == step) {
int dest = rank - step;
int count = static_cast<int>(local_data.size());
MPI_Send(&count, 1, MPI_INT, dest, 0, MPI_COMM_WORLD);
MPI_Send(local_data.data(), count, MPI_DOUBLE, dest, 0, MPI_COMM_WORLD);
local_data.clear();
local_data.shrink_to_fit();
break;
}
step *= 2;
}Вместе с комментарием отправляю коммит с немного подправленным отчётом (за основу брал отчёт с прошлой лабы и немного всё намешалось)
| return true; | ||
| } | ||
|
|
||
| // NOLINTNEXTLINE(readability-function-cognitive-complexity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove all NOLINTs
tasks/gusev_d_radix_double/report.md
Outdated
| # Звезда | ||
| - Студент: Гусев Дмитрий Алексеевич, 3823Б1ФИ1 | ||
| - Технология: SEQ, MPI | ||
| - Вариант: 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 or 20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отчёт поправил
Описание
Чек-лист
<фамилия>_<первая_буква_имени>_<короткое_название_задачи>clang-formatлокально в моем форке (нет ошибок форматирования)clang-tidyлокально в моем форке (нет предупреждений/ошибок)gusev_d_radix_double), а не вmaster