Giter VIP home page Giter VIP logo

thierry-dumont / benchmarkspythonjuliaandco Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 7.0 4.31 MB

Benchmark(s) of numerical programs with Python (and Scipy, Pythran, Numba), Julia and C++.

License: MIT License

C++ 41.13% C 1.33% CMake 3.43% Julia 17.04% Python 26.67% Shell 2.50% Jupyter Notebook 2.58% Fortran 2.17% Cuda 3.15%
python pythran numba julia-language cpp benchmark numerical-benchmarks numerical-methods

benchmarkspythonjuliaandco's Introduction

Numerical benchmarks for Julia, Python.

We try to avoid trivial and nonsense benchmarks (for people doing numerics!) like fibonacci, sorting and so on.

We put ourself in the shoes of a typical Matlab or Matlab-like programmer, writing quite short but numerically intensive programs.

Are Python and Julia easy to use and efficient? We compare them with a C++ optimized implementation (and sometimes with a Fortran one)..

The benchmark(s):

  • ๐Ÿ†• Callback: callbacks of small and not so small functions.

  • Gaussian: Gaussian elimination with partial pivoting.

  • FeStiff: compute the stiffness matrix, for the Poisson equation, discretized with P2 finite elements on triangles.

  • Weno: a classical solver for hyperbolic equations, in dimension 1, with application to Burghers equation and to Convection.

  • Sparse: building a sparse matrix and doing a sparse matrix x vector product.

  • MicroBenchmarks: very simple benchmarks to show the importance of different programing styles.

We will add other numerical significative benchmarks in the (near) future.

Dependencies:

What you need to install:

  • python3
  • pip (pip3)
  • g++ (and/or clang++)
  • gfortran
  • lapack
  • openblas
  • cmake
  • gnuplot

You can install them using your distribution tool (apt...).

  • julia

โ— Julia โ— since 2018-10-08 programs need at least version Version 1.1 (stable version in 2018-10); note that all programs needed adaptation when moving to this version, and will not run with former ones.

Note also that the version packaged with Ubuntu 18-04 is older. Install the stable version from here. Note also that Julia is evolving, and it is possible that the codes need some adaptation to run with later versions of the language.

You also need:

  • pythran
  • scipy
  • Numpy
  • numba

to install them, you can just do:

pip install pythran

and so on...

You can also install them from conda.

Note that, for Pythran it seems necessary to create a .pythranrc file in the home directory, to describe which blas is used:

[compiler]
blas=openblas

How to run the Benchmarks ?

-1: First solution: Enter the directories CallBack/, FeStiff/, Gaussian/, MicroBenchmarks/, Sparse/ or Weno/. Then read the README.md, which explains how to run the (local) benchmark.

-2: Second solution: In each of these directories, you will find a script: runAllTests.sh . This script will run the benchmark, for every language (and variant).

The first solution is certainly the safest.

Results:

Have a look at the wiki, where you can find results obtained on my personal computer, as well as some considerations on the different benchmarks and on optimizations implemented.

benchmarkspythonjuliaandco's People

Contributors

bfabreges avatar rolanddenis avatar thierry-dumont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.