正在加载图片...
第二个MPI程序 MPI_hello.c #include <mpi.h> #include <stdio.h> #include <math.h> int main(int argc,char argv[]) { int myid,np; int namelen; char proc_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD,&myid); MPI_Comm_size(MPI_COMM_WORLD,&np); MPI_Get_processor_name(proc_name,&namelen); fprintf(stderr,"Hello,I am proc.%d of %d on %s\n", myid,np,proc_name); MPI_Finalize(); http://math.ecnu.edu.cn/-jypan 9http://math.ecnu.edu.cn/~jypan 9 第二个 MPI 程序 #include <mpi.h> #include <stdio.h> #include <math.h> int main(int argc, char * argv[]) { int myid, np; int namelen; char proc_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &myid); MPI_Comm_size(MPI_COMM_WORLD, &np); MPI_Get_processor_name(proc_name,&namelen); fprintf(stderr,"Hello, I am proc. %d of %d on %s\n", myid, np, proc_name); MPI_Finalize(); } MPI_hello.c
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有