diff --git a/.gitignore b/.gitignore index 031a8303d..6e473f43e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -build* +/build* out mpich cmake-build-* diff --git a/docs/build.md b/docs/build.md deleted file mode 100644 index 912ece4d5..000000000 --- a/docs/build.md +++ /dev/null @@ -1,28 +0,0 @@ -## Build the project with `CMake` - -Navigate to a source code folder. - -1. Configure the build: `Makefile`, `.sln`, etc. - - ```bash - mkdir build && cd build - cmake -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -D CMAKE_BUILD_TYPE=Release .. - ``` - *Help on CMake keys:* - - `-D USE_SEQ=ON` enable `Sequential` labs (based on OpenMP's CMakeLists.txt). - - `-D USE_MPI=ON` enable `MPI` labs. - - `-D USE_OMP=ON` enable `OpenMP` labs. - - `-D USE_TBB=ON` enable `TBB` labs. - - `-D USE_STL=ON` enable `std::thread` labs. - - `-D USE_FUNC_TESTS=ON` enable functional tests. - - `-D USE_PERF_TESTS=ON` enable performance tests. - - `-D CMAKE_BUILD_TYPE=Release` required parameter for stable work of repo. - - *A corresponding flag can be omitted if it's not needed.* - -2. Build the project: - ```bash - cmake --build . --config Release --parallel - ``` -3. Check the task -* Run `/build/bin` diff --git a/docs/build.rst b/docs/build.rst new file mode 100644 index 000000000..217e9af5c --- /dev/null +++ b/docs/build.rst @@ -0,0 +1,34 @@ +Build the Project with ``CMake`` +================================ + +Navigate to a source code folder. + +1. **Configure the build**: ``Makefile``, ``.sln``, etc. + + .. code-block:: bash + + mkdir build && cd build + cmake -D USE_SEQ=ON -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON -D USE_STL=ON -D USE_FUNC_TESTS=ON -D USE_PERF_TESTS=ON -D CMAKE_BUILD_TYPE=Release .. + + *Help on CMake keys:* + + - ``-D USE_SEQ=ON`` enable ``Sequential`` labs (based on OpenMP's CMakeLists.txt). + - ``-D USE_MPI=ON`` enable ``MPI`` labs. + - ``-D USE_OMP=ON`` enable ``OpenMP`` labs. + - ``-D USE_TBB=ON`` enable ``TBB`` labs. + - ``-D USE_STL=ON`` enable ``std::thread`` labs. + - ``-D USE_FUNC_TESTS=ON`` enable functional tests. + - ``-D USE_PERF_TESTS=ON`` enable performance tests. + - ``-D CMAKE_BUILD_TYPE=Release`` required parameter for stable work of repo. + + *A corresponding flag can be omitted if it's not needed.* + +2. **Build the project**: + + .. code-block:: bash + + cmake --build . --config Release --parallel + +3. **Check the task**: + + * Run ``/build/bin`` diff --git a/docs/download.md b/docs/download.md deleted file mode 100644 index ca41783d5..000000000 --- a/docs/download.md +++ /dev/null @@ -1,4 +0,0 @@ -## Download all submodules - ```bash - git submodule update --init --recursive --depth=1 - ``` diff --git a/docs/download.rst b/docs/download.rst new file mode 100644 index 000000000..c36b4cf39 --- /dev/null +++ b/docs/download.rst @@ -0,0 +1,6 @@ +Download all submodules +======================= + +.. code-block:: bash + + git submodule update --init --recursive --depth=1 diff --git a/docs/environment.md b/docs/environment.md deleted file mode 100644 index aff553cdb..000000000 --- a/docs/environment.md +++ /dev/null @@ -1,42 +0,0 @@ -## Set up your environment - -### Code style analysis -Please, follow [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html). - -Code style is checked using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) tool. - -### Parallel programming technologies -### `MPI` -* **Windows (MSVC)**: - -[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`)**: - ``` - sudo apt install -y mpich openmpi-bin libopenmpi-dev - ``` -* **MacOS (apple clang)**: - ``` - brew install open-mpi - ``` - -### `OpenMP` - -`OpenMP` is included into `gcc` and `msvc`, but some components should be installed additionally: - -* **Linux (`gcc` and `clang`)**: - ``` - sudo apt install -y libomp-dev - ``` -* **MacOS (`llvm`)**: - ``` - brew install llvm - brew install libomp - ``` - -### `TBB` -* **Windows (`MSVC`)**, **Linux (`gcc` and `clang`)**, **MacOS (apple clang)**: - * Build as 3rdparty in the current project - -### `std::thread` -* `std::thread` is included into STL libraries. diff --git a/docs/environment.rst b/docs/environment.rst new file mode 100644 index 000000000..b2dc6af97 --- /dev/null +++ b/docs/environment.rst @@ -0,0 +1,55 @@ +Set Up Your Environment +======================== + +Code Style Analysis +-------------------- +Please follow the `Google C++ Style Guide `_. + +Code style is checked using the `clang-format `_ tool. + +Parallel Programming Technologies +--------------------------------- + +``MPI`` +~~~~~~~ +- **Windows (MSVC)**: + + `Installers link `_. You have to install ``msmpisdk.msi`` and ``msmpisetup.exe``. + +- **Linux (gcc and clang)**: + + .. code-block:: bash + + sudo apt install -y mpich openmpi-bin libopenmpi-dev + +- **MacOS (apple clang)**: + + .. code-block:: bash + + brew install open-mpi + +``OpenMP`` +~~~~~~~~~~ +``OpenMP`` is included in ``gcc`` and ``msvc``, but some components should be installed additionally: + +- **Linux (gcc and clang)**: + + .. code-block:: bash + + sudo apt install -y libomp-dev + +- **MacOS (llvm)**: + + .. code-block:: bash + + brew install llvm + brew install libomp + +``TBB`` +~~~~~~~ +- **Windows (MSVC)**, **Linux (gcc and clang)**, **MacOS (apple clang)**: + Build as 3rdparty in the current project. + +``std::thread`` +~~~~~~~~~~~~~~~ +``std::thread`` is included in STL libraries. diff --git a/docs/submit_work.md b/docs/submit_work.md deleted file mode 100644 index a7033090e..000000000 --- a/docs/submit_work.md +++ /dev/null @@ -1,65 +0,0 @@ -## How to submit your work - -* There are `mpi`, `omp`, `seq`, `stl`, `tbb` folders in `tasks` directory. Move to a folder of your task. Make a directory named `__`. Example: `seq/nesterov_a_vector_sum`. Please name all tasks **same** name directory. If `seq` task named `seq/nesterov_a_vector_sum` then `omp` task need to be named `omp/nesterov_a_vector_sum`. -* Go into the newly created folder and begin you work on the task. There must be only 4 directory with files: - - `func_tests` - google tests directory with files for the functional tests of task. - - `include` - a header files directory with function prototypes. - - `perf_tests` - google tests directory with files for the performance tests of task. The number of tests must be 2 - `run_task` and `run_pipeline`. - - `src` - a source files directory with functions realization. -* We need to know that exist 10 executable files for running: - - `__tests` e.g. `omp_perf_tests` - executable file for performance tests of OpenMP practice tasks. -* All prototypes and classes in the `include` directory must be namespace escaped, name your namespace in the following way: - ``` - namespace ___ { - ... - } - e.g. - namespace nesterov_a_test_task_seq { - - class TestTaskSequential : public ppc::core::Task { - ... - }; - - } // namespace nesterov_a_test_task_seq - ``` -* Name your group of tests and current test in the following way: - * for functional tests (for maximum coverage): - ``` - TEST(___, ) { - ... - } - e.g. - TEST(nesterov_a_vector_sum_omp, test_sum) { - ... - } - ``` - * for performance tests (only 2 tests - `pipeline/task` - no more no less): - ``` - TEST(___, ) { - ... - } - e.g. - TEST(nesterov_a_vector_sum_stl, test_pipeline_run) { - ... - } - TEST(nesterov_a_vector_sum_stl, test_task_run) { - ... - } - ``` -* Name your pull request in the following way: - * for tasks: - ``` - . Task . Variant . Technology . . - Нестеров Александр. Задача 1. Вариант 123. Технология MPI. Сумма элементов вектора. - ``` - -* Provide the full task definition in pull request's description. - - Example pull request is located in repo's pull requests. - -* Work on your fork-repository. Keep your work on a separate branch and **NOT on `master`!!!**. Name you branch in the same way as your task's folder. To create a branch run: - ``` - git checkout -b nesterov_a_vector_sum_mpi - ``` - -*Failing to follow the rules makes the project build red.* diff --git a/docs/submit_work.rst b/docs/submit_work.rst new file mode 100644 index 000000000..155a162fc --- /dev/null +++ b/docs/submit_work.rst @@ -0,0 +1,83 @@ +How to submit your work +======================== + +- There are ``mpi``, ``omp``, ``seq``, ``stl``, ``tbb`` folders in the ``tasks`` directory. Move to a folder of your task. Create a directory named ``__``. + + Example: ``seq/nesterov_a_vector_sum``. Please name all tasks **with the same** name directory. If the ``seq`` task is named ``seq/nesterov_a_vector_sum``, then the ``omp`` task must be named ``omp/nesterov_a_vector_sum``. + +- Navigate into the newly created folder and begin your work on the task. The folder must contain only 4 directories with files: + + - ``func_tests`` - Directory with Google tests for functional testing of the task. + - ``include`` - Directory for header files with function prototypes. + - ``perf_tests`` - Directory with Google tests for performance testing. The number of tests must be 2: ``run_task`` and ``run_pipeline``. + - ``src`` - Directory with source files containing the function implementations. + +- There must be 10 executable files for running: + + - ``__tests``. For example, ``omp_perf_tests`` - an executable file for performance tests of OpenMP practice tasks. + +- All prototypes and classes in the ``include`` directory must be namespace-escaped. Name your namespace as follows: + + .. code-block:: cpp + + namespace ___ { + ... + } + e.g. + namespace nesterov_a_test_task_seq { + + class TestTaskSequential : public ppc::core::Task { + ... + }; + + } // namespace nesterov_a_test_task_seq + +- Name your group of tests and individual test cases as follows: + + - For functional tests (for maximum coverage): + + .. code-block:: cpp + + TEST(___, ) { + ... + } + e.g. + TEST(nesterov_a_vector_sum_omp, test_sum) { + ... + } + + - For performance tests (only 2 tests - ``pipeline`` and ``task`` - no more no less): + + .. code-block:: cpp + + TEST(___, ) { + ... + } + e.g. + TEST(nesterov_a_vector_sum_stl, test_pipeline_run) { + ... + } + TEST(nesterov_a_vector_sum_stl, test_task_run) { + ... + } + +- Name your pull request as follows: + + - For tasks: + + .. code-block:: + + . Task . Variant . Technology . . + Нестеров Александр. Задача 1. Вариант 123. Технология MPI. Сумма элементов вектора. + +- Provide the full task definition in the pull request's description. + + Example pull request can be found in the repository's pull requests. + +- Work on your forked repository. Keep your work on a separate branch (not on ``master``)!!! Name your branch the same as your task's folder. To create a branch, run: + + .. code-block:: bash + + git checkout -b nesterov_a_vector_sum_mpi + +**Failing to follow the rules will result in a red project build.**