Problem using parallel computing in Python
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello!
I have to prepare a Docker container with MCR and several Python packages (e.g. P1 and P2) compiled with SDK.
Both need parallel computing in functions (e.g. F1 and F2).
In Python, I import, initialize, run a function from the first one, then terminate.
Then I import the second one and when running a function from it, parallel pool is not started.
OS: Ubuntu 18.04, MATLAB 2019b
'local' profile used in both packages, selected in Preferences, local.mlsettings added to files of the packages.
Python (3.6.9) code:
import P1
h1=P1.initialize()
res1=h1.F1('params')
# runs with parpool displaying "Starting parallel pool..", "Connected ..", "..shutting down"
h1.terminate()
import P2
h2=P2.initialize()
res2=h2.F2('params')
# runs without parpool- messages not displayed
h2.terminate()
Is it possible to use parallel computing in this way or I have to compile all functions to one package (that is undesirable)?
Thanks, Ints
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Python Package Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!