Skip to content

Commit

Permalink
Merge branch 'learning-process:master' into lopatin_i_count_words
Browse files Browse the repository at this point in the history
  • Loading branch information
ascannel authored Oct 27, 2024
2 parents a2e3b5f + 1685a7e commit f4179bf
Show file tree
Hide file tree
Showing 72 changed files with 6,312 additions and 18 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ jobs:
sudo apt-get install mpich libmpich* mpi* openmpi-bin
sudo apt-get install libomp-dev
sudo apt-get install valgrind
sudo apt-get install gcovr
sudo apt-get install gcovr lcov
- name: CMake configure
run: >
cmake -S . -B build
Expand All @@ -265,13 +265,24 @@ jobs:
run: |
export OMP_NUM_THREADS=4
source scripts/run.sh
- name: Generate Coverage Data
- name: Generate gcovr Coverage Data
run: |
cd build
gcovr -r ../ --xml --output ../coverage.xml
cat ../coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: 01474879-5a86-4c59-bd1d-6e29d3ed9550
files: coverage.xml
- name: Generate lcov Coverage Data
run: |
cd build
lcov --capture --directory . --output-file ../coverage.info
lcov --remove ../coverage.info '*/3rdparty/*' '/usr/*' '*/perf_tests/*' '*/func_tests/*' --output-file ../coverage.info
cd ..
genhtml coverage.info --output-directory cov-report
- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
with:
name: cov-report
path: 'cov-report'
4 changes: 3 additions & 1 deletion .github/workflows/static-analysis-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ jobs:
split_workflow: true
lgtm_comment_body: ""
- if: steps.review.outputs.total_comments > 0
run: exit 1
run: |
echo "clang-tidy run has failed. See previous 'Run clang-tidy' stage logs"
exit 1
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ The following parallel programming technologies are considered in practice:

Unsupported operating system!

* **Linux (`gcc` and `clang`)**:
* **Ubuntu / Debian (`gcc` and `clang`)**:
```
sudo apt install -y cppcheck
```

* **NixOS / Nix (with flakes enabled)**:
```
nix develop .
```

* **MacOS (apple clang)**:
```
brew install cppcheck
Expand All @@ -44,10 +50,16 @@ Code style is checked using [clang-format](https://clang.llvm.org/docs/ClangForm

[Installers link.](https://www.microsoft.com/en-us/download/details.aspx?id=105289) You have to install `msmpisdk.msi` and `msmpisetup.exe`.

* **Linux (`gcc` and `clang`)**:
* **Ubuntu / Debian (`gcc` and `clang`)**:
```
sudo apt install -y mpich openmpi-bin libopenmpi-dev
```

* **NixOS / Nix (with flakes enabled)**:
```
nix develop .
```

* **MacOS (apple clang)**:
```
brew install open-mpi
Expand All @@ -57,10 +69,16 @@ Code style is checked using [clang-format](https://clang.llvm.org/docs/ClangForm

`OpenMP` is included into `gcc` and `msvc`, but some components should be installed additionally:

* **Linux (`gcc` and `clang`)**:
* **Ubuntu / Debian (`gcc` and `clang`)**:
```
sudo apt install -y libomp-dev
```

* **NixOS / Nix (with flakes enabled)**:
```
nix develop .
```

* **MacOS (`llvm`)**:
```
brew install llvm
Expand Down
1 change: 1 addition & 0 deletions cmake/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ExternalProject_Add(ppc_boost
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBOOST_INCLUDE_LIBRARIES=mpi -DBOOST_ENABLE_MPI=ON
-D MPI_INCLUDE_PATH=${MPI_INCLUDE_PATH} -D MPI_LIBRARIES=${MPI_LIBRARIES} -D MPI_COMPILE_FLAGS=${MPI_COMPILE_FLAGS} -D MPI_LINK_FLAGS=${MPI_LINK_FLAGS}
-DCMAKE_INSTALL_LIBDIR=lib
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_boost/build" --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_boost/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_boost/install"
TEST_COMMAND "")
4 changes: 2 additions & 2 deletions cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ MACRO(CPPCHECK_TEST ProjectId ALL_SOURCE_FILES)
endif ()
endforeach ()
if (NOT APPLE)
find_program(CPPCHECK_EXEC /usr/bin/cppcheck)
find_program(CPPCHECK_EXEC cppcheck)
add_custom_target(
"${ProjectId}_cppcheck" ALL
COMMAND ${CPPCHECK_EXEC}
Expand All @@ -74,5 +74,5 @@ MACRO(CPPCHECK_TEST ProjectId ALL_SOURCE_FILES)
${ALL_SOURCE_FILES}
)
ENDIF ()
endif( UNIX )
endif( UNIX AND USE_CPPCHECK)
ENDMACRO()
1 change: 1 addition & 0 deletions cmake/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ ExternalProject_Add(ppc_googletest
CONFIGURE_COMMAND "${CMAKE_COMMAND}" -S "${CMAKE_SOURCE_DIR}/3rdparty/googletest/" -B "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/build/"
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-Dgtest_force_shared_crt=ON
-DCMAKE_INSTALL_LIBDIR=lib
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/build" --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/install")
1 change: 1 addition & 0 deletions cmake/onetbb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ else(MSVC)
INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/install"
CONFIGURE_COMMAND "${CMAKE_COMMAND}" -S "${CMAKE_SOURCE_DIR}/3rdparty/onetbb/" -B "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build/"
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -G${CMAKE_GENERATOR} -DTBB_TEST=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_LIBDIR=lib
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build" --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/install")
endif(MSVC)
96 changes: 96 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs = {
self,
nixpkgs,
flake-utils,
treefmt-nix,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
py3 = pkgs.python3.withPackages (ps: [ps.xlsxwriter]);
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
gcc
ninja
cmake
openmpi
py3
cppcheck
];
};
formatter =
(treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs.alejandra.enable = true;
})
.config
.build
.wrapper;
});
}
1 change: 0 additions & 1 deletion modules/core/perf/include/perf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct PerfResults {
double time_sec = 0.0;
enum TypeOfRunning { PIPELINE, TASK_RUN, NONE } type_of_running = NONE;
constexpr const static double MAX_TIME = 10.0;
constexpr const static double MIN_TIME = 0.05;
};

class Perf {
Expand Down
6 changes: 3 additions & 3 deletions modules/core/perf/src/perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ void ppc::core::Perf::print_perf_statistic(const std::shared_ptr<PerfResults>& p
relative_path.erase(last_found_position, relative_path.length() - 1);

std::stringstream perf_res_str;
if (time_secs > PerfResults::MIN_TIME && time_secs < PerfResults::MAX_TIME) {
if (time_secs < PerfResults::MAX_TIME) {
perf_res_str << std::fixed << std::setprecision(10) << time_secs;
} else {
std::cerr << "Task execute time need to be: ";
std::cerr << PerfResults::MIN_TIME << " secs. < time < " << PerfResults::MAX_TIME << " secs." << std::endl;
std::cerr << " time < " << PerfResults::MAX_TIME << " secs." << std::endl;
std::cerr << "Original time in secs: " << time_secs;
perf_res_str << std::fixed << std::setprecision(10) << -1.0;
EXPECT_TRUE(time_secs > PerfResults::MIN_TIME && time_secs < PerfResults::MAX_TIME);
EXPECT_TRUE(time_secs < PerfResults::MAX_TIME);
}

std::cout << relative_path << ":" << type_test_name << ":" << perf_res_str.str() << std::endl;
Expand Down
Loading

0 comments on commit f4179bf

Please sign in to comment.