Newsgroups: comp.parallel.mpi
From: Joerg Stiller <stiller@ism.mw.tu-dresden.de>
Subject: "any/some to some" problems
Organization: TU Dresden
Date: Tue, 30 Jun 1998 10:43:44 +0200
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <3598A53F.AFD6F493@ism.mw.tu-dresden.de>

Hi,

  I'm looking for efficienr solutions to the following two
problems:

PROBLEM 1 "each to some"
Each of P processes is supposed to have N neigbors.
Let be S(j) the message to be send to neighbor N(j)
and, R(j) the message to be received from this partner.
Usually S(j) and R(j) are equivalent in type and size.

PROBLEM 2 "some to some"
Each of P processes is supposed to have M sending and N
receiving partners. In general, M and N differ from process
to process. The sent and receive operations are no longer
symmetric (with respect to size).
Further, the following to cases might require different
approaches:
CASE 2a
   The receiver a priori knows the message length
CASE 2b
   The receiver does not know the message length

Are there any known standard solutions for these problems?
Is there any literature dealing with those problems?

Of course, we have some working solutions, e.g.
(skipping COMM, TAG, REQUEST and IERROR args)

! A solution for PROBLEM 1
  do j = 1, N
     call MPI_IRECV(R(j), COUNT(j), MyType, N(j), ...)
  end do
  do j = 1, N
     call MPI_SEND(S(j), COUNT(j), MyType, N(j), ...)
  end do

! A solution for PROBLEM 2a
  do j = 1, M
     call MPI_IRECV(R(j), RCOUNT(j), MyType, M(j), ...)
  end do
  do j = 1, N
     call MPI_SEND(S(j), SCOUNT(j), MyType, N(j), ...)
  end do

! A solution for PROBLEM 2b
  do j = 1, N
     call MPI_ISEND(S(j), SCOUNT(j), MyType, N(j), ...)
  end do
  do j = 1, M
     call MPI_PROBE(M(j), ..., STATUS)
     call MPI_GET_COUNT(STATUS, MyType, RCOUNT)
     call MPI_RECV(R(j), RCOUNT, MYType, M(j), ...)
  end do

Any comments welcome!

Joerg
--
Joerg Stiller
ADR: TU Dresden, Institut fuer Stroemungsmechanik, D-01062
TEL: ++49 351 4893
FAX: ++49 351 5246
ELM: j.stiller@ism.tu-dresden.de
WWW: http://rcswww.urz.tu-dresden.de/~jstiller



