Newsgroups: comp.parallel.mpi
From: Michael Pernice <usimap@sneffels.usi.utah.edu>
Subject: Re: data types
Organization: Center for High Performance Computing
Date: Mon, 01 Dec 1997 12:07:39 -0700
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <34830AFB.98731C18@sneffels.usi.utah.edu>

Glenn Sollie wrote:
> 
> I am relatively new at MPI, and am trying to apply MPI to a three
> dimensional CFD code.  I need to send and receive planes of data for
> boundary conditions, so I need to define vector datatypes for 3D arrays,
> as outlined in appendix E.1.3 of "Using MPI".  The description there
> appears to be pretty straightforward, but I'm having a terrible time
> making it work correctly, especially the procedure for passing a y-z
> plane of data.  Can anyone out there help?
> 
> Thanks,
> 
> gsollie@mindspring.com

Glenn,

I wrote some user-defined datatypes for passing faces in a 3D
electromagnetic wave propagation code that seemed to work.  There 
was one set of faces that was particularly tricky. I needed to 
define an intermediate type using MPI_TYPE_VECTOR to define 
rows that were constructed from non-contiguous data, and put 
together these rows to form the faces by using MPI_TYPE_HVECTOR.  
I needed to use MPI_TYPE_EXTENT to get the strides right.  The
particulars depend on your data structure, such as how you handle 
ghost cells for holding neighbor data and the number of ghost 
cells you need.

If these hints aren't enough to get you started, I can send you
a code fragment. 

Does anyone know a better way to do this?

BTW, while writing this code, I ran across a tool at LLNL called
MPIMap (http://www.llnl.gov/liv_comp/mpimap/) that's supposed to 
help with this process, but I could never get it to work.  Anyone 
out there with experience using it?

-- 
Michael Pernice                             usimap@sneffels.usi.utah.edu
University of Utah                          Phone:  (801) 581-7708
Center for High Performance Computing       Fax:    (801) 585-5366

