Title: Typed MPI A Data Type Tool for MPI
1Typed MPI - A Data Type Tool for MPI
- Nitin Bahadur
- and
- Florentina Irina Popovici bnitin, pif
_at_cs.wisc.edu
Typed MPI
2Why a Data Type Tool for MPI?
- No type message at receiver end
- User has to manually construct MPI data types
corresponding to user defined data types
User code for constructing an MPI datatype for a
C struct
3 Objectives of our interface
- Automatic generation of MPI datatypes
- Type checking and error reporting to both sender
and receiver - Seamless integration within a C program
- Facility to send user-defined datatypes such as
structures - Facility to send multiple data in one send call
(allowing arbitrary grouping of data to be sent)
4Design Overview
- Code generated at compile time. It will perform
- signature generation
- data and signature packaging
- signature checking (receiver end)
- error reporting
Support for runtime
5How does Typed MPI work ?
- Phase 1 preprocess the user files
- determine the types of the wrapper call
parameters - generate signature
- generate code for packaging data
- generate code for sending/receiving data
- generate code for error checking/reporting
- Phase 2 runtime
- Execute the program, make the actual MPI calls
and do error checking and reporting
6Type Checking
- Rules for type checking. Two types T1 and T2 are
identical if - T1 and T2 have the same primitive type (e.g.
int, char ) - T1 and T2 are arrays and they have the same base
type and the same size - (int p5 and char q5 are different)
- T1 and T2 are structures and their members have
the same type
- A Signature is
- generated for each variable to be sent/received
based on its type - sent by the sender along with the data
- compared at the receivers end with the expected
signature (an error code will be returned to the
sender )
Send / Receive Protocol
7Signature
encompasses entire type of a variable
struct example1 int a float b5
START, VAR_START, STRUCT_START,
TYPE_INT, 1 , TYPE_ARRAY,
TYPE_FLOAT, 5, ST_UN_END, END
Signature
- depth first approach to signature construction
- type of a variable is broken down recursively to
generate the signature
Recongnition of a complex C struct
VAR_START
STRUCT_START
struct eg1 int a struct eg2
int b float b5
STRUCT_START
TYPE_INT
TYPE_INT
TYPE_ARRAY
1
TYPE_FLOAT
1
5
8Preprocessing steps
Preprocessor and generator
Compilation
/ Initial user code / .... MPI_Wrapper_Send
(dest, tag, comm, a, 1, b, 2) .... MPI_Wrapper_
Recv (src, tag, comm, status, a, 1, b, 2) ...
/ Modified user source code / .... MPI_Wrapper_
Send79205397130821 (dest, tag, comm, a, 1, b,
2) .... MPI_Wrapper_Recv79205397345131(src, tag,
comm, status, a, 1, b, 2) ...
Executable
/ generated file 1 / int MPI_Wrapper_Send7920539
7130821 (int, int, MPI_Comm, void , int, void
int) / signature and data packaging,
error reporting /
A new file is generated for every MPI_Wrapper
call and it contains code for that call
/ generated file 2 / int MPI_Wrapper_Recv792053
971345131 (int, int, MPI_Comm, MPI_Status , void
, int, void , int) / signature and data
packaging, error reporting /
Files resulting after preprocessing and source
code generation
9Performance Evaluation
Type Checking overhead
Preprocessing overhead
- The graphs and figure show that our design is
feasible for automatic type generation and type
checking. - The overhead of type checking gets overshadowed
by data transmission time as data size increases.
10Conclusions
- A simple interface for sending user defined
datatypes and multiple data in one call - Strict type checking and error reporting to both
sender and receiver - Low preprocessing time and runtime overhead
- Error reporting to sender can be disabled to (if
required) to reduce number of data transfers
Future Work
- Extensions for Group Communication and Vector
operations - Handling of expressions in MPI_Wrapper calls
- Feasibility study for use of hashing functions
to reduce size of signature