bastibe / transplant

Transplant is an easy way of calling Matlab from Python
https://transplant.readthedocs.io
Other
110 stars 26 forks source link

Transplant hangs #94

Open bareil76-code opened 3 years ago

bareil76-code commented 3 years ago

I have a long running loop in python calling a Matlab codes that takes 2-3 minutes to execute. After about 20 of those loops, the whole thing just hangs. Matlab is not runing as CPU is 0%. It seems like zmq is waiting for a message that is never received.. any idea?

bastibe commented 3 years ago

If Matlab is idling, it probably crashed out of the Transplant loop. Regrettably, some Matlab errors can't be caught in a try-catch, and don't trigger onCleanup. It's a crying shame. If that happens, there's nothing you can do about it.

You can try instrumenting your 2-3 minute function and see if it crashes before reaching the end.

bareil76-code commented 3 years ago

It seems that it locks when getting out of the function _msg = decodevalues(msg); in the transplant_remote.m.

I have place a disp(msg) outside this function and when Matlab locks, the display does not show anything.

How can I debug the Matlab file using transplant? I would like to pause matlab to check the problem.

bastibe commented 3 years ago

How can I debug the Matlab file using transplant? I would like to pause matlab to check the problem.

Interactive debugging is not possible. But you can just print intermediary values, or debug from a live Matlab session.