GCC Code Coverage Report


Directory: ./
File: tasks/luchnikov_e_gener_transm_from_all_to_one_gather/seq/src/ops_seq.cpp
Date: 2026-01-27 01:59:34
Exec Total Coverage
Lines: 18 19 94.7%
Functions: 5 5 100.0%
Branches: 11 18 61.1%

Line Branch Exec Source
1 #include "luchnikov_e_gener_transm_from_all_to_one_gather/seq/include/ops_seq.hpp"
2
3 #include <mpi.h>
4
5 #include <cstddef>
6 #include <vector>
7
8 #include "luchnikov_e_gener_transm_from_all_to_one_gather/common/include/common.hpp"
9
10 namespace luchnikov_e_gener_transm_from_all_to_one_gather {
11
12 namespace {
13 size_t GetTypeSizeSeq(MPI_Datatype datatype) {
14 6 if (datatype == MPI_INT) {
15 return sizeof(int);
16 }
17
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
4 if (datatype == MPI_FLOAT) {
18 return sizeof(float);
19 }
20
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (datatype == MPI_DOUBLE) {
21 return sizeof(double);
22 }
23 return 0;
24 }
25 } // namespace
26
27
1/2
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
6 LuchnikovETransmFrAllToOneGatherSEQ::LuchnikovETransmFrAllToOneGatherSEQ(const InType &in) {
28 SetTypeOfTask(GetStaticTypeOfTask());
29 GetInput() = in;
30 6 }
31
32
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 bool LuchnikovETransmFrAllToOneGatherSEQ::ValidationImpl() {
33 const auto &input = GetInput();
34
35
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 if (input.data.empty()) {
36 return false;
37 }
38
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 if (input.count <= 0) {
39 return false;
40 }
41
42
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 if (input.root < 0) {
43 return false;
44 }
45
46
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 2 times.
6 size_t type_size = GetTypeSizeSeq(input.datatype);
47
48 if (type_size == 0) {
49 return false;
50 }
51
52
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
6 if (input.data.size() != static_cast<size_t>(input.count) * type_size) {
53 return false;
54 }
55
56 return true;
57 }
58
59 6 bool LuchnikovETransmFrAllToOneGatherSEQ::PreProcessingImpl() {
60 6 return true;
61 }
62
63 6 bool LuchnikovETransmFrAllToOneGatherSEQ::RunImpl() {
64 const auto &input = GetInput();
65
66 6 GetOutput() = input.data;
67
68 6 return true;
69 }
70
71 6 bool LuchnikovETransmFrAllToOneGatherSEQ::PostProcessingImpl() {
72 6 return true;
73 }
74
75 } // namespace luchnikov_e_gener_transm_from_all_to_one_gather
76