GCC Code Coverage Report


Directory: ./
File: tasks/nikolaev_d_gather/seq/src/ops_seq.cpp
Date: 2026-01-10 02:40:41
Exec Total Coverage
Lines: 18 19 94.7%
Functions: 5 5 100.0%
Branches: 11 18 61.1%

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