Date: Tue, 2 Feb 1999 09:24:55 -0800
From: John May <johnmay@XXXXXXXX>
To: jpprost@XXXXXXXXXX,Hubert Ritzdorf <ritzdorf@XXXXXXXXXXXXXXXXXXXXXXXXXXX>
Cc: mpi-core@XXXXXXXXXXX
Subject: Re: Question to MPI/IO
X-Mailer: Mutt 0.93.2i
Sender: owner-mpi-core@XXXXXXXXXXX

I agree with Jean-Pierre that version (i) is correct.  Version
(ii) would not be as simple as it looks because the user might
call MPI_File_write with complex derived data type, and the
first call to the conversion function might return after 
traversing only part of the type.  Having the MPI implementation
figure out the right buffer location for the second call would
be pretty complicated, but the user function can just cache
this information somewhere when it finishes the first call and
then pick it up when it starts the second call.

Since you're working on the datarep converters, you might be
interested in a test code we posted on the web at
http://www.llnl.gov/sccd/lc/piop/ .  Look for the links at
the end of the MPI-IO section.

John

On Tue, Feb 02, 1999 at 10:59:34AM -0500, jpprost@XXXXXXXXXX wrote:
> Hubert,
> 
> Version (i) is the version intended by the standard, which says:
> "The function must begin copying at the location in userbuf specified by
> position
> into the (tiled) datatype."
> Note that your note was confusing, because the descriptions of the two
> alternatives before
> the code and within the code are opposite. The right description is the one
> given
> within the code. Instead of saying "the user must find...", I would rather
> say "the user defined
> conversion routine must determine..."
> Jean-Pierre
> 
> ###################################################
> Jean-Pierre Prost
> IBM T.J. Watson Research Center
> PO Box 218
> Yorktown Heights, NY 10598
> USA
> Phone: (914) 945 3225
> Fax: (914) 945 2141
> Internet: jpprost@XXXXXXXXXX
> Lotus Notes: Jean-Pierre Prost/Watson/IBM @ IBMUS
> VM: IBMUSM11(JPPROST)
> Home page: http://www.research.ibm.com/people/p/prost/
> ###################################################
> 
> 
> 
> Hubert Ritzdorf <ritzdorf@XXXXXXXXXXXXXXXXXXXXXXXXXXX> on 02/02/99 05:52:05> 
> To:   mpi-core@XXXXXXXXXXX
> cc:    (bcc: Jean-Pierre Prost/Watson/IBM)
> Subject:  Question to MPI/IO
> 
> 
> 
> 
> 
> 
> Hi,
> 
> I am implementing MPI for NEC SX computers and I have a question to
> Datarep Conversion functions (chapter 9.5.3 of the MPI-2 document)
> 
> (*)  If MPI cannot allocate a (file) buffer large enough to hold all the
>      the data to be converted, the standard says:
> 
>      For the first call, MPI will call the (conversion) function with
>      ``position'' set to zero. ...
>      Then in subsequent calls to the conversion function,
>      MPI will increment the value in ``position'' by the ``count''
>      of items converted in the previous call.
> 
>      My question is:
>      Is the user buffer ``buf'' incremented correspondingly
>      in the second call (and further calls) of the conversion function
>      (cf. Version i below) or
>      must the user find the correct position in the user buffer ``buf''
>      within the conversion function (cf. Version ii below)?
> 
>      i.e.
> 
>         /* first call */
>            position = 0;
>            write_fn (buf, datatype, count, filebuf, position, extra_state);
> 
>         /* write filebuf to the file */
> 
>            write (.., filebuf, count*datarep_size);
> 
> 
> 
>         /* (Version i)
>             second call, the user must find the correct position in buf */
> 
>            position = count;
>            write_fn (buf, datatype, count, filebuf, position, extra_state);
> 
> 
>      or
> 
>         /* (Version ii)
>            second call, MPI transfers the new user buffer location */
> 
>            position = count;
>            next_buf = (char *) buf + count * native_size;
>            write_fn (next_buf, datatype, count, filebuf, position,
> extra_state);
>         /* write filebuf to the file */
> 
>            write (.., filebuf, count*datarep_size);
> 
> 
> 
>   Best regards
> 
>   Hubert
> 
> 
> 
> ___________________________________________________________________________
> ___
> 
>    Hubert Ritzdorf
> 
>    NEC Europe Ltd.
>    C&C Research Laboratories
>    Rathausallee 10
>    D-53757 Sankt Augustin
> 
>    Tel.: +49 (0) 2241 / 92 52 65
>    Fax : +49 (0) 2241 / 92 52 99
>    e-mail  : ritzdorf@ccrl-nece.technopark.gmd.de
>    InPerson: ritzdorf@XXXXXXXXXXXXXX or
>              ritzdorf@XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>    WWW     : http://www.ccrl-nece.technopark.gmd.de/~ritzdorf
> ___________________________________________________________________________
> ___
> 
> 
> 
> 
> 
> 
> 
>