Problem using parallel computing in Python

3 ビュー (過去 30 日間)
Ints
Ints 2020 年 2 月 26 日
編集済み: Ints 2020 年 2 月 26 日
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 件)

カテゴリ

Help Center および File ExchangePython Package Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by