Good catch. If I'm not mistaken then the line n_root = 1 << (n_root / 2); in src/mpi/topo/dims_create.c sets an overly strict boundary as the division by 2 will round down. In the test case n_root will be set to 16, which is smaller than 19. The following line should fix this, while being only marginally slower (with prime number density being low for large n...) n_root = 1 << (n_root / 2 + 1); Cheers -Andreas On 09:10 Tue 31 Mar , Valery wrote:
Dear All
I noticed that MPI_DIMS_CREATE cannot split eg 361 into a 19 * 19 processor grid. Is that a feature?
The code follows.
I used MPICH-3.1.4 gcc-4.9.2
valery
cat mpi_dims.f90 program test use mpi implicit none integer :: ierr, nnodes, ndims, dims(2), i call MPI_INIT( ierr ) ndims = 2 do i = 1, 200 nnodes = i**2 dims(:) = 0 call MPI_DIMS_CREATE( nnodes, ndims, dims, ierr ) if( dims(1) /= i ) write(*,*) i, dims enddo call MPI_FINALIZE(ierr) end program test
mpif90 mpi_dims.f90
mpiexec -n 1 ./a.out 19 361 1 41 1681 1 43 1849 1 71 5041 1 73 5329 1 79 6241 1 83 6889 1 89 7921 1 137 18769 1 139 19321 1 149 22201 1 151 22801 1 157 24649 1 163 26569 1 167 27889 1 173 29929 1 179 32041 1 181 32761 1
_______________________________________________ discuss mailing list [email protected] To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss
-- ========================================================== Andreas Schäfer HPC and Grid Computing Chair of Computer Science 3 Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany +49 9131 85-27910 PGP/GPG key via keyserver http://www.libgeodecomp.org ========================================================== (\___/) (+'.'+) (")_(") This is Bunny. Copy and paste Bunny into your signature to help him gain world domination! _______________________________________________ discuss mailing list [email protected] To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss