/integrals

Program for calculating integral of Ackley's function.

Primary LanguageC++

Integral

Ackley's function

image

Processing

Config file

Config file should have one attribute per line in such order, as they defined here (you can find example in config.txt):

0.05        # absolute error
0.001       # relative error
4   	    # number of threads
20          # a
0.2         # b
6.2831853   # c
-100        # x1
100         # x2
-100        # y1
100         # y2
100         # initial steps
100000      # max steps

Compilation

Creating new working directory:
mkdir build

Go to working directory:
cd build

Compiling cpp files:
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make

Running programs

Run consistent program:
./consistent <config_filename>

Run parallel program:
./parallel <config_filename>

If you do not provide <config_filename>, program will be looking for config.txt in local directory.

Running test program

Go to upper directory:
cd ..

Run test:
python3 test_and_compare.py <number_of_tests>

If you do not provide <number_of_tests>, program will will set number_of_tests = 10000.

Results

For such configuration:

0.05        # absolute error
0.001       # relative error
20          # a
0.2         # b
6.2831853   # c
-100        # x1
100         # x2
-100        # y1
100         # y2
100         # initial steps
100000      # max steps

Number of tests: 10000

Consistent: 2816 microseconds

Parallel:
               1 threads: 2912 microseconds
               2 threads: 702 microseconds
               3 threads: 64 microseconds
               4 threads: 68 microseconds
image
#2b6d36 consistent
#4b61a3 parallel



Parallel:
               10 threads: 7887 microseconds
               100 threads: 313 microseconds
               1000 threads: 3564 microseconds
               10000 threads: 36472 microseconds
image
#2b6d36 consistent
#4b61a3 parallel