Newsgroups: comp.parallel.mpi
From: Yon Han CHONG <Y.H.Chong@cranfield.ac.uk>
Subject: Re: MPI-2: MPI_TYPE_CREATE_SUBARRAY (Fortran binding issue)
Organization: Cranfield University
Date: Wed, 11 Mar 1998 10:05:08 +0000
Mime-Version: 1.0
Content-Type: text/plain; charset=EUC-KR
Content-Transfer-Encoding: 7bit
Message-ID: <350661D4.BF4DAE03@cranfield.ac.uk>

Rajeev Thakur wrote:
> 
> In article <35056083.B5F717B2@cranfield.ac.uk>,
> Yon Han CHONG  <Y.H.Chong@cranfield.ac.uk> wrote:
> >In MPI-2 it is defined that the begining of subarrary index should be
> >a positive numbers. In C, this does make sense. You do not want to go
> >over the boundary. In Fortran, this is restrictive because sometimes
> >it is more convient to define an array as following:
> >
> >   integer, parameter :: N=5
> >   real, dimension(-1:N+2) :: a_local
> >
> >"a_local" cannot be a subarray since the index start from a negative
> >number.
> 
> This is one of the reasons why MPI_Type_create_subarray
> uses 0-based indexing for the subarray index. It is natural in C for
> one. In Fortran, since an array could be defined in many ways, for
> example, 1 to 200 or -100 to 100, we need to select one
> way to specify the subarray. We chose 0-based. So if your Fortran
> array is (-1:N+2), and the subarray you want out of it is (5:10),
> specify it as (6:11) to MPI_Type_create_subarray.
> 
> Rajeev

Yes, but if my array is (-1:N+2) and I would like my subarray to be 
(-1:3) then how can I do it? Do I specify (0:0) to 
MPI_Type_create_subarray?

-- 
----------------------------------------------------------------------
Yon Han Chong                     |
Flow Control and Prediction Group | Tel: + 44 1234 750 111 ext. 5420
Cranfield College of Aeronautics  | E-mail: Y.H.Chong@cranfield.ac.uk
Cranfield University              | Fax: + 44 1234 752 149
United Kingdom                    | Mobile: + 44 958 381 395
----------------------------------------------------------------------

