LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2004-06-28 06:51:36


On Mon, 28 Jun 2004, Lei_at_ICS wrote:

> I was going to use tag until I realize that the tag space (number of
> usable values) is too small for my application.
>
> A message is identified uniquely by an integer pair (i, j), both i and j
> go from 0 to N-1. So the tag I use is: tag=i*N+j. This maps the two
> dimensional (i, j) space uniquely to the one dimensional tag space.
> Unfortunately, this solution limits the N value to sqrt(max_tag). Even
> if max_tag=MAX_INT, that's still not enough for me (N~=50k).

Not sure I follow there -- MAX_INT is almost 4.3B. With your mapping
scheme, 50k*50K+50K = ~2.5B. This is still far less than MAX_INT.

> One of the following could solve my problem:
> 1) A user adjustable max_tag, so I can set it to be MAX_INT^2;

The tag field specified by the MPI standard is an int, so no MPI
implementation can give you more than sizeof(int) bytes/bits for a tag.

> 2) A more efficient 2D -> 1D tag map so I won't waste the 1D tag space
> too much.

This depends on your application. Typical solutions include a more
coarse-grained tag mapping and then put enough information in your message
to specify the rest of the exact mapping. E.g., use "i" as the tag, and
then embed "j" in the message somewhere. Since you're receiving on
ANYTAG, then you clearly don't need your message receiving logic to care
about the (i,j) values -- you only need those *after* you have received
the message. So if you can receive a message and then deduce (i,j) from
it, I'm guessing that should be sufficient for you.

Hope that helps.

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/