- 授权协议: MIT
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://github.com/binaryer/tinympi4j-master
- 软件文档: https://github.com/binaryer/tinympi4j-master/blob/master/README.md
软件介绍
tinympi4j 是一款微型的 java 分布式离线计算框架, 实现原理如图:
特性
简单直观, 没有任何学习难度
slave支持多个任务并发/并行执行
使用HTTP协议通信
场景: 找素数/grep/wordcount/超大文件或大量小文件处理
不支持复杂数据类型
没有进度监控,健康监控,无容错功能
例子: 用两台服务器分布式计算找出10000以内的素数
public static void main(String[] args) {
//启动master上的tomcat
final int masterport = 8086;
final String masterurl = "http://192.168.1.100:" + masterport;
TomcatTool.startMasterTomcat(masterport);
//创建任务
final BigTask<Integer> bigtask = BigTask.create(masterurl);
//添加任务到两台计算节点, 请确保计算节点上的 tinympi4j-slave 已启动
//关于计算节点: https://github.com/binaryer/tinympi4j-slave
bigtask.addTask2Slave("http://192.168.1.101:1234", PrimeSplitedtask.class, new Integer[] { 2, 5000 });
bigtask.addTask2Slave("http://192.168.1.102:1234", PrimeSplitedtask.class, new Integer[] { 5001, 10000 });
//等待所有节点执行完毕
final Collection<Integer> resultset = bigtask.executeAndWait();
//打印结果
for (int n : resultset){
//System.out.println(n);
}
}
High Performance Python
Micha Gorelick、Ian Ozsvald / O'Reilly Media / 2014-9-10 / USD 39.99
If you're an experienced Python programmer, High Performance Python will guide you through the various routes of code optimization. You'll learn how to use smarter algorithms and leverage peripheral t......一起来看看 《High Performance Python》 这本书的介绍吧!
