Presentation is loading. Please wait.

Presentation is loading. Please wait.

Typed MPI - A Data Type Tool for MPI Nitin Bahadur and Florentina Irina Popovici { bnitin, pif

Similar presentations


Presentation on theme: "Typed MPI - A Data Type Tool for MPI Nitin Bahadur and Florentina Irina Popovici { bnitin, pif"— Presentation transcript:

1 Typed MPI - A Data Type Tool for MPI Nitin Bahadur and Florentina Irina Popovici { bnitin, pif } @cs.wisc.edu

2 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 Why a Data Type Tool for MPI? zNo type message at receiver end zUser 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 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 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)

4 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 Design Overview Code generated at compile time. It will perform: signature generation data and signature packaging signature checking (receiver end) error reporting Support for runtime

5 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 How does Typed MPI work ? zPhase 1: preprocess the user files ydetermine the types of the wrapper call parameters ygenerate signature ygenerate code for packaging data ygenerate code for sending/receiving data ygenerate code for error checking/reporting zPhase 2: runtime yExecute the program, make the actual MPI calls and do error checking and reporting

6 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 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 p[5] and char q[5] 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 receiver’s end with the expected signature (an error code will be returned to the sender ) Send / Receive Protocol Type Checking Receive Success/Error Sender Receiver Send data Code Receive Data Check Type Return Error / Success Code

7 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 Signature encompasses entire type of a variable struct example1 { int a; float b[5]; } VAR_START STRUCT_START TYPE_INT TYPE_ARRAY TYPE_FLOAT 1 1 STRUCT_START 5 struct eg1 { int a; struct eg2 { int b; float b[5] } depth first approach to signature construction type of a variable is broken down recursively to generate the signature { START, VAR_START, STRUCT_START, TYPE_INT, 1, TYPE_ARRAY, TYPE_FLOAT, 5, ST_UN_END, END } Recongnition of a complex C struct Signature

8 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 Preprocessing steps / * 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);... /* generated file 1 */ int MPI_Wrapper_Send79205397130821 (int, int, MPI_Comm, void *, int, void * int) { /* signature and data packaging, error reporting */ } /* generated file 2 */ int MPI_Wrapper_Recv 792053971345131 (int, int, MPI_Comm, MPI_Status *, void *, int, void *, int) { /* signature and data packaging, error reporting */} Preprocessor and generator Compilation Files resulting after preprocessing and source code generation Executable A new file is generated for every MPI_Wrapper call and it contains code for that call

9 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 Performance 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.

10 Nitin Bahadur, Florentina Irina Popovici, Dec 1999 Conclusions 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


Download ppt "Typed MPI - A Data Type Tool for MPI Nitin Bahadur and Florentina Irina Popovici { bnitin, pif"

Similar presentations


Ads by Google