Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

ipyparallel and pymoo doesn't work

未關閉
#848 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
python

研究方向

從使用 ipyparallel.Cluster、已連線的 DirectView,以及繼承自 pymoo 的 ElementwiseProblem 的 MyProblem 類別的簡化重現程式開始。使用所述相依性執行它,並檢查 dview["MyProblem"] = MyProblem 期間的失敗;完成的標準是找出遞迴原因,並記錄或修正傳輸此類別的支援方式。

由索引模型根據 Issue 內容生成。

描述

bug

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 ?

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.

主要語言
Jupyter Notebook
星號
2.6k
分支
1k
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ipython/ipyparallel 的其他 Issue

查看 ipython/ipyparallel 的全部 Issue

相似的 Issue

更多 Distributed Systems Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。