X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b73466ada27682d1729f394549479da83ef4a99..f8aee9e9605123e308d1e1ece136c5912f3dc367:/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 diff --git a/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 b/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 index 8e447927a3..56b76b7e88 100644 --- a/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 +++ b/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 @@ -43,51 +43,34 @@ endif endif end - -module array - integer, dimension(:), allocatable :: myindex -end module - ! ! A simple get intracomm for now logical function MTestGetIntracomm( comm, min_size, qsmaller ) - use array use mpi - integer ierr integer comm, min_size, size, rank logical qsmaller + integer myindex + save myindex + data myindex /0/ - integer status - call mpi_comm_size( MPI_COMM_WORLD, size, ierr ) - - if(.not. allocated(myindex)) then - allocate(myindex(size), STAT=status) - call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr ) - myindex(rank+1)=0 - endif - - !data myindex /0/ - - - - if (myindex(rank+1) .eq. 0) then + comm = MPI_COMM_NULL + if (myindex .eq. 0) then comm = MPI_COMM_WORLD - else if (myindex(rank+1) .eq. 1) then + else if (myindex .eq. 1) then call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr ) - else if (myindex(rank+1) .eq. 2) then + else if (myindex .eq. 2) then call mpi_comm_size( MPI_COMM_WORLD, size, ierr ) call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr ) call mpi_comm_split( MPI_COMM_WORLD, 0, size - rank, comm, & & ierr ) else - if (min_size .eq. 1 .and. myindex(rank+1) .eq. 3) then + if (min_size .eq. 1 .and. myindex .eq. 3) then comm = MPI_COMM_SELF endif endif - myindex(rank+1) = mod( myindex(rank+1), 4 ) + 1 + myindex = mod( myindex, 4 ) + 1 MTestGetIntracomm = comm .ne. MPI_COMM_NULL - qsmaller=.true. end ! subroutine MTestFreeComm( comm )