Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 2.03 KB

intro.md

File metadata and controls

39 lines (31 loc) · 2.03 KB

Benchmarks

Several tests are available for the user to benchmark Pyccel against other common accelerators, notably pythran and numba. The same code is used for all tests, only the decorators change.

The dependencies can be installed using the command python3 -m pip install .

The code can be executed by running the script benchmarks/run_benchmarks.py.

In order to test pyccel and/or pythran, configuration files must be provided. An example configuration for pythran is found in benchmarks/config.pythranrc. This configuration is the default pythran configuration with the following additional flags:

  • -O3
  • -march=native
  • -mtune=native
  • -mavx
  • -ffast-math Pyccel configurations valid for your machine can be generated using the following command (which may be adapted for c generation or other compiler languages, see the pyccel documentation):
pyccel --language=fortran --export-compile-info pyccel_fortran.json

This configuration can then be modified to include additional flags or use different compilers. The tests shown below add the following additional flags (which match the flags added to pythran):

  • -O3
  • -march=native
  • -mtune=native
  • -mavx
  • -ffast-math

Additional options can be used with this script to add further comparisons, change the output format, or change what is generated.

Run python3 benchmarks/run_benchmarks.py --help for more details.

The results below are presented for the current state of the development branch of pyccel, as well as the most recent version of pyccel available on pypi.

A requirements.txt file providing the necessary packages to reproduce the tests run can be found in the version_specific_results folder. The environment can be reproduced using the following commands:

python3 -m venv my_virtual_environment
source my_virtual_environment/bin/activate
pip3 install -r requirements.txt