MPI_Get_processor_name,MPI_Get_version
来源:互联网 发布:淘宝达人发布短视频 编辑:程序博客网 时间:2024/05/17 03:54
/** * <Parallel programming technology for high performance computing> * * @Copyright Du Zhihui :edited * Li Sanli :review * Chen Yu Liu Peng :proofreading * * Rong Tao study note: 2017.10 * *//** * mpicc -o outfile Demo.c * mpirun -n 10 ./outfile > out.txt * */#include "mpi.h"#include <stdio.h>#include <math.h>int main(int argc,char *argv[]){ int myid, numprocs; int namelen; int version, subversion, ierr; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD,&myid); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Get_processor_name(processor_name,&namelen); MPI_Get_version(&version, &subversion); fprintf(stdout,"stdout Process %d of %d on %s\n",myid, numprocs, processor_name);//mpirun -n 10 ./a > out.txt fprintf(stderr,"stderr Process %d of %d on %s\n",myid, numprocs, processor_name);//screen fprintf(stderr,"version %d.%d \n",version, subversion);//screen perror("rong");//screen MPI_Finalize();}
编译与运行:
-bash-4.1$ mpicc -o a Demo_01_MPI_Get_processor_name_MPI_Get_version.c-bash-4.1$ ./astdout Process 0 of 1 on AMAXstderr Process 0 of 1 on AMAXversion 3.0 rong: Success-bash-4.1$ mpirun -n 2 ./astdout Process 0 of 2 on AMAXstdout Process 1 of 2 on AMAXstderr Process 0 of 2 on AMAXversion 3.0 rong: Successstderr Process 1 of 2 on AMAXversion 3.0 rong: Success-bash-4.1$
阅读全文
0 0
- MPI_Get_processor_name,MPI_Get_version
- Android Studio无法找到手机
- Webpack 3.x 中 style/css/Sass loaders
- Spring-概述
- Linux command
- localhost可以访问,127.0.0.1和IP无法访问(解决)
- MPI_Get_processor_name,MPI_Get_version
- arcgis链接oracle发布地图服务
- 模拟实现C库函数:strcpy和strcat
- WebClient和HttpWebRequst区别
- ArNetworking 入门
- 数据库设计三大范式
- vue2.0+stylus实现商品增加减少控制按钮组件
- 阿里云函数计算
- 用Python从0实现贝叶斯分类器的机器学习教程