      subroutine cbsu3_bnd_mpi(my_id) ! Bernd Berg Mar 13 2008. 
C MPI checkerboard: Collect boundaries for SU3 Wilson 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'
      ltest=.true.
      ltest=.false.
      if(ltest) then ! ----------------------------------------
        write(iud2,'(/,"cbsu3_bnd_mpi: my_id =",I6)') my_id
        write(iud2,'(" ndmpi,nd,mscb =  ",3I6)') ndmpi,nd,mscb
        if(my_id.eq.0) write(iuo,'("cbsu3_bnd_mpi: STOP ltest.")')
        call mpi_finalize(ierr)
      stop
      endif ! --------------------------------------------------
C
      do idg=1,nd ! Gather boundaries without corners:
        call cbsu3_bnd1a_mpi(idg,my_id) ! from checkerboard 1.
        call cbsu3_bnd2a_mpi(idg,my_id) ! from checkerboard 2.
      enddo
      if(ndmpi.eq.1) return
C
      do idg=1,nd ! Gather corners (when needed):
        call cbsu3_bnd1b_mpi(idg,my_id) ! from checkerboard 1.
        call cbsu3_bnd2b_mpi(idg,my_id) ! from checkerboard 2.
      enddo
C
      return
      end
