|
3 | 3 |
|
4 | 4 | # Parallel Programming Course
|
5 | 5 |
|
6 |
| -The following parallel programming technologies are considered in practice: |
7 |
| - * `MPI` |
8 |
| - * `OpenMP` |
9 |
| - * `TBB` |
10 |
| - * `std::thread` |
11 |
| - |
12 |
| -## Rules for submissions |
| 6 | +### Parallel programming technologies: |
| 7 | + The following parallel programming technologies are considered in practice: |
| 8 | + * `Message Passing Interface (MPI)` |
| 9 | + * `OpenMP (Open Multi-Processing)` |
| 10 | + * `oneAPI Threading Building Blocks (oneTBB)` |
| 11 | + * `Multithreading in C++ (std::thread)` |
| 12 | + |
| 13 | +### Rules for submissions: |
13 | 14 | 1. You are not supposed to trigger CI jobs by frequent updates of your pull request. First you should test you work locally with all the scripts (code style).
|
14 | 15 | * Respect others time and don't slow down the job queue
|
15 | 16 | 2. Carefully check if the program can hang.
|
16 | 17 |
|
17 |
| -## 0. Download all submodules |
18 |
| - ``` |
19 |
| - git submodule update --init --recursive --depth=1 |
20 |
| - ``` |
21 |
| -## 1. Set up your environment |
22 |
| - |
23 |
| -### Code style analysis |
24 |
| -Please, follow [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html). |
25 |
| - |
26 |
| -Code style is checked using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) tool. |
27 |
| - |
28 |
| -### Parallel programming technologies |
29 |
| -### `MPI` |
30 |
| - * **Windows (MSVC)**: |
31 |
| - |
32 |
| - [Installers link.](https://www.microsoft.com/en-us/download/details.aspx?id=105289) You have to install `msmpisdk.msi` and `msmpisetup.exe`. |
33 |
| - |
34 |
| - * **Linux (`gcc` and `clang`)**: |
35 |
| - ``` |
36 |
| - sudo apt install -y mpich openmpi-bin libopenmpi-dev |
37 |
| - ``` |
38 |
| - * **MacOS (apple clang)**: |
39 |
| - ``` |
40 |
| - brew install open-mpi |
41 |
| - ``` |
42 |
| - |
43 |
| -### `OpenMP` |
44 |
| - |
45 |
| - `OpenMP` is included into `gcc` and `msvc`, but some components should be installed additionally: |
46 |
| - |
47 |
| - * **Linux (`gcc` and `clang`)**: |
48 |
| - ``` |
49 |
| - sudo apt install -y libomp-dev |
50 |
| - ``` |
51 |
| - * **MacOS (`llvm`)**: |
52 |
| - ``` |
53 |
| - brew install llvm |
54 |
| - brew install libomp |
55 |
| - ``` |
56 |
| - |
57 |
| -### `TBB` |
58 |
| - * **Windows (`MSVC`)**, **Linux (`gcc` and `clang`)**, **MacOS (apple clang)**: |
59 |
| - * Build as 3rdparty in the current project |
60 |
| - |
61 |
| -### `std::thread` |
62 |
| - * `std::thread` is included into STL libraries. |
63 |
| - |
64 |
| -## 2. Build the project with `CMake` |
65 |
| -Navigate to a source code folder. |
66 |
| - |
67 |
| -1. Configure the build: `Makefile`, `.sln`, etc. |
68 |
| - |
69 |
| - ``` |
70 |
| - mkdir build && cd build |
71 |
| - 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 .. |
72 |
| - ``` |
73 |
| -*Help on CMake keys:* |
74 |
| -- `-D USE_SEQ=ON` enable `Sequential` labs (based on OpenMP's CMakeLists.txt). |
75 |
| -- `-D USE_MPI=ON` enable `MPI` labs. |
76 |
| -- `-D USE_OMP=ON` enable `OpenMP` labs. |
77 |
| -- `-D USE_TBB=ON` enable `TBB` labs. |
78 |
| -- `-D USE_STL=ON` enable `std::thread` labs. |
79 |
| -- `-D USE_FUNC_TESTS=ON` enable functional tests. |
80 |
| -- `-D USE_PERF_TESTS=ON` enable performance tests. |
81 |
| -- `-D CMAKE_BUILD_TYPE=Release` required parameter for stable work of repo. |
82 |
| - |
83 |
| -*A corresponding flag can be omitted if it's not needed.* |
84 |
| - |
85 |
| -2. Build the project: |
86 |
| - ``` |
87 |
| - cmake --build . --config RELEASE |
88 |
| - ``` |
89 |
| -3. Check the task |
90 |
| - * Run `<project's folder>/build/bin` |
91 |
| - |
92 |
| -## 3. How to submit you work |
93 |
| -* There are `mpi`, `omp`, `seq`, `stl`, `tbb` folders in `tasks` directory. Move to a folder of your task. Make a directory named `<last name>_<first letter of name>_<short task name>`. 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`. |
94 |
| -* Go into the newly created folder and begin you work on the task. There must be only 4 directory with files: |
95 |
| - - `func_tests` - google tests directory with files for the functional tests of task. |
96 |
| - - `include` - a header files directory with function prototypes. |
97 |
| - - `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`. |
98 |
| - - `src` - a source files directory with functions realization. |
99 |
| -* We need to know that exist 10 executable files for running: |
100 |
| - - `<mpi, omp, seq, stl, tbb>_<func, perf>_tests` e.g. `omp_perf_tests` - executable file for performance tests of OpenMP practice tasks. |
101 |
| -* All prototypes and classes in the `include` directory must be namespace escaped, name your namespace in the following way: |
102 |
| - ``` |
103 |
| - namespace <last name>_<first letter of name>_<short task name>_<technology> { |
104 |
| - ... |
105 |
| - } |
106 |
| - e.g. |
107 |
| - namespace nesterov_a_test_task_seq { |
108 |
| - |
109 |
| - class TestTaskSequential : public ppc::core::Task { |
110 |
| - ... |
111 |
| - }; |
112 |
| -
|
113 |
| - } // namespace nesterov_a_test_task_seq |
114 |
| - ``` |
115 |
| -* Name your group of tests and current test in the following way: |
116 |
| - * for functional tests: |
117 |
| - ``` |
118 |
| - TEST(<last name>_<first letter of name>_<short task name>_<technology>, <any_name_of_test_case>) { |
119 |
| - ... |
120 |
| - } |
121 |
| - e.g. |
122 |
| - TEST(nesterov_a_vector_sum_omp, test_sum) { |
123 |
| - ... |
124 |
| - } |
125 |
| - ``` |
126 |
| - * for performance tests: |
127 |
| - ``` |
128 |
| - TEST(<last name>_<first letter of name>_<short task name>_<technology>, <type_of_performance_validation>) { |
129 |
| - ... |
130 |
| - } |
131 |
| - e.g. |
132 |
| - TEST(nesterov_a_vector_sum_stl, test_pipeline_run) { |
133 |
| - ... |
134 |
| - } |
135 |
| - TEST(nesterov_a_vector_sum_stl, test_task_run) { |
136 |
| - ... |
137 |
| - } |
138 |
| - ``` |
139 |
| -* All tests need to be written without `main()` function |
140 |
| -* Name your pull request in the following way: |
141 |
| - * for tasks: |
142 |
| - ``` |
143 |
| - <Last Name First Name>. Task <Number of task>. Variant <Number of variant>. <Full name of task>. |
144 |
| - Нестеров Александр. Задача 1. Вариант 123. Сумма элементов вектора. |
145 |
| - ``` |
146 |
| - |
147 |
| -* Provide the full task definition in pull request's description. |
148 |
| - |
149 |
| - Example pull request is located in repo's pull requests. |
150 |
| - |
151 |
| -* 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: |
152 |
| - ``` |
153 |
| - git checkout -b nesterov_a_vector_sum |
154 |
| - ``` |
155 |
| - |
156 |
| -*Failing to follow the rules makes the project build red.* |
157 |
| - |
158 |
| -And finally, |
| 18 | +### Steps to create a task: |
| 19 | +1. [Download all submodules](docs/download.md) |
| 20 | +2. [Set up your environment](docs/environment.md) |
| 21 | +3. [Build the project with `CMake`](docs/build.md) |
| 22 | +4. [How to submit your current work](docs/submit_work.md) |
0 commit comments