Newsgroups: comp.parallel.mpi
From: Stephane REQUENA <requena@parme.saclay.cea.fr>
Subject: Re: How to do this in MPI ?
Organization: CEA/DI Cisi
Date: Tue, 18 Nov 1997 16:10:37 +0100
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <3471AFEC.54359E46@parme.saclay.cea.fr>

Woo Chat Ming wrote:

> Hello,
>
>   I have a question in MPI. If you have time, would you please let me know
> how to do it ?
>   I design my MPI program such that it distributes matrix U in a way which
> is the same as (BLOCK,*) distribution of HPF. i.e., Each process gets
> ceiling(n/p) number of rows, except the last process which gets the
> remaining rows of the matrix.
>   Now I need to do a "All Gather" to create replicated matrix R. R
> has the value of U. Every process contains one R and R in different
> process have same values. How to do this in MPI ? Using function such as
> Gather or AllGather is very inconvenient because the data are not always
> evenly distributed. Sometimes the data in the last process contains less
> rows of U than other processes.
>   Thanks in advance for any assistance. :)

Hi

You can use MPI_Gatherv or MPI_Allgatherv which allow you to gather different

size of data check at these links :

http://www.netlib.org/utk/papers/mpi-book/node100.html#SECTION00562000000000000000
for MPI_Gatherv

and
http://www.netlib.org/utk/papers/mpi-book/node108.html#SECTION00582000000000000000
for
MPI_Allgatherv

--
Stéphane Requena
CEA/DI CISI Centre de Saclay
B.P. 28
F91192 Gif sur Yvette cedex
mailto:requena@parme.saclay.cea.fr




