Newsgroups: comp.parallel.mpi
From: kalns@pit-bull.msu.edu (Edgar T. Kalns)
Subject: Re: MPI_Scatterv and overlapping datatypes
Organization: Michigan State University, CPS Department
Date: 31 Mar 1995 21:11:54 GMT
Message-ID: <3lhr6q$fsc@msunews.cl.msu.edu>

In article <3lhn3a$mao@msunews.cl.msu.edu>, kalns@pit-bull.msu.edu (Edgar T. Kalns) writes:
|> Summary of question: 
|> 
|>         How to perform MPI_SCATTERV with a sendtype that 
|>         specifies overlapping locations in sendbuf?
|> 
|> Details:
|> 
|>         p. 104 of 5/5/94 standard:
|>         The outcome of an MPI_Scatterv is as if the root executed n send ops:
|> 
|>         MPI_Send(sendbuf + displs[i] * extent(sendtype),sendcounts[i],...);
|>                                                                     ^^^^^^^^^^^^^
|>         Is it possible to cajole the extent(sendtype) so that 
|>         *arbitrary* displacements in sendbuf can be specified in 
|>         MPI_Scatterv?  Obviously, this can be done using pt-to-pt routines.
|> 
|> Simple example:
|> 
|>         assume comm. size is 4.
|>         int	s_buf[8] = {0, 1, 2, 3, 4, 5, 6, 7}  /* data at root */
|>    
|>         want each process to have a "scatter" of s_buf as follows:
|>         rank 0: r_buf[2] = {0, 4}
|>         rank 1: r_buf[2] = {1, 5}
|>         rank 2: r_buf[2] = {2, 6}
|>         rank 3: r_buf[2] = {3, 7}
|> 
|> Scatter pattern is easy to specify:
|> 
|>         MPI_Type_vector( 2, 1, 4, MPI_INT, &s_type ); 
|>         
|>         however, MPI_Type_extent( s_type, &extent ) returns an extent of 20;
|>         so using Scatterv is not possible for the above scatter pattern.
|>         
|> Thanks,
|> Edgar Kalns
|> kalns@cps.msu.edu
|> 
|> 
|> 

This question has been answered by Lloyd Lewins post regarding
MPI_Gather ;  the issue is the same.   

Yes, it was a coincidence that his posted answer to a previous q. and 
my q. happened "in parallel"  :-)

Thanks Lloyd!

Edgar

