Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
(1)我可以让集群对象跨机器全局,以便一旦提交作业,该作业又可以提交其他不同的较小作业?
cluster = dispy.JobCluster(compute)
(2) 每次我调用提交时,“计算”功能可以不同吗?
(1) 我相信您需要查看SharedCluster我不熟悉的对象。
SharedCluster
compute(2) 您可以使用语句在函数内部创建不同的“函数” if,并将选择参数传递给compute:
compute
if
def compute(param): if param == 'a': 'Do something' if param == 'b': 'Do something else' cluster = dispy.JobCluster(compute) for i in params: cluster.submit(i)