(j3.2006) [MPI3 Fortran] Feedback from Fortran J3 meeting

Van Snyder Van.Snyder
Fri May 30 19:16:09 EDT 2008


On Fri, 2008-05-30 at 16:41 -0500, Bill Long wrote:
> Besides the brain cramp resulting from trying to shoehorn MPI data 
> transfer routines into the I/O infrastructure,  

You would write MPI calls in the usual way, encapsulate them in a few
routines, and access them by way of read, write, flush and wait
statements.

The "brain cramp" I get with PVM now comes from trying to send and
receive structures of several types, each with numerous components, and
each requiring its own large messy pair of routines to pack up and
unpack the PVM buffers.  If this were hiding under a read or write
statement, compiling the read or write statement would result in code
that repeatedly calls my "continue" routine.  It wouldn't know which
component it was working on, or even that it was working on a component.
I'd need a generic "continue" with one specific for each intrinsic type
and kind, each one using TRANSFER to move stuff to/from a shared PVM
buffer, which I would probably put in a component of the "hook"
structure.

I see this as far less of a brain cramp than what I have to do now.

One of my input routines (PVMReceiveQuantity in the attachment
QuantityPVM.f90, included just to illustrate the "brain cramp" I have
for just one type) would degenerate to

  read ( unit=defined_input_PVM ) Quantity

One of my "continue" routines would look something like

  subroutine Continue_Read_Real ( Unit, Async, Object )
    real, intent(out) :: Object
    class(defined_input), intent(inout) :: Unit
    logical, intent(in) :: Async
    select type ( unit )
    type is ( my_PVM_defined_input )
      if ( unit%bufferPos > ubound(unit%buffer,1) ) then
        ! Read a buffer using PVM
        ... ( including consulting the Async argument ) ...
        unit%bufferPos = lbound(unit%buffer,1)
      end if
      object = transfer(unit%buffer(unit%bufferPos),object)
      unit%bufferPos = unit%bufferPos + bit_size(object)/8
    end select
  end subroutine Continue_Read_Real

These are essentially equivalent to the routines I have in PVMIDL.f90
(also attached for the curious).

Lacking macros or parameterized modules, I would put everything between
the "real" and "end subroutine" statements into an include file, and
have a four-liner for each intrinsic type and kind I use in my program.

I would actually get brain uncramping because the processor expands I/O
lists as described in 08-007r2:214:9.6.3p7, instead of me doing it
explicitly for every component of every type.

If I specify asynchronous "I/O" I don't need any kludges like SYNC
MEMORY.  It's already handled (unless we botched async).

Van

-------------- next part --------------
A non-text attachment was scrubbed...
Name: QuantityPVM.f90
Type: text/x-fortran
Size: 19565 bytes
Desc: not available
Url : http://j3-fortran.org/pipermail/j3/attachments/20080530/8fd93e77/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PVMIDL.f90
Type: text/x-fortran
Size: 43290 bytes
Desc: not available
Url : http://j3-fortran.org/pipermail/j3/attachments/20080530/8fd93e77/attachment-0003.bin 



More information about the J3 mailing list