正在加载图片...
MPI CART CREATE ude" stdio. h #include"mpi. h MPI Comm old comm, new comm tint ndis, reorder, periods [2], dim size[2] old comm= MPI COMM WORLD dims 2 2D matrix/grid*/ dim size[0]=3:/rows*/ dim size[1]=2;/*columns*/ periods[0]=1; /row periodic(each column forms a ring)*/ periods[1]=0; /columns non-periodic * reorder =1; / allows processes reordered for efficiency * MPI Cart create(old comm, ndims, dim size, periods, reorder, &new comm)MPI_CART_CREATE #include "stdio.h" #include "mpi.h" MPI_Comm old_comm, new_comm; int ndims, reorder, periods[2], dim_size[2]; old_comm = MPI_COMM_WORLD; ndims = 2; /* 2D matrix/grid */ dim_size[0] = 3; /* rows */ dim_size[1] = 2; /* columns */ periods[0] = 1; /* row periodic (each column forms a ring) */ periods[1] = 0; /* columns non-periodic */ reorder = 1; /* allows processes reordered for efficiency */ MPI_Cart_create(old_comm, ndims, dim_size, periods, reorder, &new_comm);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有