Commit a3737a9e authored by Adel Kara Slimane's avatar Adel Kara Slimane
Browse files

Update INSTALL.rst

parent 1d3a6fe9
Pipeline #38508 passed with stages
in 5 minutes and 50 seconds
......@@ -95,12 +95,14 @@ Running scripts
~~~~~~~~~~~~~~~
You should now be able to use kwant, tkwant and tkwantoperator in the command line in
that virtual environment (if a virtual environment has been used). For example one can run the example
from the tutorial ``quantum_dot.py`` in the ``doc/source/tutorial`` folder:
that virtual environment (if a virtual environment has been used). For example one can run the example script ``quantum_dot.py``
from :ref:`tutorial` :
.. code:: shell
python3 doc/source/tutorial/quantum_dot.py
$ wget https://gitlab.kwant-project.org/kwant/tkwantoperator/-/raw/master/doc/source/tutorial/quantum_dot.py
$ python3 quantum_dot.py
.. _parallel-calculations:
......@@ -113,7 +115,7 @@ with the following command:
.. code:: shell
$ mpirun -n 4 python3 doc/examples/quantum_dot.py
$ mpirun -n 4 quantum_dot.py
Note that in the above command, ``mpirun`` will always use the **first**
four cores of the CPU: if a second script is run in parallel using the same
......@@ -123,7 +125,7 @@ is to use ``mpirun`` with ``--bind-to none`` option:
.. code:: shell
$ mpirun -n 4 --bind-to none python3 doc/examples/quantum_dot.py
$ mpirun -n 4 --bind-to none python3 quantum_dot.py
The ``-bind-to none`` option is there to not force the OS to use specific
cores to run the 4 copies. This option comes with a caveat: for CPUs with
......@@ -139,16 +141,16 @@ is enabled or not) on which to run the script
.. code:: shell
$ mpirun -n 5 --cpu-set 0-4 --bind-to core python3 doc/examples/quantum_dot.py
$ mpirun -n 5 --cpu-set 0-4 --bind-to core python3 quantum_dot.py
Where threads 0,1,2,3,4 will be used for the calculations, the same
command can be written:
.. code:: shell
$ mpirun -n 5 --cpu-set 0,1,2,3,4 --bind-to core python3 doc/examples/quantum_dot.py
$ mpirun -n 5 --cpu-set 0,1,2,3,4 --bind-to core python3 quantum_dot.py
To run two scripts, both on several cores, the best is to manually chose different cores for each script
To run two scripts on the same machine, both on several cores, the best is to manually chose different cores for each script
through the ``--cpu-set`` option.
**N.B.:** If the used computer has 20 cores, 40 threads (when `SMT <https://en.wikipedia.org/wiki/Simultaneous_multithreading>`_
......@@ -173,13 +175,13 @@ The older commit history of the energy operators code can be found here: https:/
Documentation
~~~~~~~~~~~~~
To build locally the documentation of ``tkwantoperator``, few additional (on top of the ones needed in :ref:`install`) python packages are required, please note that these packages should be installed in the same virtual environment as ``tkwantoperator``, if one is used (so they can find the module ``tkwantoperator``):
To build locally the documentation of ``tkwantoperator``, few additional (on top of the ones needed in :ref:`install`) python packages are required:
.. code:: shell
$ pip3 install sphinx jupyter-sphinx setuptools_scm sphinx_autodoc_typehints
$ pip3 install setuptools_scm sphinx jupyter-sphinx sphinx_autodoc_typehints
Latex is also needed to display pretty legends and axis titles in the generated matplotlib plots:
Latex is also needed to display the generated legends and axis titles in ``matplotlib`` plots:
* Ubuntu
......@@ -206,9 +208,20 @@ The generated HTML documentation will then be found in the ``doc/build/html`` fo
Testing
~~~~~~~
Tests can be run directly in the local tkwantoperator source repository from the command line:
If one made changes to the code of the energy operators and would like to know if the already present tests still pass successfully,
one can use a specific virtual environment with the required packages, without ``tkwantoperator`` installed in it:
.. code:: shell
$ virtualenv --system-site-packages tkwantoperator-dev
$ source tkwantoperator-dev/bin/activate
$ pip3 install --upgrade pytest setuptools_scm git+https://gitlab.kwant-project.org/kwant/tkwant.git
Then do an in-place compilation of the modified ``tkwantoperator`` source code to be finally able to run ``pytest``:
.. code:: shell
$ cd path/to/tkwantoperaotor
$ cd path/to/tkwantoperator-source-folder
$ python3 setup.py build
$ python3 setup.py build_ext -i
$ pytest tkwantoperator
\ No newline at end of file
.. _tutorial:
Tutorial: Energy and heat transport
===================================
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment