Packages and definitions loaded in the regular kernel are not known by engines and vice versa

未关闭
#897 12 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
jupyter, jupyter-notebook, python

调研方向

首先使用 %%px 和常规 kernel 重现五单元格示例,然后检查 %%px 和 %autopx 的文档化行为。该 issue 没有指定实现文件或测试;要完成这项工作,需要一种达成共识的方法,使定义和导入能够在两个执行上下文之间可用,而不要求全局 %autopx。

由索引模型根据 Issue 内容生成。

描述

question

Importing modules or defining functions in regular cells (without the %%px magic) are not known in cells where the %%px macro is used.

The same is true for the other way around.

To reproduce this try

# Cell 1
import ipyparallel as ipp
from mpi4py import MPI

# Cell 2
cluster = ipp.Cluster(engines="mpi", n=4)
clients = cluster.start_and_connect_sync()

# Cell 3
%%px
import sys

def abc():
    print('abc')

# Cell 4
import os
def cde():
    print('cde')

# Cell 5:
%%px
os.getpid()
cde()

# Cell 6:
sys.getsizeof(0.0)
abc()

Cell 5 and Cell 6 will fail on both statements in each.

A global %autopx would ensure that everything runs on the engines, which makes development kind of inconvenient (e.g. prints are done on all engines and so on).
Defining different views and activating them according to how many engines are needed, e.g. one for development with a single engine, seems overkill.

What is the recommended approach to solve the outlined problem?

主要语言
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 摘要。