Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
aa2db2c
Initial commit
allnes Oct 10, 2025
5a97f24
Bump sphinx from 8.1.3 to 8.2.3
dependabot[bot] Oct 10, 2025
f2fba92
Update README.md with new repository links and badges
allnes Oct 10, 2025
500d476
Merge pull request #1 from learning-process/dependabot/pip/sphinx-8.2.3
allnes Oct 10, 2025
f1b56e7
Add Codecov token to coverage report upload step
allnes Oct 10, 2025
b69d83f
HOT FIX: fix mpi time measurment (#651) (#5)
allnes Oct 23, 2025
88d3a96
Hotfix for clang-tidy remark in modules/task/include/task.hpp (#660) …
aobolensk Oct 30, 2025
a3a1b18
WA: disable failing threads test (#662) (#13)
aobolensk Oct 30, 2025
256735e
Windows build fix (#661) (#14)
allnes Oct 31, 2025
92d1b94
Update task deadlines to 14
allnes Nov 3, 2025
6d5ff93
Port: Ensure consistent RGB image loading across tasks (#19)
allnes Nov 3, 2025
2a75039
Update Pages badge link in README.md
allnes Nov 3, 2025
16abe74
[HOT FIX] Stabilize macOS CI tests: OpenMP linking, MPI env, per-test…
allnes Nov 4, 2025
266b2bf
Rename all names
Svetlana-plv Nov 6, 2025
4a2097b
Ensure deterministic test shuffle order across MPI ranks (#670) (#22)
allnes Nov 7, 2025
edc2400
Stabilize MPI tests and prevent hangs (#672) (#23)
allnes Nov 7, 2025
e6919dc
Update task deadlines to 17
allnes Nov 7, 2025
deeeb25
Add test data
Svetlana-plv Nov 12, 2025
cfc99b5
Add seq version
Svetlana-plv Nov 12, 2025
16e3086
update seq
Svetlana-plv Nov 13, 2025
fb107ad
add mpi version
Svetlana-plv Nov 13, 2025
3af4463
update func tests
Svetlana-plv Nov 13, 2025
4860203
add func tests
Svetlana-plv Nov 13, 2025
1c1f648
Merge master into pylaeva_s_max_elem_matrix
Svetlana-plv Nov 13, 2025
8089cda
fixed some type
Svetlana-plv Nov 13, 2025
9084884
change form of test params
Svetlana-plv Nov 13, 2025
702c1fd
change data
Svetlana-plv Nov 16, 2025
ba7c440
change mpi version and reading files
Svetlana-plv Nov 16, 2025
ac599f0
Merge branch 'learning-process:master' into pylaeva_s_max_elem_matrix
Svetlana-plv Nov 16, 2025
62060c9
add new data
Svetlana-plv Nov 16, 2025
74061c4
Merge branch 'pylaeva_s_max_elem_matrix' of https://github.com/Svetla…
Svetlana-plv Nov 16, 2025
e04d8ac
Add a larger data
Svetlana-plv Nov 17, 2025
bab67e8
clang-format
Svetlana-plv Nov 17, 2025
6a28040
Improve perfomance
Svetlana-plv Nov 17, 2025
3ae5861
clang-tidy
Svetlana-plv Nov 17, 2025
92ac1a2
clang-tidy and perf tests
Svetlana-plv Nov 17, 2025
1126650
add larger data
Svetlana-plv Nov 17, 2025
dd95734
some changes in mpi
Svetlana-plv Nov 18, 2025
2cc3224
clang-tidy
Svetlana-plv Nov 18, 2025
a52636d
add allreduce and data changes
Svetlana-plv Nov 18, 2025
b938de7
Add report
Svetlana-plv Nov 19, 2025
0186e20
change mpi, add nonquad matrix, change tests
Svetlana-plv Nov 22, 2025
0133c89
delete large file
Svetlana-plv Nov 22, 2025
c3d1d17
change mpi
Svetlana-plv Nov 23, 2025
d4cfeb7
change input data
Svetlana-plv Nov 24, 2025
18315ba
clang tidy
Svetlana-plv Nov 24, 2025
faa34f8
add report
Svetlana-plv Nov 24, 2025
7544c59
small fix in report
Svetlana-plv Nov 24, 2025
67e41a0
hot fix
Svetlana-plv Nov 24, 2025
173597a
final report fix
Svetlana-plv Nov 24, 2025
7e8e763
small fix in report
Svetlana-plv Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/common/include/common.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <cstddef>
#include <string>
#include <tuple>
#include <vector>

#include "task/include/task.hpp"

namespace pylaeva_s_max_elem_matrix {

using InType = std::tuple<size_t, size_t, std::vector<int>>;
using OutType = int;
using TestType = std::string;
using BaseTask = ppc::task::Task<InType, OutType>;

} // namespace pylaeva_s_max_elem_matrix
2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_1000x1000.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_100x100.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_11x11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
11 11 21
-96 -951 -935 -352 -510 -635 -639 -908 -425 -969 -928 -908 -944 -395 -899 -429 -863 -69 -280 -868 -987 -18 -582 -112 -298 -230 -949 -588 -12 -719 -816 -878 -347 -384 -224 -370 20 -930 -984 -720 -593 -548 -132 -875 -455 -542 20 -968 -926 -779 -299 -778 -805 -624 -180 -965 -871 -351 -455 -615 20 -22 -643 -933 -609 -867 -325 -11 -902 -996 -145 -658 -234 -119 -603 -119 -894 -724 -72 -687 -33 -206 -798 -695 -529 -671 -78 -872 -953 -321 -739 -189 -144 -82 -859 -461 -209 -215 -704 -633 -866 -417 -83 16 -146 -248 -352 -471 -626 -510 -665 -863 -275 -689 -20 -688 -196 -116 -209 -20 21
2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_1500x1000.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_150x100.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_200x200.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_3x3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3 3 100
100 99 -27 66 14 52 -67 10 10
2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_500x1000.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_50x50.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
50 50 -10
-10 -940 -505 -21 -46 -310 -27 -318 -603 -445 -93 -194 -857 -648 -540 -484 -50 -863 -612 -852 -638 -904 -816 -254 -821 -522 -345 -613 -529 -229 -409 -78 -856 -608 -645 -278 -785 -507 -875 -378 -180 -109 -695 -507 -705 -480 -797 -409 -747 -433 -472 -248 -911 -49 -515 -460 -750 -126 -970 -131 -212 -570 -63 -389 -49 -192 -406 -211 -784 -362 -370 -941 -701 -951 -385 -821 -875 -24 -771 -783 -411 -805 -807 -174 -234 -413 -725 -969 -891 -595 -113 -250 -675 -613 -335 -651 -217 -27 -997 -399 -443 -177 -773 -519 -861 -396 -617 -438 -503 -840 -994 -148 -199 -947 -657 -240 -616 -400 -873 -483 -791 -152 -919 -148 -313 -969 -365 -435 -894 -398 -748 -965 -401 -615 -898 -784 -93 -59 -238 -786 -656 -404 -615 -719 -332 -362 -532 -538 -747 -657 -225 -564 -400 -848 -308 -980 -549 -899 -270 -423 -869 -95 -794 -599 -848 -336 -324 -981 -101 -327 -288 -993 -499 -224 -839 -63 -410 -200 -325 -987 -409 -933 -605 -441 -413 -781 -786 -405 -646 -497 -548 -320 -387 -558 -811 -359 -358 -140 -422 -371 -697 -637 -759 -940 -653 -668 -356 -297 -267 -951 -131 -304 -419 -134 -907 -374 -809 -957 -122 -361 -228 -245 -942 -100 -702 -830 -708 -418 -183 -626 -470 -817 -743 -857 -139 -61 -234 -64 -705 -27 -236 -638 -855 -482 -865 -219 -671 -907 -249 -778 -758 -171 -403 -702 -420 -101 -688 -90 -542 -926 -821 -374 -507 -87 -238 -468 -626 -948 -561 -75 -536 -263 -30 -63 -321 -946 -198 -263 -209 -636 -649 -596 -676 -319 -727 -927 -934 -798 -274 -196 -66 -969 -284 -52 -977 -282 -850 -139 -999 -649 -350 -314 -887 -299 -270 -139 -535 -690 -270 -987 -664 -350 -581 -916 -889 -606 -999 -414 -905 -789 -568 -813 -233 -829 -457 -916 -652 -628 -693 -218 -313 -811 -888 -191 -395 -338 -537 -123 -113 -929 -200 -600 -97 -522 -935 -222 -332 -155 -786 -81 -605 -163 -140 -905 -24 -622 -792 -147 -366 -886 -973 -254 -761 -681 -640 -971 -822 -986 -621 -979 -108 -587 -786 -579 -836 -233 -969 -829 -113 -818 -226 -575 -883 -162 -793 -45 -768 -865 -275 -404 -487 -207 -961 -251 -745 -419 -198 -224 -134 -800 -493 -534 -471 -944 -157 -250 -933 -109 -395 -281 -140 -725 -718 -889 -274 -912 -740 -390 -238 -533 -525 -117 -140 -376 -495 -596 -781 -697 -59 -419 -964 -330 -639 -751 -535 -228 -437 -359 -512 -405 -199 -271 -501 -180 -711 -490 -745 -517 -790 -747 -421 -760 -822 -913 -452 -334 -817 -573 -323 -659 -743 -114 -610 -829 -842 -226 -33 -622 -376 -212 -409 -320 -938 -181 -557 -304 -690 -174 -220 -867 -302 -935 -458 -233 -675 -851 -956 -995 -248 -992 -945 -539 -381 -101 -512 -482 -75 -476 -977 -674 -795 -724 -976 -877 -334 -783 -661 -558 -352 -822 -863 -403 -71 -511 -95 -264 -282 -172 -32 -933 -783 -665 -739 -625 -877 -619 -996 -238 -920 -86 -379 -773 -938 -725 -818 -619 -219 -46 -121 -267 -364 -458 -349 -256 -264 -204 -285 -363 -304 -889 -606 -514 -991 -335 -474 -342 -434 -785 -450 -920 -526 -26 -569 -153 -641 -919 -780 -139 -579 -340 -809 -512 -746 -966 -844 -882 -158 -487 -57 -959 -734 -40 -344 -250 -744 -538 -403 -544 -715 -419 -692 -696 -686 -28 -134 -406 -527 -40 -494 -21 -441 -357 -488 -666 -466 -186 -472 -771 -651 -628 -449 -575 -255 -941 -910 -353 -670 -97 -86 -952 -857 -584 -902 -906 -310 -878 -98 -170 -821 -413 -486 -710 -662 -805 -291 -35 -728 -694 -103 -67 -684 -301 -907 -101 -610 -905 -335 -415 -788 -157 -794 -530 -241 -536 -786 -898 -731 -527 -908 -265 -344 -479 -929 -801 -826 -115 -514 -879 -304 -149 -465 -376 -502 -885 -729 -710 -133 -615 -680 -442 -755 -129 -887 -185 -862 -41 -579 -618 -166 -792 -746 -620 -652 -165 -97 -777 -62 -876 -633 -308 -736 -322 -666 -656 -911 -731 -798 -390 -774 -492 -445 -153 -284 -391 -731 -291 -114 -55 -952 -941 -934 -197 -43 -137 -735 -388 -751 -564 -377 -970 -419 -237 -997 -248 -237 -624 -215 -854 -759 -912 -75 -890 -930 -81 -383 -608 -626 -681 -567 -765 -888 -124 -657 -405 -957 -50 -852 -73 -456 -622 -496 -883 -739 -415 -315 -556 -377 -798 -945 -50 -200 -226 -697 -208 -181 -710 -373 -950 -356 -424 -925 -477 -577 -371 -585 -667 -889 -183 -968 -174 -414 -982 -939 -305 -113 -282 -229 -546 -622 -396 -940 -560 -222 -315 -147 -105 -648 -648 -841 -765 -630 -529 -930 -575 -989 -644 -250 -624 -119 -218 -63 -225 -751 -402 -323 -392 -765 -186 -873 -94 -957 -209 -241 -325 -842 -299 -341 -813 -78 -437 -62 -935 -935 -208 -750 -240 -485 -553 -434 -281 -191 -408 -217 -918 -664 -231 -896 -718 -536 -819 -84 -669 -102 -603 -215 -897 -175 -939 -698 -863 -590 -144 -422 -157 -185 -299 -400 -1000 -86 -184 -125 -576 -615 -158 -756 -759 -833 -167 -409 -680 -815 -512 -677 -113 -61 -609 -207 -76 -860 -489 -287 -265 -900 -188 -263 -141 -887 -220 -287 -530 -55 -728 -414 -971 -607 -967 -233 -878 -250 -407 -900 -469 -943 -325 -65 -154 -311 -626 -601 -932 -57 -76 -484 -440 -623 -117 -238 -580 -708 -722 -991 -568 -895 -442 -995 -962 -572 -965 -279 -403 -266 -904 -799 -157 -710 -580 -927 -431 -991 -880 -589 -942 -697 -337 -65 -242 -363 -149 -26 -38 -751 -763 -419 -352 -180 -349 -550 -552 -735 -579 -500 -729 -745 -196 -907 -824 -428 -850 -497 -513 -850 -20 -875 -508 -821 -742 -766 -255 -429 -874 -79 -843 -880 -216 -527 -264 -588 -661 -223 -470 -625 -592 -449 -593 -247 -984 -698 -339 -248 -42 -835 -442 -625 -949 -238 -804 -676 -231 -290 -459 -659 -507 -422 -209 -923 -751 -707 -995 -680 -688 -330 -59 -447 -849 -282 -952 -952 -81 -198 -627 -244 -573 -802 -524 -937 -185 -484 -89 -301 -888 -948 -927 -534 -812 -992 -825 -142 -705 -303 -966 -951 -588 -365 -781 -925 -272 -528 -524 -303 -845 -778 -239 -206 -372 -999 -290 -194 -326 -472 -75 -918 -152 -328 -730 -60 -562 -795 -691 -503 -687 -24 -188 -964 -432 -343 -418 -830 -965 -207 -917 -795 -604 -46 -329 -202 -614 -515 -818 -786 -860 -202 -436 -662 -574 -70 -520 -494 -245 -781 -716 -868 -301 -984 -474 -707 -771 -933 -788 -301 -69 -499 -217 -22 -308 -993 -608 -605 -127 -495 -668 -672 -741 -979 -337 -509 -680 -731 -586 -481 -749 -233 -154 -333 -717 -905 -382 -888 -672 -547 -931 -696 -697 -692 -612 -242 -623 -778 -496 -116 -627 -79 -226 -153 -757 -522 -112 -926 -508 -963 -645 -962 -749 -260 -64 -135 -705 -248 -882 -489 -216 -958 -933 -41 -60 -763 -54 -836 -634 -495 -715 -700 -135 -232 -104 -818 -766 -335 -158 -287 -270 -181 -931 -283 -113 -459 -347 -749 -855 -659 -171 -723 -113 -110 -363 -722 -552 -108 -708 -109 -803 -548 -777 -365 -167 -828 -728 -667 -189 -598 -526 -10 -447 -497 -329 -858 -301 -787 -752 -334 -117 -786 -446 -671 -220 -417 -335 -99 -987 -854 -963 -548 -894 -343 -844 -158 -224 -698 -124 -317 -941 -857 -868 -905 -884 -690 -742 -502 -158 -369 -548 -242 -214 -799 -658 -176 -364 -313 -332 -900 -211 -333 -810 -665 -135 -138 -264 -529 -849 -871 -535 -173 -95 -163 -663 -632 -268 -75 -656 -359 -96 -394 -126 -410 -44 -945 -502 -885 -738 -236 -381 -924 -551 -410 -223 -391 -136 -817 -757 -679 -529 -767 -316 -720 -678 -146 -423 -644 -750 -944 -486 -591 -505 -333 -271 -722 -24 -619 -308 -962 -92 -635 -644 -731 -916 -153 -626 -951 -845 -948 -158 -727 -846 -777 -493 -178 -499 -973 -485 -505 -552 -809 -569 -120 -492 -948 -764 -865 -480 -861 -185 -584 -177 -195 -378 -995 -21 -463 -373 -454 -466 -290 -810 -386 -387 -74 -363 -124 -518 -490 -329 -773 -722 -162 -154 -460 -689 -992 -729 -679 -45 -574 -664 -720 -67 -718 -948 -499 -553 -849 -105 -452 -26 -965 -588 -28 -539 -39 -723 -228 -704 -905 -954 -344 -192 -303 -586 -193 -683 -779 -860 -993 -125 -962 -84 -638 -670 -566 -447 -106 -250 -952 -348 -296 -147 -584 -85 -371 -601 -103 -849 -871 -66 -236 -224 -127 -228 -633 -497 -314 -622 -633 -102 -743 -738 -303 -319 -761 -427 -409 -63 -956 -497 -292 -839 -390 -747 -630 -88 -305 -75 -268 -383 -892 -431 -716 -947 -825 -172 -221 -477 -135 -872 -723 -759 -521 -361 -425 -319 -260 -926 -200 -660 -645 -529 -525 -729 -214 -610 -476 -976 -540 -203 -278 -605 -938 -180 -593 -482 -495 -325 -757 -760 -820 -632 -323 -395 -943 -707 -42 -152 -769 -435 -138 -781 -478 -146 -575 -999 -799 -708 -734 -261 -858 -203 -432 -271 -223 -171 -254 -451 -467 -428 -304 -66 -842 -993 -200 -940 -567 -684 -705 -468 -926 -654 -463 -827 -162 -440 -771 -702 -30 -486 -994 -134 -382 -243 -616 -561 -587 -647 -577 -872 -452 -869 -279 -519 -124 -33 -704 -517 -294 -231 -140 -936 -446 -886 -449 -146 -104 -34 -763 -422 -804 -403 -939 -739 -511 -195 -531 -973 -810 -782 -389 -212 -284 -176 -383 -611 -316 -733 -150 -572 -320 -620 -519 -167 -105 -247 -917 -837 -272 -763 -383 -128 -208 -996 -294 -352 -717 -103 -77 -219 -933 -906 -304 -606 -123 -152 -580 -167 -490 -914 -879 -29 -826 -215 -162 -728 -471 -453 -379 -677 -251 -494 -385 -473 -849 -256 -994 -611 -335 -202 -255 -64 -505 -957 -393 -594 -525 -794 -428 -562 -618 -46 -463 -332 -918 -692 -473 -899 -524 -385 -508 -346 -588 -66 -225 -951 -139 -761 -241 -490 -153 -984 -242 -768 -830 -441 -101 -410 -506 -415 -949 -280 -517 -358 -520 -854 -746 -148 -888 -854 -905 -324 -601 -381 -264 -750 -638 -107 -552 -42 -719 -646 -339 -503 -250 -199 -227 -480 -66 -447 -778 -31 -96 -439 -381 -314 -70 -863 -115 -782 -380 -769 -196 -658 -138 -686 -173 -712 -669 -473 -375 -916 -660 -301 -422 -357 -691 -838 -229 -488 -492 -838 -303 -772 -835 -510 -28 -626 -722 -999 -556 -609 -287 -520 -531 -117 -943 -158 -433 -98 -273 -230 -599 -250 -791 -742 -903 -891 -694 -190 -260 -258 -753 -349 -721 -677 -924 -761 -652 -32 -321 -748 -218 -758 -567 -238 -100 -241 -865 -860 -118 -758 -112 -170 -484 -376 -749 -657 -163 -67 -133 -578 -43 -538 -350 -832 -835 -862 -588 -914 -724 -574 -709 -980 -117 -739 -742 -929 -944 -318 -959 -677 -872 -783 -553 -571 -438 -320 -259 -217 -254 -42 -377 -528 -777 -607 -31 -836 -590 -736 -247 -838 -787 -733 -116 -810 -513 -916 -79 -114 -273 -539 -689 -684 -341 -972 -75 -331 -436 -854 -995 -608 -288 -244 -83 -138 -943 -744 -123 -859 -175 -754 -221 -650 -835 -235 -965 -228 -343 -646 -579 -94 -952 -464 -955 -334 -264 -299 -75 -387 -734 -46 -761 -484 -358 -836 -953 -779 -339 -189 -529 -593 -155 -805 -126 -573 -478 -680 -593 -615 -591 -115 -497 -127 -60 -693 -759 -462 -673 -466 -453 -594 -649 -194 -895 -355 -683 -697 -899 -982 -88 -723 -486 -788 -598 -458 -708 -254 -103 -503 -953 -59 -544 -153 -204 -728 -996 -309 -740 -43 -524 -367 -117 -705 -232 -510 -600 -205 -675 -277 -446 -193 -951 -250 -824 -737 -574 -751 -931 -876 -375 -176 -725 -761 -416 -963 -267 -900 -205 -750 -877 -504 -410 -782 -579 -275 -315 -137 -60 -522 -88 -899 -486 -384 -235 -550 -96 -475 -390 -339 -460 -519 -770 -380 -349 -526 -244 -588 -354 -558 -363 -352 -949 -234 -677 -474 -786 -181 -288 -767 -557 -455 -921 -71 -944 -590 -415 -391 -631 -20 -389 -337 -879 -319 -609 -465 -781 -730 -274 -439 -261 -713 -978 -509 -52 -658 -79 -441 -889 -170 -130 -147 -551 -341 -376 -492 -479 -371 -911 -538 -621 -817 -44 -181 -856 -560 -220 -37 -65 -279 -622 -773 -44 -439 -29 -406 -81 -424 -388 -810 -566 -313 -989 -201 -588 -560 -892 -460 -366 -77 -717 -403 -63 -694 -73 -249 -65 -604 -752 -858 -121 -73 -211 -944 -735 -480 -899 -834 -903 -251 -905 -882 -440 -969 -130 -936 -992 -138 -159 -135 -489 -123 -374 -867 -720 -526 -588 -429 -317 -199 -713 -416 -513 -651 -65 -968 -308 -135 -154 -568 -291 -474 -733 -542 -420 -631 -385 -225 -155 -137 -69 -205 -621 -187 -773 -277 -63 -86 -436 -342 -445 -525 -745 -930 -340 -452 -488 -731 -181 -641 -348 -462 -192 -150 -104 -288 -382 -622 -758 -923 -359 -379 -857 -792 -702 -804 -653 -852 -842 -233 -156 -841 -557 -365 -841 -780 -949 -327 -312 -103 -260 -545 -605 -275 -154 -692 -807 -598 -633 -946 -685 -77 -398 -943 -446 -352 -229 -30 -794 -405 -101 -47 -564 -158 -264 -743 -293 -569 -421 -987 -815 -822 -140 -501 -52 -153 -915 -180 -872 -978 -835 -227 -183 -351 -207 -792 -574 -322 -768 -312 -601 -960 -371 -605 -134 -279 -297 -32 -794 -780 -234 -771 -469 -934 -795 -872 -603 -978 -649 -797 -369 -927 -826 -603 -941 -505 -518 -162 -24 -789 -693 -36 -58 -94 -757 -765 -824 -557 -786 -598 -402 -270 -395 -287 -978 -375 -86 -407 -176 -924 -131 -262 -778 -901 -235 -933 -775 -948 -119 -839 -442 -768 -108 -701 -693 -829 -34 -172 -473 -441 -195 -365 -48 -631 -724 -432 -572 -896 -139 -765 -840 -629 -239 -662 -130 -61 -708 -142 -118 -116 -104 -398 -302 -698 -116 -302 -60 -637 -859 -404 -26 -624 -977 -788 -317 -178 -472 -358 -707 -229 -389 -482 -876 -748 -624 -697 -930 -246 -464 -420 -549 -94 -452 -403 -668 -677 -67 -412 -996 -377 -109 -821 -186 -94 -88 -152 -172 -648 -189 -195 -351 -437 -890 -590 -545 -712 -972 -625 -227 -186 -596 -285 -166 -487 -33 -517 -745 -613 -578 -478 -861 -464 -826 -45 -440 -955 -106 -556 -600 -633 -945 -955 -478 -407 -747 -778 -216 -177 -915 -968 -203 -172 -981 -789 -768 -669 -91 -464 -575 -505 -786 -855 -277 -26 -474 -562 -629 -10
2 changes: 2 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/data/matrix_5x5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
5 5 500
51 178 50 242 50 11 50 344 50 50 500 50 400 50 50 80 57 397 9 440 50 50 305 50 50
9 changes: 9 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"student": {
"first_name": "Светлана",
"last_name": "Пылаева",
"middle_name": "Алексеевна",
"group_number": "3823Б1ФИ3",
"task_number": "1"
}
}
22 changes: 22 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/mpi/include/ops_mpi.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include "pylaeva_s_max_elem_matrix/common/include/common.hpp"
#include "task/include/task.hpp"

namespace pylaeva_s_max_elem_matrix {

class PylaevaSMaxElemMatrixMPI : public BaseTask {
public:
static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() {
return ppc::task::TypeOfTask::kMPI;
}
explicit PylaevaSMaxElemMatrixMPI(const InType &in);

private:
bool ValidationImpl() override;
bool PreProcessingImpl() override;
bool RunImpl() override;
bool PostProcessingImpl() override;
};

} // namespace pylaeva_s_max_elem_matrix
86 changes: 86 additions & 0 deletions tasks/pylaeva_s_max_elem_matrix/mpi/src/ops_mpi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#include "pylaeva_s_max_elem_matrix/mpi/include/ops_mpi.hpp"

#include <mpi.h>

#include <algorithm> // для std::max
#include <cstddef> // для size_t
#include <limits> // для std::numeric_limits
#include <vector>

#include "pylaeva_s_max_elem_matrix/common/include/common.hpp"

namespace pylaeva_s_max_elem_matrix {

PylaevaSMaxElemMatrixMPI::PylaevaSMaxElemMatrixMPI(const InType &in) {
SetTypeOfTask(GetStaticTypeOfTask());
GetInput() = in;
GetOutput() = std::numeric_limits<int>::min();
}

bool PylaevaSMaxElemMatrixMPI::ValidationImpl() {
const auto rows = static_cast<size_t>(std::get<0>(GetInput()));
const auto columns = static_cast<size_t>(std::get<1>(GetInput()));
size_t matrix_size = rows * columns;

return (matrix_size == std::get<2>(GetInput()).size()) && (rows > 0) && (columns > 0);
}

bool PylaevaSMaxElemMatrixMPI::PreProcessingImpl() {
return true;
}

bool PylaevaSMaxElemMatrixMPI::RunImpl() {
int rank = 0;
int size = 0;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);

size_t matrix_size = 0;
std::vector<int> matrix_data;

if (rank == 0) {
const auto matrix_rows = static_cast<size_t>(std::get<0>(GetInput()));
const auto matrix_columns = static_cast<size_t>(std::get<1>(GetInput()));
matrix_size = matrix_rows * matrix_columns;
matrix_data = std::get<2>(GetInput());
}

MPI_Bcast(&matrix_size, 1, MPI_INT, 0, MPI_COMM_WORLD);

std::vector<int> sendcounts(size, 0);
std::vector<int> displs(size, 0);

int local_size = static_cast<int>(matrix_size / size);
int remainder = static_cast<int>(matrix_size % size);

int offset = 0;
for (int i = 0; i < size; i++) {
sendcounts[i] = local_size + (i < remainder ? 1 : 0);
displs[i] = offset;
offset += sendcounts[i];
}

int local_elements = sendcounts[rank];
std::vector<int> local_data(local_elements);

MPI_Scatterv(rank == 0 ? matrix_data.data() : nullptr, sendcounts.data(), displs.data(), MPI_INT, local_data.data(),
local_elements, MPI_INT, 0, MPI_COMM_WORLD);

int local_max = std::numeric_limits<int>::min();
for (int i = 0; i < local_elements; i++) {
local_max = std::max(local_max, local_data[i]);
}

int global_max = std::numeric_limits<int>::min();
MPI_Allreduce(&local_max, &global_max, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);

GetOutput() = global_max;

return true;
}

bool PylaevaSMaxElemMatrixMPI::PostProcessingImpl() {
return true;
}

} // namespace pylaeva_s_max_elem_matrix
Loading
Loading