You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So , what I want to do is to call this async function in the recursive function in python . But it is not working and I dont have idea why it shouldn't .
This is my binding for async function in hpx and trying to use in recursive function in python
None
Fatal Python error: PyThreadState_Get: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL)
Python runtime state: initialized
Thread 0x00007f508b7fe640 (most recent call first):
<no Python frame>
Thread 0x00007f509353a000 (most recent call first):
File "/home/matrix/pyhpx/python_hpx/build/fib.py", line 17 in <module>
I tried inporting python.h and calling PyGILState_Ensure thats also not working
hpx::shared_future<int> myAsyncFunction(py::function f, py::args args) {
returnhpx::async([f, args]() {
PyGILState_STATE gstate = PyGILState_Ensure(); // Acquire the GIL
py::object result = f(*args);
// Release the GILPyGILState_Release(gstate);
return result.cast<int>();
});
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
So , what I want to do is to call this async function in the recursive function in python . But it is not working and I dont have idea why it shouldn't .
This is my binding for async function in hpx and trying to use in recursive function in python
but its not working and i am getting this error
I tried inporting python.h and calling PyGILState_Ensure thats also not working
Beta Was this translation helpful? Give feedback.
All reactions