omp-thread-count
A small utility to get the actual number of threads used by OpenMP via Cython bindings.
A small utility to get the actual number of threads used by OpenMP via Cython bindings.
To install this package, run one of the following:
=====================
.. image:: https://img.shields.io/pypi/v/omp-thread-count.svg :target: https://pypi.python.org/pypi/omp-thread-count
.. image:: https://img.shields.io/travis/rolando/omp-thread-count.svg :target: https://travis-ci.org/rolando/omp-thread-count
.. image:: https://readthedocs.org/projects/omp-thread-count/badge/?version=latest :target: https://readthedocs.org/projects/omp-thread-count/?badge=latest :alt: Documentation Status
A small Python module to get the actual number of threads used by OMP via Cython bindings.
Because GCC/Cython always returned 1 when calling openmp.get_thread_num or openmp.get_max_threads.
To install run::
pip install omp-thread-count
In OSX, and possibly other platforms, you may need to specify a compiler with OpenMP support, like this::
CC=gcc-4.8 pip install omp-thread-count
Importing from python code:
.. code:: python
import ompthreadcount
nthreads = ompthreadcount.getthread_count()
Importing from cython code:
.. code:: python
from ompthreadcount.omp cimport getthread_count
Use omp_thread_count.get_includes() in your extensions' include_dirs to
use the header files.
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage: https://github.com/audreyr/cookiecutter-pypackage
=======
Summary
A small utility to get the actual number of threads used by OpenMP via Cython bindings.
Last Updated
Feb 8, 2017 at 01:26
License
MIT
Total Downloads
85