LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Srinivasa Prade Patri (Srinivasa.Patri_at_[hidden])
Date: 2005-03-10 14:43:00


Hi!
    Iam trying to run a small example program using scalapack routines. This example is from tutorials on lam site. The program does a matrix vector mulitplication. Iam able to compile the code but not able to run it.

If i run it as
mpirun -v -np 4 mv_acml

iam getting the following error message...
1669 mv_acml running on n0
1413 mv_acml running on n1 (o)
1304 mv_acml running on n2
1288 mv_acml running on n3
-----------------------------------------------------------------------------
One of the processes started by mpirun has exited with a nonzero exit
code. This typically indicates that the process finished in error.
If your process did not finish in error, be sure to include a "return
0" or "exit(0)" in your C code before exiting the application.

PID 1669 failed on node n0 (10.5.0.1) due to signal 11.
-----------------------------------------------------------------------------

i guess signal 11 is a segmentation fault.Iam not sure why iam getting this.

 I really appreciate your help.

Regards
Srinivasa Patri

Here is the code for reference

       program parallel_mv
       ! global arrays
       real a(16,16)
       real b(16),y(16)

       ! variables for BLACS initialization and processor grid creation
       integer iam,nprocs,ictxt,nprow,npcol,myrow,mycol

       !variables needed for distributing global arrays across the proc grid
       integer desca(9), descb(9),descy(9),m,n,mb,nb,rsrc,csrc

       integer llda,lldb,info

       ! local arrays
       real la(8,8)
       real lb(8),ly(8)

       !Initializing the BLACS library (STEP 2)
c write (*,*) 'Iam here before call to blacs_pinfo'
       call blacs_pinfo (iam,nprocs)
c write (*,*) 'Iam here after call to blacs_pinfo'
       call blacs_get(-1,0,ictxt)

       ! Creating and using the processor grid (STEP 3)
       nprow=2; npcol=2
       call blacs_gridinit(ictxt,'r',nprow,npcol)
       call blacs_gridinfo(ictxt,nprow,npcol,myrow,mycol)

       ! Making the array descriptor vectors (STEP 4)
       m=16; n=16
       mb=8; nb=8
       rsrc=0; csrc=0
       llda=8
       call descinit(desca,m,n,mb,nb,rsrc,csrc,ictxt,llda,info)
       n=1; nb=1; lldb=8
       call descinit(descb,m,n,mb,nb,rsrc,csrc,ictxt,lldb,info)
       call descinit(descy,m,n,mb,nb,rsrc,csrc,ictxt,lldb,info)

       ! Filling the global arrays A,b
       open(unit=12,file="a.data")
       read(12,*) a
       open(unit=13,file="b.data")
       read(13,*) b
       ! Each processor fills in its local arrays with correct elements
       ! from the global arrays (STEP 5)
       if(myrow.eq.0.and.mycol.eq.0) then
        do i_loc=1,8
           do j_loc=1,8
              la(i_loc,j_loc)=a(i_loc,j_loc)
           end do
              lb(i_loc)=b(i_loc)
        end do
       end if

       if(myrow.eq.1.and.mycol.eq.0) then
        do i_loc=1,8
           do j_loc=1,8
              la(i_loc,j_loc)=a(i_loc+llda,j_loc)
           end do
              lb(i_loc)=b(i_loc+lldb)
        end do
       end if

       if(myrow.eq.0.and.mycol.eq.1) then
         do i_loc=1,8
            do j_loc=1,8
               la(i_loc,j_loc)=a(i_loc,j_loc+llda)
            end do
         end do
       end if

      if(myrow.eq.1.and.mycol.eq.1) then
        do i_loc=1,8
           do j_loc=1,8
              la(i_loc,j_loc)=a(i_loc+llda,j_loc+llda)
           end do
        end do
      end if
      ! Call the ScaLAPACK routine (STEP 6)
      n=16
      call psgemv('n',m,n,1.0,la,l,l,desca,lb,l,l,descb,1,0.0,ly,l,l,
     & descy,l)

      ! Each processor prints out its part of the product vector y (STEP 7)
      if(myrow.eq.0.and.mycol.eq.0) then
       do i=1,8
          print *,'PE:',myrow,mycol,' y(',i,')=',ly(i)
        end do
      end if

      if(myrow.eq.1.and.mycol.eq.0) then
        do i=1,8
          print *,'PE:',myrow,mycol,' y(',i+lldb,')=',ly(i)
        end do
      end if

      ! Release the proc grid and BLACS library (STEP 8)
      call blacs_gridexit(ictxt)
      call blacs_exit(0)

      end program parallel_mv