本文整理汇总了Python中ipyparallel.Client.sync_imports方法的典型用法代码示例。如果您正苦于以下问题:Python Client.sync_imports方法的具体用法?Python Client.sync_imports怎么用?Python Client.sync_imports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipyparallel.Client
的用法示例。
在下文中一共展示了Client.sync_imports方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Client
# 需要导入模块: from ipyparallel import Client [as 别名]
# 或者: from ipyparallel.Client import sync_imports [as 别名]
from ipyparallel import Client
dview = Client()[:]
with dview.sync_imports():
import predictive_rl.rlglueexp.seqexp
@dview.parallel(block=False)
def _run(args):
"""
It's assumed that this will be called as _run.map(args)
"""
import predictive_rl.rlglueexp.seqexp
print("heeeee")
seqexp = predictive_rl.rlglueexp.seqexp.SequentialExperiment()
print("lllll")
import sys
sys.stderr.write(str(args) + "\n")
rlglue_port, agent_args, exp_args, agent, env_file = args
# rlglue_port, agent_args, exp_args = (1,2,3)
print("ooooo")
res = seqexp.run(rlglue_port, agent_args, exp_args, agent, env_file)
return rlglue_port
def run(args):
return _run.map(args)
def main():
# parser = argparse.ArgumentParser(description="Run parallel experiments using ipython as defined in a config file.")