Skip to content

Commit 6ccc717

Browse files
committed
Merge branch 'master' of https://github.com/learning-process/parallel_programming_course into an/convert_scripts
2 parents fc96658 + c42d1ab commit 6ccc717

File tree

8 files changed

+32
-24
lines changed

8 files changed

+32
-24
lines changed

.clang-tidy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Checks: >
22
bugprone-*,
33
clang-diagnostic-*,
4+
cppcoreguidelines-init-variables,
45
llvm-include-order,
56
llvm-namespace-comment,
67
misc-*,
@@ -11,15 +12,13 @@ Checks: >
1112
-bugprone-casting-through-void,
1213
-bugprone-exception-escape,
1314
-bugprone-implicit-widening-of-multiplication-result,
14-
-bugprone-narrowing-conversions,
1515
-misc-const-correctness,
1616
-misc-header-include-cycle,
1717
-misc-no-recursion,
1818
-misc-non-private-member-variables-in-classes,
1919
-misc-unused-parameters,
2020
-modernize-avoid-c-arrays,
2121
-modernize-loop-convert,
22-
-modernize-use-nodiscard,
2322
-modernize-use-trailing-return-type,
2423
-readability-identifier-length,
2524
-readability-magic-numbers,

modules/ref/max_of_vector_elements/include/ref_task.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class MaxOfVectorElements : public ppc::core::Task {
2727
}
2828

2929
bool ValidationImpl() override {
30-
bool is_count_values_correct;
31-
bool is_count_indexes_correct;
30+
bool is_count_values_correct = false;
31+
bool is_count_indexes_correct = false;
3232
// Check count elements of output
3333
is_count_values_correct = task_data->outputs_count[0] == 1;
3434
is_count_indexes_correct = task_data->outputs_count[1] == 1;

modules/ref/min_of_vector_elements/include/ref_task.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class MinOfVectorElements : public ppc::core::Task {
2727
}
2828

2929
bool ValidationImpl() override {
30-
bool is_count_values_correct;
31-
bool is_count_indexes_correct;
30+
bool is_count_values_correct = false;
31+
bool is_count_indexes_correct = false;
3232
// Check count elements of output
3333
is_count_values_correct = task_data->outputs_count[0] == 1;
3434
is_count_indexes_correct = task_data->outputs_count[1] == 1;

modules/ref/most_different_neighbor_elements/func_tests/ref_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEST(most_different_neighbor_elements, check_int32_t) {
1414
std::vector<int32_t> out(2, 0);
1515
std::vector<uint64_t> out_index(2, 0);
1616
for (size_t i = 0; i < in.size(); i++) {
17-
in[i] = 2 * i;
17+
in[i] = static_cast<int32_t>(2 * i);
1818
}
1919
in[234] = 0;
2020
in[235] = 4000;
@@ -68,7 +68,7 @@ TEST(most_different_neighbor_elements, check_double) {
6868
std::vector<double> out(2, 0);
6969
std::vector<uint64_t> out_index(2, 0);
7070
for (size_t i = 0; i < in.size(); i++) {
71-
in[i] = i;
71+
in[i] = static_cast<double>(i);
7272
}
7373
in[189] = -1000.1;
7474
in[190] = 9000.9;
@@ -177,7 +177,7 @@ TEST(most_different_neighbor_elements, check_float) {
177177
std::vector<float> out(2, 0.F);
178178
std::vector<uint64_t> out_index(2, 0);
179179
for (size_t i = 0; i < in.size(); i++) {
180-
in[i] += (i + 1.F) * 2.5F;
180+
in[i] += (static_cast<float>(i) + 1.F) * 2.5F;
181181
}
182182
in[0] = 110.001F;
183183
in[1] = -990.0025F;

modules/ref/nearest_neighbor_elements/func_tests/ref_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEST(nearest_neighbor_elements, check_int32_t) {
1414
std::vector<int32_t> out(2, 0);
1515
std::vector<uint64_t> out_index(2, 0);
1616
for (size_t i = 0; i < in.size(); i++) {
17-
in[i] = 2 * i;
17+
in[i] = static_cast<int32_t>(2 * i);
1818
}
1919
in[234] = 0;
2020
in[235] = 1;
@@ -68,7 +68,7 @@ TEST(nearest_neighbor_elements, check_double) {
6868
std::vector<double> out(2, 0);
6969
std::vector<uint64_t> out_index(2, 0);
7070
for (size_t i = 0; i < in.size(); i++) {
71-
in[i] = 2 * i;
71+
in[i] = static_cast<double>(2 * i);
7272
}
7373
in[189] = 0.1;
7474
in[190] = 0.9;
@@ -177,7 +177,7 @@ TEST(nearest_neighbor_elements, check_float) {
177177
std::vector<float> out(2, 0.F);
178178
std::vector<uint64_t> out_index(2, 0);
179179
for (size_t i = 0; i < in.size(); i++) {
180-
in[i] += (i + 1.F) * 2.5F;
180+
in[i] += static_cast<float>(i + 1) * 2.5F;
181181
}
182182
in[0] = 0.001F;
183183
in[1] = 0.0025F;

modules/ref/sum_values_by_rows_matrix/func_tests/ref_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ TEST(sum_values_by_rows_matrix, check_int64_t) {
140140
std::vector<uint64_t> in_index = {37, 38};
141141
std::vector<int64_t> out(37, 0);
142142
for (size_t i = 0; i < in.size(); ++i) {
143-
in[i] = (i % 38) + 1;
143+
in[i] = static_cast<int64_t>((i % 38) + 1);
144144
}
145145

146146
// Create task_data

modules/ref/vector_dot_product/func_tests/ref_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ TEST(vector_dot_product, check_int32_t) {
1515
std::vector<int32_t> in2(count_data, 1);
1616
std::vector<int32_t> out(1, 0);
1717
for (size_t i = 0; i < count_data; i++) {
18-
in1[i] = i + 1;
19-
in2[i] = i + 1;
18+
in1[i] = static_cast<int32_t>(i + 1);
19+
in2[i] = static_cast<int32_t>(i + 1);
2020
}
2121

2222
// Create task_data
@@ -140,8 +140,8 @@ TEST(vector_dot_product, check_int64_t) {
140140
std::vector<int64_t> in2(count_data, 1);
141141
std::vector<int64_t> out(1, 0);
142142
for (uint64_t i = 0; i < count_data; i++) {
143-
in1[i] = i + 1;
144-
in2[i] = (i + 1) * (i + 1);
143+
in1[i] = static_cast<int64_t>(i + 1);
144+
in2[i] = static_cast<int64_t>((i + 1) * (i + 1));
145145
}
146146

147147
// Create task_data

scoreboard/main.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
print(directories)
2121

22-
columns = ''.join(['<th colspan=4 style="text-align: center;">' + task_type + '</th>' for task_type in task_types])
22+
columns = ''.join(['<th colspan=5 style="text-align: center;">' + task_type + '</th>' for task_type in task_types])
2323
html_content = f"""
2424
<!DOCTYPE html>
2525
<html>
@@ -29,22 +29,30 @@
2929
</head>
3030
<body>
3131
<h1>Scoreboard</h1>
32-
<p>S - Solution, P - Performance, O - Overdue, C - Cheating</p>
32+
<p>
33+
<b>(S)olution</b> - The correctness and completeness of the implemented solution.<br/>
34+
<b>(A)cceleration</b> - The process of speeding up software to improve performance.
35+
Speedup = T(seq) / T(parallel)<br/>
36+
<b>(E)fficiency</b> - Optimizing software speed-up by improving CPU utilization and resource management.
37+
Efficiency = Speedup / NumProcs * 100%<br/>
38+
<b>(D)eadline</b> - The timeliness of the submission in relation to the given deadline.<br/>
39+
<b>(P)lagiarism</b> - The originality of the work, ensuring no copied content from external sources.<br/>
40+
</p>
3341
<table>
3442
<tr>
35-
<th colspan=4>Tasks</th>
43+
<th colspan=5>Tasks</th>
3644
{columns}
3745
<th>Total</th>
3846
</tr>
3947
<tr>
40-
<th colspan=4></th>
41-
{''.join(['<th>S</th><th>P</th><th>O</th><th>C</th>' for _ in range(len(task_types))])}
48+
<th colspan=5></th>
49+
{''.join(['<th>S</th><th>A</th><th>E</th><th>D</th><th>P</th>' for _ in range(len(task_types))])}
4250
<th></th>
4351
</tr>
4452
"""
4553

4654
for dir in directories:
47-
html_content += f"<tr><td colspan=4>{dir}</td>"
55+
html_content += f"<tr><td colspan=5>{dir}</td>"
4856
total_count = 0
4957
for task_type in task_types:
5058
if directories[dir].get(task_type) == "done":
@@ -54,7 +62,8 @@
5462
html_content += '<td style="text-align: center;background-color: lightblue;">1</td>'
5563
total_count += 1
5664
else:
57-
html_content += "<td>0</td>"
65+
html_content += '<td style="text-align: center;">0</td>'
66+
html_content += '<td style="text-align: center;">0</td>'
5867
html_content += '<td style="text-align: center;">0</td>'
5968
html_content += '<td style="text-align: center;">0</td>'
6069
html_content += '<td style="text-align: center;">0</td>'

0 commit comments

Comments
 (0)