1/10 We need to be careful about the environmental impact of scientific computing. What about the massive use of #Python?
@numpy_team #SciPy @matplotlib @IPythonDev @ProjectJupyter @scikit_learn #skimage @astropy @numba_jit @pypyproject
@numpy_team #SciPy @matplotlib @IPythonDev @ProjectJupyter @scikit_learn #skimage @astropy @numba_jit @pypyproject
2/10 We (S. Guelton, @cfbolz, @ashwinvis & I) investigate this question in a short note just published in @NatureAstronomy https://rdcu.be/ciO0J
The">https://rdcu.be/ciO0J&quo... title is "Reducing the ecological impact of computing through education and Python compilers".
The">https://rdcu.be/ciO0J&quo... title is "Reducing the ecological impact of computing through education and Python compilers".
3/10 We consider a classical problem representative of numerically intensive scientific computations, the N-body problem, with N=16,384. #AstropyPerformance
The computation of the acceleration of each particle involves a loop over all other particles.
The computation of the acceleration of each particle involves a loop over all other particles.
4/10 We MEASURE both time for solution and energy consumption for ≠ implementations in ≠ languages (C++, Fortran, Julia & Python) on a https://www.grid5000.fr"> https://www.grid5000.fr cluster.
The code is here https://github.com/paugier/nbabel ">https://github.com/paugier/n...
The code is here https://github.com/paugier/nbabel ">https://github.com/paugier/n...
5/10 The C++ and Fortran implementations come from https://www.nbabel.org/ ">https://www.nbabel.org/">... and have been used in another letter (Zwart, 2020, https://arxiv.org/pdf/2009.11295.pdf).
These">https://arxiv.org/pdf/2009.... programs could have been further optimized, but are representative of code written by many scientists.
These">https://arxiv.org/pdf/2009.... programs could have been further optimized, but are representative of code written by many scientists.
6/10 We also considered efficient @JuliaLanguage and #Python implementations.
For Python, we used tools adapted for such problems: Python/Numpy compilers (Pythran via Transonic and Numba @numba_jit) and an efficient Python interpreter called PyPy @pypyproject.
For Python, we used tools adapted for such problems: Python/Numpy compilers (Pythran via Transonic and Numba @numba_jit) and an efficient Python interpreter called PyPy @pypyproject.
7/10 Our figure shows the CO₂ production as a function of time to solution. For details, see https://rdcu.be/ciO0J .">https://rdcu.be/ciO0J&quo...
The results are clear: (i) dynamic languages give very good results. (ii) It& #39;s easy to write in Python very efficient and ecologically friendly programs.
The results are clear: (i) dynamic languages give very good results. (ii) It& #39;s easy to write in Python very efficient and ecologically friendly programs.
8/10 This is great news for accessibility of efficient computing and productivity of developers of scientific programs. It is also important in terms of global impact of computing given the large amount of people learning and using Python.
9/10 Our conclusions in few words: minimizing the ecological impact of scientific computing is mainly limited by human factors: time, work, knowledge and skills. Time and money should be invested in education and tooling, irrespective of the underlying language.
10/10 The Nature link: https://www.nature.com/articles/s41550-021-01342-y
The">https://www.nature.com/articles/... letter can be read online here: https://rdcu.be/ciO0J ">https://rdcu.be/ciO0J&quo...
The">https://www.nature.com/articles/... letter can be read online here: https://rdcu.be/ciO0J ">https://rdcu.be/ciO0J&quo...