On Fri, Feb 20, 2015 at 11:04 AM, Stefan Behnel <
stef...@behnel.de> wrote:
> Stefan Behnel schrieb am 20.02.2015 um 18:15:
>> it should be possible to make nogil code traceable by acquiring the GIL on
>> each code line (which will certainly result in a massive slowdown, but at
>> least for coverage analysis, speed is secondary at best). I'll try to give
>> it a separate C compiler option so that it can be enabled only at need.
>
> I think I got it working. Please give it a try.
>
>
https://github.com/cython/cython/commit/3b6ec99c082d603161e9322846283d6138b951bc
>
> To use it, you need to set the C compiler macros
>
> -D CYTHON_TRACE=1
> -D CYTHON_TRACE_NOGIL=1
Thanks very much for this - that will make the coverage much more
useful for us (we spent a long time no-gilling our code, as you can
imagine).
Running on current master (1d926e8), with those flags applied, I get a
large number of errors like:
======================================================================
ERROR: dipy.denoise.tests.test_nlmeans.test_nlmeans_padding
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/mb312/.virtualenvs/test/lib/python2.7/site-packages/nose/case.py",
line 197, in runTest
self.test(*self.arg)
File "/Users/mb312/dev_trees/dipy/dipy/denoise/tests/test_nlmeans.py",
line 14, in test_nlmeans_padding
S0n = add_padding_reflection(S0, 5)
File "dipy/denoise/denspeed.pyx", line 201, in
dipy.denoise.denspeed.add_padding_reflection
(dipy/denoise/denspeed.c:3781)
cnp.npy_intp [::1] indices_i = correspond_indices(arr.shape[0], padding)
File "dipy/denoise/denspeed.pyx", line 216, in
dipy.denoise.denspeed.correspond_indices
(dipy/denoise/denspeed.c:4294)
return np.ascontiguousarray(np.hstack((np.arange(1, padding + 1)[::-1],
AttributeError: 'bool' object has no attribute 'trace'
This is on our 'dipy' project. I know this is very much not a minimal
example, but just in case you want to replicate:
git clone git://
github.com/matthew-brett/dipy.git
cd dipy
git checkout -t origin/cython-coverage
pip install -r requirements.txt
export DIPY_LINETRACE=1
python setup.py build_ext -i
nosetests --with-coverage --cover-package=dipy dipy
Thanks again,
Matthew