MPI—聚集函数MPI_Gather()
来源:互联网 发布:算法电子书 编辑:程序博客网 时间:2024/04/28 17:43
// MPI1.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "mpi.h"#include <stdlib.h>int main(int argc, char * argv[]){MPI_Comm comm=MPI_COMM_WORLD;int rank,size,i,num[100];MPI_Init(&argc,&argv);MPI_Comm_rank(comm,&rank);MPI_Comm_size(comm,&size);MPI_Gather(&rank,1,MPI_INT,num,1,MPI_INT,0,comm);/* 进程0从通信域中的所有进程收集数据并存储在数组num中 */if(rank==0){printf("Process 0 gather from other Process:\n");for(i=0;i<size;i++){printf("%4d",num[i]);if((i+1)%4==0)printf("\n");}printf("\n");}MPI_Finalize();return 0;}
运行结果:
0 0
- MPI—聚集函数MPI_Gather()
- MPI聚集 (MPI_Gather)
- MPI聚合通信之MPI_Gather函数
- MPI学习-MPI_Gather and MPI_Allgather
- 采用MPI_Send 和MPI_Recv 编写代码来实现包括MPI_Bcast、MPI_Alltoall、MPI_Gather、MPI_Scatter 等MPI 群集通信函数的功能
- Fatal error in MPI_Gather: Other MPI error,的一个解决方法
- mpi函数
- MPI函数
- mpi函数
- 聚集函数
- 聚集函数
- 聚集函数
- MPI函数列表
- 常用的MPI函数
- MPI_Reduce mpi规约函数
- MPI函数学习
- MPI常用函数速查表
- oracle的聚集函数
- 上传下载
- .Net web提交到后台中文乱码问题解决
- Android之Manifest文件
- 安装qt qmake 错误:could not find a Qt installation of ''
- IO流
- MPI—聚集函数MPI_Gather()
- 10上机练习1
- 从MVC到前后端分离(Rest框架搭建)
- Android CountDownTimer带有动画的倒计时
- 带你玩转Visual Studio——调用约定__cdecl、__stdcall和__fastcall
- Spring读书笔记-----Spring的Bean之设置Bean值
- Variable Naming Rules in C++
- windows下vue-cli及webpack 构建网站(二)导入bootstrap样式
- 搜狗搜微信链接为什么老是失效?