ScaLAPACK Archives

[Scalapack] blacs_pcoord


Here is the output of a simple program which
compare just the result of blacs_gridinfo and
blacs_pcoord, the simple code (fotran 90) is
following the output (running with 4 proc).
I have checked on several platforms:
the results of blacs_pcoord is not correct.



iproc,myrow,mycol(gridinfo)=  0  0  0
iproc,myrow,mycol(gridinfo)=  1  1  0
iproc,myrow,mycol(gridinfo)=  3  1  1
iproc,myrow,mycol(gridinfo)=  2  0  1
iproc,RDEST,CDEST(pcoord)=  0  0  0
iproc,RDEST,CDEST(pcoord)=  1  0  1
iproc,RDEST,CDEST(pcoord)=  2  1  0
iproc,RDEST,CDEST(pcoord)=  3  1  1

program test_psamax
  implicit none
  include "mpif.h"
    INTEGER     :: iproc, nprocs, info
    INTEGER     :: nprow, npcol
    INTEGER     :: icntxt
    INTEGER     :: myrow, mycol
    integer :: i,j, rdest, cdest
    call mpi_init(info)
    Call MPI_COMM_SIZE(mpi_comm_world, nprocs, info)
    Call MPI_COMM_RANK(mpi_comm_world, iproc,  info)
    !call blacs_pinfo(iproc, nprocs)

    NPCOL = INT( sqrt( float(nprocs) ) )
    NPROW = nprocs / NPCOL
    call blacs_get(0, 0, icntxt)
    CALL blacs_gridinit( icntxt, 'COL', NPROW, NPCOL )
    call blacs_gridinfo(icntxt, nprow, npcol, myrow, mycol)
    write(6,'(A,3I3)') 'iproc,myrow,mycol(gridinfo)=',iproc,myrow,mycol
    if( (myrow<0 .and. myrow>=nprow) .or.   &
        (mycol<0 .and. mycol>=npcol) ) goto 100

    do i = 0, nprocs-1
        CALL blacs_pcoord( icntxt, i, RDEST, CDEST ) !! error in 
        if( iproc==0 ) write(6,'(A,3I3)') 
100 continue
    CALL MPI_BARRIER( mpi_comm_world, info )

end program

Julien Langou wrote:

no no

The documentation is correct. For blacs_pcoord:

    (output) INTEGER.
    On output, the row coordinate of process PNUM in the BLACS grid.
    (output) INTEGER.
    On output, the column coordinate of process PNUM in the BLACS grid.

Maybe test out the program 'Hello World' at:

It basically checks in a few lines blacs_pcoord


On Thu, 9 Mar 2006, HuiZhong LU wrote:


I find an error in blacs_pcoord( icntxt, pnum, prow, pcol ).
The real result is:
   prow is the columns number of pnum in the grid
   pcol is the row number of pnum in the grid


HuiZhong LU

Univ. of Sherbrooke
Quebec, Canada
Scalapack mailing list

<Prev in Thread] Current Thread [Next in Thread>

For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or