Skip to content

Commit

Permalink
Added Documentation for Parallel execution with Numba and OpenMP (#1481)
Browse files Browse the repository at this point in the history
* removed openmp requirements from the installation docs

* added section for parallel execution

* added parallelisation section to toctree

* added ref to parallelisation section in using formal integral section

* empty commit

* made suggested changes
  • Loading branch information
aribalam authored Mar 19, 2021
1 parent cf8900f commit 47ed0ce
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 26 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Mission Statement
using/components/index
using/visualization/index
using/interaction/index
using/parallelisation/index


.. toctree::
Expand Down
25 changes: 0 additions & 25 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,6 @@ then install TARDIS, as follows::
python setup.py install


.. _install_openmp:

Enabling parallel execution with OpenMP
---------------------------------------


Manually, cloning the repository enables other options such as running the code in parallel (enabling OpenMP).
In general, we encourage downloading the compilers from `conda` as we then can ensure that they work with TARDIS.
Within the TARDIS conda environment do::

conda install -c conda-forge compilers

For macOS::

conda install -c conda-forge llvm-openmp

For Linux::

conda install -c conda-forge openmp

To compile TARDIS for parallel execution::

python setup.py install --with-openmp


.. _troubleshooting_inst_label:

Installation Troubles (FAQ)
Expand Down
4 changes: 3 additions & 1 deletion docs/using/interaction/using_formal_integral.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ Note that the integrated spectrum (``simulation.runner.spectrum_integrated``)
is a lazy property so it will be only generated (and then cached) once it is
accessed. The spectrum integration routine is Open-MP parallelized, so this
process may be significantly sped-up if TARDIS is built with the
``--with-openmp`` option and more then one thread is used.
``--with-openmp`` option and more then one thread is used. More instructions on
how to enable parallelisation of the code is given in the :ref:`parallelisation`
section.
36 changes: 36 additions & 0 deletions docs/using/parallelisation/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _parallelisation:

*****************************************
Parallel execution with Numba and OpenMP
*****************************************

Enabling parallel execution with OpenMP
========================================

Manually, cloning the repository enables other options such as running the code in parallel (enabling OpenMP).
In general, we encourage downloading the compilers from `conda` as we then can ensure that they work with TARDIS.
Within the TARDIS conda environment do::

conda install -c conda-forge compilers

For macOS::

conda install -c conda-forge llvm-openmp

For Linux::

conda install -c conda-forge openmp

To compile TARDIS for parallel execution::

python setup.py install --with-openmp



Numba Usage Guide
===========

The ``montecarlo`` section of the Configuration file accepts the parameter ``nthreads`` which sets the number of
threads to be used for parallelisation. Setting the value of the parameter between 1 and the environment variable
``NUMBA_NUM_THREADS`` (which is, by default, the number of CPU cores on your system) will automatically invoke Numba
to parallelise the code. (See :ref:`config-file` section).

0 comments on commit 47ed0ce

Please sign in to comment.