cartc.f90
来自「MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程」· F90 代码 · 共 22 行
F90
22 行
program topology implicit none include "mpif.h" integer, parameter :: Ndim=2 integer :: Rang, Nprocs, Comm, info integer, dimension(Ndim) :: Dims logical, dimension(Ndim) :: Period logical :: Reorder=.FALSE. Period(:) = .FALSE. CALL MPI_INIT(info) CALL MPI_COMM_RANK( MPI_COMM_WORLD, rang, info ) CALL MPI_COMM_SIZE( MPI_COMM_WORLD, Nprocs, info ) Dims(:) = 0 CALL MPI_DIMS_CREATE( Nprocs, Ndim, Dims, info ) CALL MPI_CART_CREATE( MPI_COMM_WORLD, Ndim, Dims, Period, Reorder, & Comm, info ) print *, "Rang : ",rang," New Comm cart : ",Comm call MPI_FINALIZE(info)end program topology
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?