SSP Project Summary:
MPI Datatypes Toolset: library support
[EPCC home] [SSP home] [2001 projects] [2000 projects] [1999 projects] [1998 projects] [1997 projects] [1996 projects] [1995 projects] [1994 projects] [1993 projects]

Student

Berent Eskikaya, Allegheny College, USA

Supervisor

A. Gordon Smith, EPCC


The proposed project follows on from the 1996 SSP project "MPI Datatypes Toolset" undertaken by Werner Augustin [see EPCC-SSP-96-10 "MPI Datatypes Toolset"]. Last year's development was concentrated on construction of a parser tool that would automatically take marked C structs and Fortran COMMON blocks and generate the MPI code necessary to create portable MPI derived datatypes to match the marked program data.

Another area that was partially addressed in last year's work was the provision of library support for creation of MPI derived datatypes that match commonly used program structures. Werner achieved some success in developing library support for the packing and unpacking of recursive data structures such as trees and graphs, using information planted by the datatype parser.

The proposed follow-on project will primarily address the following goals:

The initial goal will be in provision of library support for creation of MPI derived datatypes to match commonly-seen regular data structures. The following code fragment illustrates how a new routine, analogous to the MPI Process Topologies routine MPI_Cart_sub might be used to define a suitable derived datatype. A subtlety here is that for the datatype to be composed by MPI comms calls the extent has to be set explicitly, requiring calls to MPI_Type_vector, MPI_Type_struct and understanding of the predefined "datatype" MPI_UB.

real data(I,J,K)

integer dims(3)

logical remain(3)

integer columntype, dest, tag, comm, ierr

dims(1) = I

dims(2) = J

dims(3) = K

remain(1) = .FALSE.

remain(2) = .TRUE.

remain(3) = .FALSE.

call MPIDT_ARRAY_SUB(3, dims, remain, MPI_REAL, &columntype, ierr)

C.....Send y-columns 4,5,6,7

call MPI_SEND(data(1,4,1), 4, columntype, dest, tag, comm, ierr)

MPI point-to-point and collective communications using derived datatypes with identical composition but different layout allows combined data transfer and re-mapping.

Use of MPI in Fortran 90 programs is an area of concern: there are some serious incompatibilities between F90 and MPI. Perhaps the most major problem is the interaction between the F90 copy-in copy-out mechanism, for passing non-contiguous program data, and MPI non-blocking calls. An important example of non-contiguous data that requires a copy into a temporary lasting only for the duration of the call is an array section, eg. data(1,4:7,1). A generalisation of the routine suggested in the example above would allow an alternative, passing the full array and a derived datatype giving the layout of the array section to the non-blocking call, so avoiding the copy-in copy-out.

Another possible application of this kind of library support would be to define derived datatypes matching the local part of global data distributed by HPF directives, allowing hybrid programs that take advantage of some standardised data-parallel and message-passing features.

There is a strong opportunity for the latter parts of this development to be driven by the needs of other SSP projects, perhaps combined with a more wide-ranging survey of data structures used in parallel applications.

The current MPI-2 draft standard specifies calls to obtain exact information on how a given derived datatype was constructed. Standardisation of this functionality offers a portable method of visualising or debugging the derived datatypes in an MPI program, either during or after execution. Two tools that might be of use, given a standard file format for the structure of MPI derived datatypes: during execution the user program identifies send and receive datatypes, the user can later verify that the type signatures matched, as required by the MPI standard; the user program identifies a derived datatype, allowing later visualisation of its layout and fundamental (basic) datatypes, perhaps superimposed on an independent abstract description of the program data to which the datatype is applied.

There is also scope for development of code resulting from the 1996 MPI Datatypes Toolset project. The provision of library support for abstract communication of recursively structured data can be divorced from the parser tool by providing an alternate interface requiring user callback routines to identify linked items. The parser itself, though complete and tested, can be used as a component in other systems. For example one could provide an editor mode that parses marked data structures, or a service which parses submitted program fragments submitted though WWW forms. There is wide direction and applicability in providing support for MPI derived datatypes which can easily be tailored to the skills and interests of the student.


The final report for this project is available here.
Webpage maintained by mario@epcc.ed.ac.uk