Title: Applying the collective entity concept to POP-C
1Applying the collective entity concept to POP-C
- Pierre Kuonen Christian Pérez
- EIA-Fr INRIA
- WP3 Task 3.1
- Krakow Meeting, June 27th 2006
2Outline
- Context
- Collective entities
- POP-C
- Collective entities in POP-C
- Conclusion
3Context
- Work started during a short visit of Christian
Pérez to EIA-Fr (January 2006) - Collective entity set up to specify MxN
communications between two parallel codes - Originally developed for distributed parallel
objects (PaCO) and components (GridCCM) - POP-C object oriented programming model for
based on task programming
4Collective entity issue
MPI
PVM
Parallel code A
Parallel code B
How to easily and efficiently handle MxN
communications?
5Collective entity objective
What the application designer should see
HPC Entity A
HPC Entity B
and how it must be implemented!
Coll. Entity. A
Coll Entity B
6Collective entity overview (1/3)
- Abstract model
- Foundation for building other models
- CE CORBA PaCO Distributed parallel objects
- CE CCM GridCCM Distributed parallel
components - Made of four models
- Definition of a distributed collective entity
- Connection and communication model
- Dynamic and parallel connections
- MxN data management model
- Support for unlimited data redistribution methods
- Exception handling model in a communication
7Collective entity overview (2/3)
- Definition of a distributed collective entity
- May have managers
8Collective entity overview (3/3)
- Specialization the connection managers
- Input proxy
- Enable a unique (logical) connection point
- Hide the parallel nature of the collective entity
- Output proxy
- Deals with out connection requests
- Deals with the scalar or parallel nature of
remote entity
i
j
9The POP Model Parallel OO Programming
Grid environment
Object
Object
execute
Object
Obj
Object
Object
- Distributed objects
- Heterogeneous
- Dynamic
- Autonomous
- Heterogeneous
- Large scale
- Unstructured
- Dynamic and unknown topology
10POP An extension of the OO sequential model
- Generalization of the concept of (sequential)
object - But objects can be efficiently executed on
different machines .nevertheless modifies as
little as possible the OO sequential semantic - The good proprieties of OO programming paradigm
must be conserved - Encapsulation, Interaction by method invocations,
Inheritance, Polymorphism, - Parallel object
- Various method invocation semantics
- Transparent and dynamic object allocation guided
by the object resources need. - Shareable, transmissible
- No explicit send/receive
- No (as few as possible) loss of performance
11POP communication model
- The POP model uses the Inactive objects model
- Objects are active only when an method is
invocated - Asynchronous method invocation is possible
- The POP model defines three ways to execute a
method - Concurrent
- No order no atomicity
- Sequential
- Ordered and atomic regarding others sequential
methods invocations - Mutex
- Totally ordered and atomic
12Method call semantics example
13POP-C exemple
File integer.h 1 class Integer 2
public 3 Integer(int wanted, int mini) 4
Integer(char machine) 5 void Set(int
val) 6 int Get() 7 void Add(Integer
other) 8 private 9 int data 10
parclass Integer
_at_powergtwanted? mini
_at_hostmachine
seq async void Set(int val)
conc int Get()
mutex void Add(Integer other)
14Collective entity and POP-C
- Objective
- Support parallel object implementation
- Example embed a MPI code into a POP-C object
- Definition
- A collective entity in POP-C is a collection
(list) of objects of the same class acting
altogether as an SPMD program - Features
- Invoke a method on all elements (global view)
- Invoke a method on a particular element
(individual view)
Object
Object
15Collective method
- Rationale
- Enable a method to be collectively called on all
elements of the collective entity - Support for distributed parameters
- Declare with a dedicated keyword coll
b0
a0
o
ipa
opa
b1
ipb
opb
a1
b2
float x6
void foo(float x)
void bar(float x)
16Group invocation (special case)
- Rationale
- Invoke the method on all the elements of the
collective entity - The parameters are replicated (broadcast mode)
- Declare with a dedicated keyword all
b0
a0
ipa
opa
o
b1
ipb
opb
a1
b2
float x6
void foo(float x)
void bar(float x)
17Scalar method in collective entity
- Rationale
- Invoke a scalar method of a collective entity
- Define the selected element of the collective
entity - 4 regular cases have been selected
- first the first instance of the collection
- last the last instance of the collection
- any any instance of the collection can be
selected - random the instance is randomly chosen
b0
o
b1
ipb
opb
b2
18POP-C and collective entity example
- class MySPMDclass
-
- public
-
- coll async conc void doComputation()
- first sync mutex float getResult()
- sync seq void aMethod()
gt Structural keywords (coll,first, ) are
orthogonal to behavioral keywords (sync, async,
)
19Helper template to create collective object
- Two possibilities
- Add a new keyword to the language
- Use a template
- Second solution preferred
- template ltparclass SPMDprocgt
- parclass POPspmd
-
- public
- POPspmd() // n 1
- POPSpmd(int n)
- SPMDproc getSPMDprocRef(int no)
- int getSPMDsize()
20Example of use (1/2)
- // Create a collective entity of 10 elements
- POPsmpdltMySPMDclassgt mySPMDobject(10)
- // collective call from any kind of object
- mySPMDobject.doComputation() // method is coll
- // retrieve the result
- float r mySPMDobject.GetResult() // method is
first - // retrieve the result from proc 4
- float r mySPMDobject.GetSPMDProcRef(4)-gtGetResul
t()
21Handling distributed data
- Current rationale
- Attach a distribution to parameters
- Define distribution as template
- Inherit from dataDistribution interface
- Contains methods called by the runtime to compute
MxNcommunication as define in the collective
entity model - Example block cyclic for vectors
- template ltTgt class BCvectorltvectorltTgtgt public
dataDistribution - public
- // methods for end-user
-
- // methods from dataDistribution
- computeSchedule()
-
- private
- vectorltTgt data // example of private data to
store - unsigned offset // the local part of the vector
22Conclusion
- Joint work
- Apply the collective entity model to POP-C
- Most of the rationale has been set up
- Not presented support of reduction operations
- Specializations of the CE for POP-C
- Individual access to any element of the CE
- Peaceful cohabitation of
- Regular C method,
- Scalar POP-C methods, and
- Collective methods!
- Perspective
- Finish the rationale for the TR