• No results found

GridModelica: Modeling and Simulating on the Grid

N/A
N/A
Protected

Academic year: 2021

Share "GridModelica: Modeling and Simulating on the Grid"

Copied!
21
0
0

Loading.... (view fulltext now)

Full text

(1)

GridModelica: Modeling and

Simulating on the Grid

Håkan Mattsson, Christoph W. Kessler, Kaj Nyström, Peter Fritzson

Programming Environments Laboratory PELAB Department of Computer and Information Science

Linköping University Sweden

(2)

Modeling on Linux Clusters

• Widely used for large models

• Requires expertise in parallel programming • Excellent for run-many-times simulations, not so good for run-once simulations

(3)

GridModelica

• Structured modeling on clusters

• Does not require parallel programming expertise • Domain agnostic (multidomain works too!)

• Graphical programming, close to physical prototyping • The magic is done behind the scenes

(4)

High Level Modeling: Modelica

• Graphical or textual • Acausal • General • Fast • Easy to use • Object oriented

(5)

More on Modelica

• Graphical representation corresponds 1:1 to textual representation

model dcmotor Import Modelica.Electrical.Analog.Basic; Resistor r1(R=10); Inductor i1; EMF emf1; Modelica.Mechanics.Rotational.Inertia load; Ground g; Modelica.Electrical.Analog.Sources.ConstantVoltage v; equation connect(v.p, r1.p); connect(v.n, g.p); connect(r1.n, i1.p); connect(i1.n, emf1.p); connect(emf1.n, g.p); connect(emf1.flange_b, load.flange_a); end dcmotor;

(6)

Problems

1.

Partition the model

3.

Structured communication

(Håkan Mattsson)

(7)

Partitioning a model

Some observations

• It is all about solving large systems of equations • Parallel solvers exist but can not always be applied (stability issues) and do not always improve speed.

(8)

Transmission Line Modeling

[1]

All propagation in a model (waves, force, current etc)

is done with a certain

delay.

Use this delay to send data less frequently.

(9)

Transmission Line Modeling

• Reuse values

• Different solvers (and settings) for different parts of a system

• Communication in bulk

• The error introduced is well defined and generally very small.

(10)
(11)
(12)

GridNestStep

For grid applications with a non-trivial structure of parallelism,

generation of efficient, scalable code is an unsolved problem

Goal – to provide an ”easy-to-use” programming environment

by introducing a programming language, GridNestStep, that

supports

– development of applications exploiting less trivial kinds of parallelism – a virtual shared memory view of a grid system

(13)

GridNestStep

GridNestStep

– follows the Bulk Synchronous

Parallel (BSP) model of

computation

– will be based on NestStep

BSP

– cost model for parallel programs

– Single Program, Multiple Data execution style, (SPMD) – organizes program in supersteps consisting of

1 – computation 2 – communication Superstep P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 using local data only Global barrier Next barrier Local computation Communication phase (message passing) Time

(14)

NestStep

NestStep [Kessler, 2000]

– parallel programming language for the BSP model – language extensions for Java / C / C++

Extends BSP by

– static and dynamic nesting of supersteps

– synchronization of processor subsets (groups) – software emulation of virtual shared memory

• step { neststep(2, @=expr) {

statements statements

(15)

NestStep

Variables, arrays and objects are

– private to a processor or

– shared between a group of processors

Modes of sharing:

– replicated, local copy on each processor in a group

– distributed, an array partitioned between processors in a group

NestStep superstep invariants:

– superstep synchronicity, all processors of the same group work on same superstep

– superstep consistency: entry to a (nest)step statement ⇒

(16)

NestStep

Communication in processor

groups organized as trees

Superstep consistency

maintained by a combine

phase at the end of each

superstep

– upwards combine – downwards commit 0 1 4 7 P P P P P2 P3 P5 P6

(17)

GridNestStep

Cluster 1 Cluster 2 Cluster 3

Scheduler Current superstep divided into workpackages Grid platform C program using NestStep runtime library

(18)

GridNestStep

Some (known) problems to be solved:

– superstep analysis and partitioning into workpackages: - how to monitor load and

- perform load balancing accordingly – latency

– failing grid nodes – code distribution

(19)

Current status

Parameter sweep tool for Modelica works fine

(Modelica runs on the grid!)

Partial test implementation for TLM in Modelica exists

Only very simple examples works for now

Partitioning only by hand and only in textual model

(no drag’n drop tool support yet)

(20)

Generalize the partitioning method to all physical domains

Automatic partitioning at domain boundaries and natural

subsystem borders

Automatic solver and step size selection

Better scheduling

Co-simulation integration (with SKF)

Continue with multi-cluster support and transition to SweGrid

NestStep front end

(21)

References

Related documents

The platform- specific implementation executed faster almost 3 times more often than its Haxe-compiled counterpart, which resulted in the sum of ranks for Haxe-compiled

In the Steamroller programming language, there tables are a built-in feature to reduce the amount of code required to create and access a table.. The feature also add more type

The absolute long addressing mode has a three-byte operand; the first two bytes are loaded into the program counter as before, while the third byte is loaded

The Google Friend Connect JavaScript API works in addition to the basic usage of Google Friend Connect, where access to OpenSocial content is through the hosting of gadgets or

Used with equal frequency by startups according to the 105 interviews data, Jira, Asana and Trello are project man- agement tools widely adopted to document and display

IBM Watson is in ongoing development, from universities to companies it is currently being used. Companies such as Macy's have created a mobile service in which customers can ask

The first algorithm is based on abstract convex programming while the second one on semidefinite program- ming.. Then we show how duality gap can be closed by means of facial

We have developed Sensors framework using Android API, which gives latest value of all possible sensors used in mobile phones, and notify end user programming about sensor