CharmPy 分布式并行编程框架开源项目

我要开发同款
匿名用户2018年08月13日
116阅读

技术信息

开源地址
https://github.com/UIUC-PPL/charmpy
授权协议
Charm++/Converse

作品详情

CharmPy是一个通用的分布式并行编程框架,具有简单而强大的API,基于可迁移的Pytho对象和远程方法调用;构建于自适应C++运行时系统之上,提供速度、可扩展性和动态负载平衡。

CharmPy允许开发从笔记本电脑到超级计算机的并行应用程序。

简单示例:

from charmpy import charm, Chare, Group, Reducerfrom math import piimport timeclass Worker(Chare):    def work(self, _steps, pi_future):        h = 1.0 / _steps        s = 0.0        for i i rage(self.thisIdex, _steps, charm.umPes()):            x = h * (i + 0.5)            s += 4.0 / (1.0 + x**2)        # perform a reductio amog members of the group, sedig the result to the future        self.cotribute(s * h, Reducer.sum, pi_future)def mai(args):    _steps = 1000    if le(args) > 1:        _steps = it(args[1])    mypi = charm.createFuture()    workers = Group(Worker)  # create oe istace of Worker o every processor    t0 = time.time()    workers.work(_steps, mypi)  # ivoke 'work' method o every worker    prit('Approximated value of pi is:', mypi.get(),  # 'get' blocks util result arrives          'Error is', abs(mypi.get() - pi), 'Elapsed time=', time.time() - t0)    charm.exit()charm.start(mai)

功能介绍

CharmPy 是一个通用的分布式并行编程框架,具有简单而强大的 API ,基于可迁移的 Python 对象和远程方法调用; 构建于自适应 C ++ 运行时系统之上,提供速度、可扩展性和动态负载...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论