The following parallel programming technologies are considered in practice:
MPI
OpenMP
TBB
- 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)
- Respect others time and don't slow down the job queue
- Carefully check if the program can hang
git submodule update --init --recursive
- Windows (MSVC):
Installers link. You have to install
msmpisdk.msi
andmsmpisetup.exe
. - Linux (
gcc
andclang
):
sudo apt install mpich
sudo apt install openmpi-bin
sudo apt install libopenmpi-dev
- MacOS (apple clang):
brew install open-mpi
OpenMP
is included into gcc
and msvc
, but some components should be installed additionally:
- Linux (
gcc
andclang
):
sudo apt install libomp-dev
- MacOS (apple clang): The system is completely unstable thus you are not recommended to use it with
OpenMP
!
brew install libomp
- Windows (
MSVC
):CMake
installsTBB
while you runcmake
for that project on Windows. - Linux (
gcc
andclang
):
sudo apt-get install libtbb-dev
- MacOS (apple clang):
brew install tbb
Navigate to a source code folder.
- Configure the build:
Makefile
,.sln
, etc.
mkdir build && cd build
cmake -D USE_MPI=ON -D USE_OMP=ON -D USE_TBB=ON ..
Help on CMake keys:
-D USE_MPI=ON
enbaleMPI
labs.-D USE_OMP=ON
enableOpenMP
labs.-D USE_TBB=ON
enableTBB
labs.
A corresponding flag can be omitted if it's not needed.
- Build the project:
cmake --build . --config RELEASE
- Run
<project's folder>/build/bin
-
There are
task_1
,task_2
,task_3
folders inmodules
directory. There are 3 task for the semester. Move to a folder of your task. Make a directory named<last name>_<first letter of name>_<short task name>
. Example:task1/nesterov_a_vector_sum
. -
Go into the newly created folder and begin you work on the task. There must be only 4 files and 3 of them must be written by you:
main.cpp
- google tests for the task. The number of tests must be 4 or greater.vector_sum.h
- a header file with function prototypes, name it in the same way as<short task name>
.vector_sum.cpp
- the task implementation, name it in the same way as<short task name>
.CMakeLists.txt
- a file to configure your project. Examples for each configuration can be found intest_tasks
.
-
Name your pull request in the following way:
<Фамилия Имя>. Задача <Номер задачи>. <Полное название задачи>. Нестеров Александр. Задача 1. Сумма элементов вектора.
-
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
-
Place
<last name>_<first letter of name>_<short task name>.pdf
containing the report in thereports
folder.nesterov_a_vector_sum.pdf
-
Pull request's name for the report looks in the following way:
<Фамилия Имя>. Отчет. <Полное название задачи>. Нестеров Александр. Отчет. Сумма элементов вектора.
Please, follow Google C++ Style Guide. Code style can be verified with the script (it runs with Python 2):
cd <source project root>
python2 scripts/lint.py
Failing to follow the rules makes the project build red.