Skip to content

dasha-pn/thread_pool

Repository files navigation

Lab work 5: Threadpool

Authors (team): Kyrylo Omelianchuk, Daryna Shevchuk

Prerequisites

cmake\
GCC\
python 3.13.3

Prerequisites

Folly

facebook::folly must be installed. If you are on linux, it can be done in multiple steps.

First, clone the repository.

# Clone the repo
git clone https://github.com/facebook/folly
cd folly

Now check for necessary system dependencies and see if you already have them installed:

./build/fbcode_builder/getdeps.py install-system-deps --dry-run --recursive

The necessary packages can usually be installed with

sudo --preserve-env=http_proxy apt-get install -y autoconf automake binutils-dev cmake libaio-dev libboost-all-dev libclang-dev libdouble-conversion-dev libdwarf-dev libevent-dev libfast-float-dev libgflags-dev libgmock-dev libgtest-dev liblz4-dev libsnappy-dev libsodium-dev libtool libzstd-dev ninja-build zlib1g-dev zstd

Although I couldn't successfully build it without these additional dependencies:

sudo apt-get install libgoogle-glog-dev libfmt-dev

Now, the script we used earlier provides a command to build folly, but I couldn't get it to work no matter what I did. I was always getting errors. If you want to try, the command to build it using the script is:

./build/fbcode_builder/getdeps.py --allow-system-packages build

Building manually with CMake worked for me, though:

mkdir _build && cd _build
cmake ..

The library needs to be installed on the system now. If we're going the manual path, it can be done with

sudo make install

The script would do it like this:

./build/fbcode_builder/getdeps.py install

You should be ready to go now! If on windows, you can try to clone it the same way and then run the provided build.bat script, or use the vcpkg package manager with

vcpkg install folly:x64-windows
.\vcpkg integrate install

Compilation

dos2unix compile.sh
./compile.sh

for info:

./compile.sh -h

Installation

pip install -r requirements.txt

Usage

bin/integrate_parallel_queue <func_idx> <config_file> <threads> <points_per_task>

for the main task with thread safe queue

bin/integrate_parallel_queue_tasked <func_idx> <config_file> <threads> <points_per_task>

for the second additional task

bin/integrate_parallel_queue_nowait <func_idx> <config_file> <threads> <points_per_task>

for the third additional task

python3 scripts/autolaunch.py <repeats> <threads> <points_per_task>

for the autolaunch for the three funcs

python3 scripts/analysis.py

for the detailed analysis and plots with csv

python3 analysis.py --funcs 1 --out_dir analysis_func1
python3 analysis.py --funcs 2 --out_dir analysis_func2
python3 analysis.py --funcs 3 --out_dir analysis_func3

to run the tests for a queue

dmindaryna_shevchuk@DARYNA:/mnt/d/UCU/акс/lab4-queue-integral-shevchuk_omelianchuk$ python3 scripts/test_integral_queue.py queue
Using existing build directory: tests-build
Building project: /mnt/d/UCU/акс/lab4-queue-integral-shevchuk_omelianchuk
Running tests
=============================
Testing the format of output
Format tests passed
=============================
Testing the correctness of results
Correctness tests passed
All tests passed

Results

DESCRIBE THE RESULTS OF THE WORK YOU DID. WHAT DID YOU LEARN OR FIND INTERESTING?

Additional tasks

IF APPLICABLE, LIST ALL THE EXTRA FEATURES YOU ADDED. PROVIDE DETAILS

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors