      subroutine cbsu3_bnd2a_mpi(idg,my_id) ! Bernd Berg Mar 15 2008. 
C Collect boundaries without corners from checkerboard 2 for SU3 action.
      include '../../Libs/Fortran/implicit.sta'
      include 'mpif.h'
      include '../../Libs/Fortran/constants.par'
      include '../../Libs/Fortran_par/latmpi.par' ! Defines n18.
      include '../../Libs/Fortran_par/mc.par'
      include '../../Libs/MPI_par/common_cblat.f'
      include '../../Libs/MPISU3/common_cbsu3.f' 
      include '../../Libs/MPI_par/common_mpi.f'
      parameter(mscb18=n18*mscb)
      ltest=.true.  
      ltest=.false.
      if(ltest.and.my_id.eq.0) 
     &  print*,"cbsu3_bnd2a_mpi: idg,mscb,mscb18 =",idg,mscb,mscb18
      if(ltest) return
C
C Gather boundaries on checkerboard 2 (for update of checkerboard 1):
      ismpi=my_id+1
      itag=idg
      do idmpi=1,ndmpi
        do iscb=1,mscb 
          do isu3=1,n18 ! Gather:
            a2su3fb(isu3,iscb)=a2su3(isu3,ipfb2(iscb,idmpi),idg) 
            a2su3bb(isu3,iscb)=a2su3(isu3,ipbb2(iscb,idmpi),idg) 
          enddo
        enddo
C Send and receive:
        irecv=ipf_mpi(idmpi,ismpi)-1 ! Send forward.
        call mpi_send(a2su3fb,mscb18,mpi_double_precision,
     &                irecv,itag,mpi_comm_world,ierr)
        i1=1+msc+(idmpi-1)*mscb      ! Position in a2su3.
        isend=ipb_mpi(idmpi,ismpi)-1 ! Received from isend:
        call mpi_recv(a2su3(1,i1,idg),mscb18,mpi_double_precision,
     &                isend,itag,mpi_comm_world,istatus,ierr)
        irecv=ipb_mpi(idmpi,ismpi)-1 ! Send backward:
        call mpi_send(a2su3bb,mscb18,mpi_double_precision,irecv,
     &                itag,mpi_comm_world,ierr)
        i1=1+noffset+(idmpi-1)*mscb  ! Position in a2su3.
        isend=ipf_mpi(idmpi,ismpi)-1 ! Received from isend:
        call mpi_recv(a2su3(1,i1,idg),mscb18,mpi_double_precision,
     &                isend,itag,mpi_comm_world,istatus,ierr)
      enddo
C
      return
      end
