Can python use the matlab engine for batch job processing: matlab.eng​ine.Engine​Error: Transport stopped

11 ビュー (過去 30 日間)
暄 楊
暄 楊 2022 年 1 月 19 日
回答済み: Pratik 2024 年 12 月 19 日 6:00
I need to use matlab in python, so I used eng = matlab.engine.start_matlab(). The program needs to be implemented in the batch job system of the supercomputer, running multiple jobs at the same time, and the following errors will occasionally occur as a result of the operation
Traceback (most recent call last):
File "mainDSICE.py", line 497, in <module>
eng = matlab.engine.start_matlab()
File "/data/group1/z44167z/Python3.8.2/lib/python3.8/site-packages/matlab/engine/__init__.py", line 119, in start_matlab
eng = future.result()
File "/data/group1/z44167z/Python3.8.2/lib/python3.8/site-packages/matlab/engine/futureresult.py", line 67, in result
return self.__future.result(timeout)
File "/data/group1/z44167z/Python3.8.2/lib/python3.8/site-packages/matlab/engine/matlabfuture.py", line 87, in result
handle = pythonengine.getMATLAB(self._future)
matlab.engine.EngineError: Transport stopped.
From the results of the last run, this error occurred 2 times out of 60 jobs.
Can the matlab engine perform batch jobs, and what causes this problem? please help me.
  2 件のコメント
Juan Carlos Tarín Tomás
Juan Carlos Tarín Tomás 2022 年 2 月 17 日
I have the same problem. It doesn't happen all the time but every few jobs it happens, my solution has been to implement a try-except in python to save those cases. But it would be great if someone knows why this happens.

サインインしてコメントする。

回答 (1 件)

Pratik
Pratik 2024 年 12 月 19 日 6:00
Hi,
I had faced a similar issue. It might be a bug, as upgrading the MATLAB to latest version had solved this issue.
I hope this helps!

カテゴリ

Help Center および File ExchangePython Client Programming についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by