ipython / ipython/ipyparallel

ipyparallel and pymoo doesn't work

オープン
#848 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Jupyter Notebook
スター
2.6k
フォーク
1k
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello all,
I am trying to use ipyparallel with a module for Genetic Algorithm (pymoo) and for that, I need to pass the class name 'MyProblem' to the clusters (don't know really why clusters are not aware but I have also the same problem with function defined in the main program). When I pass the name using 'dview["MyProblem"] = MyProblem' I am facing a recursing error.

This is the simplified code below which reproduce the error. Do you have any idea ?

```python
import numpy as np
import ipyparallel as ipp
from pymoo.algorithms.moo.nsga2 import NSGA2
from pymoo.core.problem import ElementwiseProblem
from pymoo.optimize import minimize

# Very simplified problem
class MyProblem(ElementwiseProblem):

def __init__(self):
super().__init__(n_var = 1,
n_obj = 1,
n_constr = 0,
xl=np.array([0]),
xu=np.array([1]))

def _evaluate(self, x, out, *args, **kwargs):

# Fitness functions (values to minimize)
f1 = -x[0]
out["F"] = [f1]

# Start the clusters
nb_core = 16
rc = ipp.Cluster(n=nb_core).start_and_connect_sync()
rc.wait_for_engines(n=nb_core)
dview = rc[:]

# Send class def to all cluster for further use
dview["MyProblem"] = MyProblem
```

Thanks in advance for your help.
Patrick.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the simplified reproducer using ipyparallel.Cluster, the connected DirectView, and the MyProblem class inherited from pymoo's ElementwiseProblem. Run it with the stated dependencies and inspect the failure during dview["MyProblem"] = MyProblem; done means identifying the recursion cause and documenting or correcting the supported way to transfer this class.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
distributed-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。