Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the progress of the execution #3268

Closed
rtmlp opened this issue Aug 27, 2018 · 3 comments
Closed

How to get the progress of the execution #3268

rtmlp opened this issue Aug 27, 2018 · 3 comments

Comments

@rtmlp
Copy link

rtmlp commented Aug 27, 2018

Hi,

I am using numba on a method which has lot of independent for loops with in a loop. How to find the progress of the execution i.e to see until which point has the code been executed. I used to use python print method but since that is not available in nopython=True mode, is there any other way to monitor the progress of the code

Thanks

@synapticarbors
Copy link
Contributor

While this is probably more appropriate for the mailing list than the issue tracker, I just wanted to note that you can use the print() function in nopython mode (http://numba.pydata.org/numba-doc/latest/reference/pysupported.html#built-in-functions). If you are using python2, you need to add from __future__ import print_function to the top of your file, and then you can use print -- for example:

@nb.jit(nopython=True)
def func(N):
    for i in range(N):
        print('loop #: ', i)

@rtmlp
Copy link
Author

rtmlp commented Aug 27, 2018

Thanks @synapticarbors . I tried to use print method but using f-strings in python. I used the original method and it works fine now. So I am closing this thread. Thanks for the help.

@rtmlp rtmlp closed this as completed Aug 27, 2018
@seibert
Copy link
Contributor

seibert commented Aug 27, 2018

As a general note, #3166 will move Numba toward support for temporarily leaving nopython mode to run a block of arbitrary Python code. This will allow a wider range of callback options, like calling progress bar libraries or notebook widget updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants