Você está na página 1de 51

The Use of Connectors in

Parallel Simulators with Deep


Hierarchical Structure

Felix C. G. Santos
Eduardo R. R. Brito Jr.
José Maria B. Silva

Department of Mechanical Engineering


Federal University of Pernambuco
Brazil
fcgs@demec.ufpe.br
Outline

3. Structure of FEM simulators and


MPhyScas-S
4. The Problem
5. A solution - The structure of MPhyScas-P
6. A solution – coordinating and connecting
parallel pieces
7. Final remarks
1. The Structure of FEM simulators Loops for time 
stepping, models 
adaptation and 
articulation of several 
solutions algorithms
Articulates a number of 
solvers; time stepping 
Layers of FEM simulators procedures; nonlinear 
Responsible for 
solvers
assembling and 
solving algebraic 
Overall scenery of the 
simulation Responsible for 
systems
computing and 
Global iterative loops assembling  matrices 
Solution algorithms
and vectors at finite 
Articulation of solvers element level
Solution of algebraic 
Solvers systems (global matrices 
and vectors)
Phenomena
Computing and 
assembling local matrices 
na vectors
Layer representation in MPhyScas­S
Multi­Physics and multi­Scales framework

Loops / adaptive iterations Kernel

Articulation of solvers Blocks

Solvers Groups

Phenomenon Phenomenon

1. SANTOS, F. C. G., LENCASTRE, MariaAn Approach for FEM Simulator  Development. Journal of 
Computational and Applied Mathematics., v.185, p.326 ­ 346, 2006.
2. SANTOS, F. C. G., VIEIRA, Mardoqueu Souza, LENCASTRE, Maria Workflow for Simulators Based on 
Finite Element Method. Lecture Notes in Computer Science. , v.2658, p.555 ­ 564, 2003 
3. SANTOS, F. C. G., LENCASTRE, Maria FEM Computational Phenomenon In: The Fourth Latin American 
Conference on Pattern Languages of Programming ­ SugarLoafPloP'2004, 2004, Porto das Dunas.   
SugarLoafPloP Proceedings. , 2004. p.11 ­ 22
Layer representation in MPhyScas­S

DAGs Workflows

Data­programmable Kernel
Procedures
Large Data Structs
BLAS, Solvers Blocks

Groups

Solve Operate Solve Operate Solve Operate Phenomenon


K.U=F,  F=F1+F2 K.U=F,  a=||U|| K.U=F,  F=M.G
Geometry related
Procedures
Geom Data, meshes G(i)=G(i)+g(m)

K(i,j)=K(i,j)+r(m,n)
Layers behavior in MPhyScas­S
Layers behavior in MPhyScas­S
Layers behavior in MPhyScas­S

Phenomena 
share States 
(matrices, vectors 
and scalars)
2. The Problem: 

How to develop parallel simulators using a structure 
as close as possible to the structure of the sequential 
simulator.

Objective: 

To reduce reprogramming without compromising 
too much the simulator performance
3. A solution – the structure of MPhyScas­P:
­ Use the structural tree hierarchy of the simulator

­ Parallelize the hierarchy, starting with one process in the higher level, 
ending up with all processes working in the lower level (tree of processes)

­ Move storage of matrices and vectors from the Group Level to the 
Phenomenon Level (special Phenomenon objects will manage them and 
associated communicators)

­ Move solvers for linear systems from the Group Level to the Phenomenon 
Level (same special Phen objects where data structures are storaged)

­Establish a control communication protocol between Coordinator 
processes and the clone processes through connectors

­Establish a data transfer communication protocol between processes, 
which have common boundaries, where coupled information should be 
exchanged, through connectors
Layer representation in MPhyScas­P

DAGs Workflows

Data­programmable Kernel
Procedures
Data Struct Description
Blocks

Groups

Articulate Phen Articulate Phen Articulate Phen Phenomenon


Geometry related To solve, operate To solve, operate To solve operate
Procedures
Geom Data, meshes
Large Data Structures G(i)=G(i)+g(m)
BLAS, Solvers K(i,j)=K(i,j)+r(m,n)
BLAS
Solvers
Kernel Level

Kernel

Block i
Block j

Group j Group k
Group k

Ph r
Ph r Ph s Ph m Ph n Ph s
Ph m Ph n Ph q Ph o Ph p
DSr1
DSr2 qrx
Solver DSm1 Solver
DSm1 DSr1 DSm2
qrx
DSm2 DSr2
Solver

Special Phens
Block Level

Block i
Block j

Group j Group k
Group k

Ph r
Ph r Ph s Ph m Ph n Ph s
Ph m Ph n Ph q Ph o Ph p
DSr1
DSr2 qrx
Solver DSm1 Solver
DSm1 DSr1 DSm2
qrx
DSm2 DSr2
Solver
Group Level

Group j Group k
Group k

Ph r
Ph r Ph s Ph m Ph n Ph s
Ph m Ph n Ph q Ph o Ph p
DSr1
DSr2 qrx
Solver DSm1 Solver
DSm1 DSr1 DSm2
qrx
DSm2 DSr2
Solver
Phenomenon Level

Ph r
Ph r Ph s Ph m Ph n Ph s
Ph m Ph n Ph q Ph o Ph p
DSr1
DSr2 qrx
Solver DSm1 Solver
DSm1 DSr1 DSm2
qrx
DSm2 DSr2
Solver
Simulator Parallel Structure 
Simulator Parallel Structure 
Interactions to be
Kernel Level Taken care of

Block Level

Group Level

Phenomenon Level
Kernel Level Process 
Block Level Processes 
Group Level Processes 
Phenomenon Level Processes 
4. A solution – coordinating and connecting 
parallel pieces

What are software connectors:

­prefabricated, heterogeneous components that provide complex 
functionality and engage in complex interactions.

­ Although components have been the predominant focus of researchers 
and practitioners, they address only one aspect of large­scale development. 
Another important aspect, particularly magnified by the emergence of the 
Internet and the growing need for distribution, is interaction among 
components. Component interaction is embodied in the notion of software 
connectors.

Ref.: Nikunj R. Mehta, Nenad Medvidovic,Sandeep Phadke, “Towards a 
Taxonomy of Software Connectors”
What are software connectors (cont.):

­ Connectors manifest themselves in a software system as shared variable 
accesses, table entries, buffers, instructions to a linker, procedure calls,
networking protocols, pipes, SQL links between a database and an 
application, and so forth. In large, and especially distributed systems, 
connectors become key determinants of system properties, such as 
performance, resource utilization, global rates of flow, scalability, 
reliability, security, evolvability, and so forth.

­ They typically separate computation (components) from interaction 
(connectors) in a system.  All software connectors comprise one or more 
ducts, interaction channels with no associated behavior; furthermore, all
connectors, regardless of their complexity, provide mechanisms for 
transferring data and/or control along a duct.

Ref.: Nikunj R. Mehta, Nenad Medvidovic,Sandeep Phadke, “Towards a 
Taxonomy of Software Connectors”, Proceedings of the 22nd international 
conference on Software engineering, pag 178 – 187,   2000
Connector
Node: KernelNode, BlockNode, DerivedClass: KernelConn,
GroupNode, PhenNode BlockConn, GroupConn, PhenConn

BaseClass (Legacy code): Kernel,


1..1 1..n Block, Group and Phenomenon

Node: when head of process, it Clone processes


recieves a remote call and
transfers it to the right component

DerivedClass: when not the


Head of process, it receives a call
from its node and transmits it to
its clone processes, before
executing the method of its base class

Purpose is procedure call (communication and coordination services) with one 
dimension with values Kernel, Block, Group and Phenomenon.
Kernel Level
Kernel

Block j Block i

Group j Group k
Group k

Ph r
Ph r Ph s Ph s
Ph m Ph n
Ph q Ph p
Ph m Ph n
Kernel Level
Kernel
External call
(local)
Clone processes

Clone processes
Block j Block i

Group j Group k
Group k

Ph r
Ph r Ph s Ph s
Ph m Ph n
Ph q Ph o Ph p
Ph m Ph n

Clone processes
Block Level

External call
(Remote)

Clone processes
Block j Block i

Group j Group k
Group k

Ph r
Ph r Ph s Ph s
Ph m Ph n
Ph q Ph o Ph p
Ph m Ph n

Clone processes
Group Level

External call
(Remote)

Group j Group k
Group k

Ph r
Ph r Ph s Ph s
Ph m Ph n
Ph q Ph o Ph p
Ph m Ph n

Clone processes
Phenomenon Level

External call
(Remote)

Ph r
Ph r Ph s Ph s
Ph m Ph n
Ph q Ph o Ph p
Ph m Ph n
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
Process a – Level L_0
MasterProces Processes c_0­c_n – Level_1
s CloneProcesses

Process b – Level_0 Processes d_0­d_m – Level_2

CloneProcesses

...

... ...

... ...
5. Final remarks:
• The structure of MPhyScas-S (sequential simulators) was presented
together with the problem of its parallelization
• A solution to this problem was described, which kept the hierarchical
structure of MPhyScas-S in a parallel fashion.
• Special connectors were used in order to bind the pieces of code
distributed among many processes
• Other type of connector is also used (for coupled data transfer between
processes), but was not described.
• Stage of project: prototype still under construction. It will allow for three
more levels, totalling 7 levels.
• Main benefits expected:
– loose (local only) hierarchical coordination of processes allows for more
asynchronous processing.
– Legacy code was almost completely used without modification (all properties of
MPhyScas-S are inherited)
– No control communication is needed in the lower levels of computation
– Hierarchical refinement produces more locality awareness
– Allows for dynamic scheduling
• Difficulties:
– Preprocessing is problematic, because the data for each process should
resemble the data for the sequential simulators, eventhough it is partitioned
– The use of the hierarchy for data distribution is good because only few
processes are involved at a time. However, book keeping is not so trivial.

Você também pode gostar