mirror of
https://github.com/foxsen/archbase.git
synced 2026-04-23 18:10:34 +08:00
initial import to public repository
This commit is contained in:
9
materials/chapter10/MPI.c
Normal file
9
materials/chapter10/MPI.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "mpi.h"
|
||||
int main(int argc,char *argv[])
|
||||
{ int myid,count;
|
||||
MPI_Init(&agrc,&argv); /*启动计算*/
|
||||
MPI_Comm_size(MPI_COMM_WORLD,&count); /*获得进程总数*/
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &myid);/*获得自己进程号*/
|
||||
printf("I am %d of %d\n", myid,count); /*打印消息*/
|
||||
MPI_Finalize();/*结束计算*/
|
||||
}
|
||||
Reference in New Issue
Block a user