Skip to content

Commit

Permalink
Merge branch 'learning-process:master' into khasanyanov_k_average_vector
Browse files Browse the repository at this point in the history
  • Loading branch information
khasanyanovk authored Oct 27, 2024
2 parents 19e56bb + 1685a7e commit 916b201
Show file tree
Hide file tree
Showing 70 changed files with 6,295 additions and 14 deletions.
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 916b201

Please sign in to comment.