The following parallel programming technologies are considered in practice:
MPIOpenMPTBBstd::thread
- 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 --depth=1 Please, follow Google C++ Style Guide.
Code style is checked using clang-format tool.
- Windows (MSVC):
Installers link. You have to install msmpisdk.msi and msmpisetup.exe.
- Linux (
gccandclang):
sudo apt install -y mpich openmpi-bin libopenmpi-dev - MacOS (apple clang):
brew install open-mpi OpenMP is included into gcc and msvc, but some components should be installed additionally:
- Linux (
gccandclang):
sudo apt install -y libomp-dev - MacOS (
llvm):
brew install llvm brew install libomp - Windows (
MSVC), Linux (gccandclang), MacOS (apple clang):- Build as 3rdparty in the current project
std::threadis included into STL libraries.
Navigate to a source code folder.
- Configure the build:
Makefile,.sln, etc.
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=ONenableSequentiallabs (based on OpenMP's CMakeLists.txt).-D USE_MPI=ONenableMPIlabs.-D USE_OMP=ONenableOpenMPlabs.-D USE_TBB=ONenableTBBlabs.-D USE_STL=ONenablestd::threadlabs.-D USE_FUNC_TESTS=ONenable functional tests.-D USE_PERF_TESTS=ONenable performance tests.-D CMAKE_BUILD_TYPE=Releaserequired parameter for stable work of repo.
A corresponding flag can be omitted if it's not needed.
- Build the project:
cmake --build . --config RELEASE - Check the task
- Run
<project's folder>/build/bin
-
There are
mpi,omp,seq,stl,tbbfolders intasksdirectory. 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. Ifseqtask namedseq/nesterov_a_vector_sumthenomptask need to be namedomp/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_taskandrun_pipeline.src- a source files directory with functions realization.
-
We need to know that exist 10 executable files for running:
<mpi, omp, seq, stl, tbb>_<func, perf>_testse.g.omp_perf_tests- executable file for performance tests of OpenMP practice tasks.
-
All prototypes and classes in the
includedirectory must be namespace escaped, name your namespace in the following way:namespace <last name>_<first letter of name>_<short task name>_<technology> { ... } e.g. namespace nesterov_a_test_task_seq { std::vector<int> getRandomVector(int sz); 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:
TEST(<last name>_<first letter of name>_<short task name>_<technology>, <any_name_of_test_case>) { ... } e.g. TEST(nesterov_a_vector_sum_omp, test_sum) { ... }- for performance tests:
TEST(<last name>_<first letter of name>_<short task name>_<technology>, <type_of_performance_validation>) { ... } e.g. TEST(nesterov_a_vector_sum_stl, test_pipeline_run) { ... } TEST(nesterov_a_vector_sum_stl, test_task_run) { ... } -
All tests need to be written without
main()function -
Name your pull request in the following way:
- for tasks:
<Last Name First Name>. Task <Number of task>. Variant <Number of variant>. <Full name of task>. Нестеров Александр. Задача 1. Вариант 123. Сумма элементов вектора. -
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
Failing to follow the rules makes the project build red.
And finally,