        integer p, me, l, tag
        me = nodeid()
        p = nnodes()
        tag = 0
        ln = n/p
        do i = 1, ln
          x(i) = 1.0
        enddo
        if (me .eq. 0) x(0) = 0.0
        if (me .eq. p-1) x(ln+1) = 0.0
        do k = 1, NoIters
          if (me - 1 .ge. 0) snd(tag, newx(1), 8, me-1, 1)
          if (me + 1 .lt. p) rcv(tag, x(ln+1), 8, l, me+1, 1)
          tag = tag + 1
          if (me + 1 .lt. p) snd(tag, newx(ln), me+1, 1)
          if (me - 1 .ge. 0) rcv(tag, x(0), l, me-1, 1)
          tag = tag + 1
          do i = 1 , ln
            newx(i) = .5 * (x(i-1) + x(i+1) - dx2 * x(i))
          enddo
          do i = 1 , ln
            x(i) = newx(i)
          enddo
        enddo
