这是一个使用Python3.6编写的简单的分布式矩阵计算的测试程序,支持分布式矩阵乘法与分布式矩阵求逆。整个项目使用Docker封装,容易批量配置。矩阵乘法使用分块乘法实现分布式,矩阵求逆使用分块消元算法实现分布式,仅仅实现功能,在网络传输、性能与并行度上依旧有所不足。
multiprocessing
实现分布式的任务分配flask
实现Web控制界面h5py
实现结果HDF5格式存储
已发布到Docker Hub:https://hub.docker.com/r/wnjxyk/simple_distributed_matrix ,可以在这个网址拉取镜像并且测试。
This is a really big change.
- 首先从镜像仓库拉取本镜像。
docker pull wnjxyk/simple_distributed_matrix
- 从镜像新建了若干容器,例如如下代码:创建5个容器,分别映射端口号为8080、8081~8084。这里8080作为主控节点,8081~8084作为分布式计算节点。
docker run -d -it -p 8080:80 matrix python /root/Distributed_Matrix_Method/Distributed.py
docker run -d -it -p 8081:80 --cpus=0.01 matrix python /root/Distributed_Matrix_Method/Distributed.py
docker run -d -it -p 8082:80 --cpus=0.01 matrix python /root/Distributed_Matrix_Method/Distributed.py
docker run -d -it -p 8083:80 --cpus=0.01 matrix python /root/Distributed_Matrix_Method/Distributed.py
docker run -d -it -p 8084:80 --cpus=0.01 matrix python /root/Distributed_Matrix_Method/Distributed.py