Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'v3_8_x'
[simgrid.git] / teshsuite / smpi / mpich-test / topol / cartc.f90
1 program topology
2   
3      implicit none
4      include "mpif.h"
5      integer, parameter :: Ndim=2
6      integer :: Rang, Nprocs, Comm, info
7      integer, dimension(Ndim) :: Dims
8      logical, dimension(Ndim) :: Period
9      logical                  :: Reorder=.FALSE.
10
11      Period(:) = .FALSE.
12      CALL MPI_INIT(info)
13      CALL MPI_COMM_RANK( MPI_COMM_WORLD, rang, info )
14      CALL MPI_COMM_SIZE( MPI_COMM_WORLD, Nprocs, info )
15      Dims(:) = 0
16      CALL MPI_DIMS_CREATE( Nprocs, Ndim, Dims, info )
17      CALL MPI_CART_CREATE( MPI_COMM_WORLD, Ndim, Dims, Period, Reorder, &
18                            Comm, info )
19      print *, "Rang : ",rang," New Comm cart : ",Comm
20      call MPI_FINALIZE(info)
21 end program topology