FluidSim Parallel fluid particle simulation and visualization by - - PowerPoint PPT Presentation

fluidsim
SMART_READER_LITE
LIVE PREVIEW

FluidSim Parallel fluid particle simulation and visualization by - - PowerPoint PPT Presentation

UNIVERSITT HAMBURG PRAKTIKUM PARALLELE PROGRAMMIERUNG FluidSim Parallel fluid particle simulation and visualization by Paul Bienkowski 2bienkow@informatik.uni-hamburg.de September 24, 2014 Contents 1 Introduction 4 Results


slide-1
SLIDE 1

FluidSim

Parallel fluid particle simulation and visualization

Paul Bienkowski

2bienkow@informatik.uni-hamburg.de

by UNIVERSITÄT HAMBURG

PRAKTIKUM „PARALLELE PROGRAMMIERUNG”

September 24, 2014

slide-2
SLIDE 2

Contents

2/25

1 – Introduction

1.1 Motivation 1.2 Particle Model 1.3 Force Model

2 – The Simulator

2.1 Parallelization 2.2 Synchronization 2.3 Data output

3 – The Visualizer

3.1 Basic Technology 3.2 Data Transfer

4 – Results

4.1 Did it work? 4.2 Live Demonstration 4.3 Performance 4.4 Difgiculties 4.5 Problems

5 – Conclusion

slide-3
SLIDE 3

Introduction 3/25

Introduction

slide-4
SLIDE 4

Motivation

Introduction 4/25

slide-5
SLIDE 5

Motivation

Introduction 4/25

slide-6
SLIDE 6

Motivation

Introduction 4/25

slide-7
SLIDE 7

Motivation

Introduction 4/25

Idea

Simulate 2D-particles that repel each other

slide-8
SLIDE 8

Motivation

Introduction 4/25

Idea

Simulate 2D-particles that repel each other

Goal

Simulate an airplane wing and measure lifu

slide-9
SLIDE 9

Motivation

Introduction 4/25

Idea

Simulate 2D-particles that repel each other

Goal

Simulate an airplane wing and measure lifu

Technology

C++11, MPI, OpenMP, SFML

slide-10
SLIDE 10

Particle Model

Introduction 5/25

Each particle has 3 basic properties:

  • 1. position
  • 2. velocity
  • 3. force

Only position and velocity need to be stored across iterations, force is recomputed every iteration.

slide-11
SLIDE 11

Particle Model

Introduction 5/25

Each particle has 3 basic properties:

  • 1. position
  • 2. velocity
  • 3. force

Only position and velocity need to be stored across iterations, force is recomputed every iteration.

slide-12
SLIDE 12

Particle Model

Introduction 6/25

pi pj Any two particles repel each other: forcei := ∑

j

force(

  • pi − pj
  • ) · norm(pi − pj)

The force on a particle afgects its velocity: velocityi := velocityi + forcei · dt The velocity of a particle afgects its position: positioni := positioni + velocityi · dt

slide-13
SLIDE 13

Force Model

Introduction 7/25

force(x) = { F · ( 1 − x−T

D

)P for 0 ≤ x ≤ D + T

  • therwise

where

x is the distance between the particles. F is the force strength factor D is the influence distance T is the distance threshold (particle radius) P is the force power

slide-14
SLIDE 14

Force Model

Introduction 7/25

force(x) = { F · ( 1 − x−T

D

)P for 0 ≤ x ≤ D + T

  • therwise

0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1 distance force P=0.2 P=1 P=2 P=3 P=20

Changing the Force Power (P) F = 1 D = 1 T = 0

slide-15
SLIDE 15

Force Model

Introduction 7/25

force(x) = { F · ( 1 − x−T

D

)P for 0 ≤ x ≤ D + T

  • therwise

0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1 distance force T=0.0 T=0.1 T=0.2 T=0.3

Changing the Distance Threshold (T) F = 1 D = 1 P = 10

slide-16
SLIDE 16

Force Model

Introduction 7/25

force(x) = { F · ( 1 − x−T

D

)P for 0 ≤ x ≤ D + T

  • therwise

I found these values work for the wing simulation: D = 0.001 T = 0.06 P = 1 F = 20

slide-17
SLIDE 17

Meshes

Introduction 8/25

A mesh is a simple polygon, each segment (line) is checked for collision with every particle. Simple linear algebra calculations are made for reflecting particles

  • fg mesh segments.

Mesh Particle This creates a force on the mesh.

slide-18
SLIDE 18

Meshes

Introduction 8/25

A mesh is a simple polygon, each segment (line) is checked for collision with every particle. Simple linear algebra calculations are made for reflecting particles

  • fg mesh segments.

Mesh Particle This creates a force on the mesh.

slide-19
SLIDE 19

Meshes

Introduction 8/25

A mesh is a simple polygon, each segment (line) is checked for collision with every particle. Simple linear algebra calculations are made for reflecting particles

  • fg mesh segments.

Mesh Particle This creates a force on the mesh.

slide-20
SLIDE 20

The Simulator 9/25

TheSimulator

slide-21
SLIDE 21

Parallelization

The Simulator 10/25

each particle has to be updated (simple for loop) → threading trivial with OpenMP particles can be distributed across multiple processes → Domain Grid

P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11

slide-22
SLIDE 22

Parallelization

The Simulator 10/25

each particle has to be updated (simple for loop) → threading trivial with OpenMP particles can be distributed across multiple processes → Domain Grid

P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11

slide-23
SLIDE 23

Synchronization

The Simulator 11/25 P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11

(a) Checkerboard

P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11

(b) Stripes

Modes of Domain coloring

Mode Sending Receiving Directions 1. Checkerboard black white N, E, S, W 2. Checkerboard white black N, E, S, W 3. Stripes black white NE, SE, SW, NW 4. Stripes white black NE, SE, SW, NW

slide-24
SLIDE 24

Data output

The Simulator 12/25

0000000 0020 0000 0001 0000 0004 0000 2710 0000 0000010 1387 0000 0000 0000 1389 0000 0000 0000 0000020 8a72 d187 c4bb 3fa1 73d1 4e75 d95f 3fbe 0000030 d3f4 2c9a cf42 3fbc b890 9e75 5a61 3fc1 ... 00013a7 9aa6 af8e c353 3fc7 1df2 1539 3ec1 3fc3 00013b7 c065 7825 f853 3fb3 717a c31f 1f55 3fc3 ... Header length: 32 bytes Iteration number: 1 Number of processes: 4 Particle count: 10000 Particle count by process: 4999 / 0 / 5001 / 0 Particle positions of P1 (x1, y1, x2, y2, ...) Particle velocities of P1

slide-25
SLIDE 25

The Visualizer 13/25

TheVisualizer

slide-26
SLIDE 26

Basic Technology

The Visualizer 14/25

SFML for window, input, rendering (OpenGL inside) Load Iterations into memory Play/Pause/Live Difgerent display modes (coloring of particles)

slide-27
SLIDE 27

Data Transfer

The Visualizer 15/25

How is data transfered from Simulator to Visualizer? Socket/Network/MPI? too complicated SSHFS status file contains metadata

number of iterations grid size

visualizer reads status in regular intervals

slide-28
SLIDE 28

Data Transfer

The Visualizer 15/25

How is data transfered from Simulator to Visualizer? Socket/Network/MPI? too complicated SSHFS status file contains metadata

number of iterations grid size

visualizer reads status in regular intervals

slide-29
SLIDE 29

Data Transfer

The Visualizer 15/25

How is data transfered from Simulator to Visualizer? Socket/Network/MPI? → too complicated SSHFS status file contains metadata

number of iterations grid size

visualizer reads status in regular intervals

slide-30
SLIDE 30

Data Transfer

The Visualizer 15/25

How is data transfered from Simulator to Visualizer? Socket/Network/MPI? → too complicated SSHFS status file contains metadata

number of iterations grid size

visualizer reads status in regular intervals

slide-31
SLIDE 31

Data Transfer

The Visualizer 15/25

How is data transfered from Simulator to Visualizer? Socket/Network/MPI? → too complicated SSHFS status file contains metadata

number of iterations grid size

visualizer reads status in regular intervals

slide-32
SLIDE 32

Results 16/25

Results

slide-33
SLIDE 33

Did it work?

Results 17/25

slide-34
SLIDE 34

Did it work?

Results 17/25

slide-35
SLIDE 35

Live Demonstration

Results 18/25

slide-36
SLIDE 36

Performance

Results 19/25

All measurements were made with IO disabled, no particle data was recorded.

slide-37
SLIDE 37

Performance

Results 19/25

All measurements were made with IO disabled, no particle data was recorded.

slide-38
SLIDE 38

Performance

Results 19/25

All measurements were made with IO disabled, no particle data was recorded.

slide-39
SLIDE 39

Difgiculties

Results 20/25

MPI file input/output was hard to get working, miscalculated seek ofgsets etc. lots of segmentation faults and uninitialized values

Cannot insert: Count 0xdeafbeed >= Size 0xdeafbeed. fluidsim: Quickset.hpp:14: Assertion ‘count < size’ failed. Aborted. Segmentation fault. (gdb) frame 3 (gdb) print buf $1 = 0xdeafbeeddeafbeed;

2D collisions are not that trivial the model (uplifu) did not work out until I implemented surface damping

slide-40
SLIDE 40

Difgiculties

Results 20/25

MPI file input/output was hard to get working, miscalculated seek ofgsets etc. lots of segmentation faults and uninitialized values

Cannot insert: Count 0xdeafbeed >= Size 0xdeafbeed. fluidsim: Quickset.hpp:14: Assertion ‘count < size’ failed. Aborted. Segmentation fault. (gdb) frame 3 (gdb) print buf $1 = 0xdeafbeeddeafbeed;

2D collisions are not that trivial the model (uplifu) did not work out until I implemented surface damping

slide-41
SLIDE 41

Difgiculties

Results 20/25

MPI file input/output was hard to get working, miscalculated seek ofgsets etc. lots of segmentation faults and uninitialized values

Cannot insert: Count 0xdeafbeed >= Size 0xdeafbeed. fluidsim: Quickset.hpp:14: Assertion ‘count < size’ failed. Aborted. Segmentation fault. (gdb) frame 3 (gdb) print buf $1 = 0xdeafbeeddeafbeed;

2D collisions are not that trivial the model (uplifu) did not work out until I implemented surface damping

slide-42
SLIDE 42

Difgiculties

Results 20/25

MPI file input/output was hard to get working, miscalculated seek ofgsets etc. lots of segmentation faults and uninitialized values

Cannot insert: Count 0xdeafbeed >= Size 0xdeafbeed. fluidsim: Quickset.hpp:14: Assertion ‘count < size’ failed. Aborted. Segmentation fault. (gdb) frame 3 (gdb) print buf $1 = 0xdeafbeeddeafbeed;

2D collisions are not that trivial the model (uplifu) did not work out until I implemented surface damping

slide-43
SLIDE 43

Problems

Results 21/25

sofuware not optimized for RAM usage → can’t run more than 6 processes locally memcpy is slow 16 send/receive operations on a 12-node cluster, probably room for improvement, however this method scales to every cluster size

slide-44
SLIDE 44

Problems

Results 21/25

sofuware not optimized for RAM usage → can’t run more than 6 processes locally memcpy is slow 16 send/receive operations on a 12-node cluster, probably room for improvement, however this method scales to every cluster size

slide-45
SLIDE 45

Problems

Results 21/25

sofuware not optimized for RAM usage → can’t run more than 6 processes locally memcpy is slow 16 send/receive operations on a 12-node cluster, probably room for improvement, however this method scales to every cluster size

slide-46
SLIDE 46

Problems

Results 21/25

sofuware not optimized for RAM usage → can’t run more than 6 processes locally memcpy is slow 16 send/receive operations on a 12-node cluster, probably room for improvement, however this method scales to every cluster size

slide-47
SLIDE 47

Problems

Results 21/25

sofuware not optimized for RAM usage → can’t run more than 6 processes locally memcpy is slow 16 send/receive operations on a 12-node cluster, probably room for improvement, however this method scales to every cluster size

slide-48
SLIDE 48

Conclusion 22/25

Conclusion

slide-49
SLIDE 49

Conclusion

Conclusion 23/25

Yes, it works! Even in real-time! Even though O(n2 + nm) with n ∈ O(10000) It looks kind of fancy... I learned a lot.

slide-50
SLIDE 50

Further works

Conclusion 24/25

Load Balancer, based on number of particles in rows/columns SIMD “Ball” particle model (elastic collision of circle shapes) difgerent World Scenarios / presets (gravity, water, ...) animation export

slide-51
SLIDE 51

Further works

Conclusion 24/25

Load Balancer, based on number of particles in rows/columns SIMD “Ball” particle model (elastic collision of circle shapes) difgerent World Scenarios / presets (gravity, water, ...) animation export

slide-52
SLIDE 52

Further works

Conclusion 24/25

Load Balancer, based on number of particles in rows/columns SIMD “Ball” particle model (elastic collision of circle shapes) difgerent World Scenarios / presets (gravity, water, ...) animation export

slide-53
SLIDE 53

Further works

Conclusion 24/25

Load Balancer, based on number of particles in rows/columns SIMD “Ball” particle model (elastic collision of circle shapes) difgerent World Scenarios / presets (gravity, water, ...) animation export

slide-54
SLIDE 54

Further works

Conclusion 24/25

Load Balancer, based on number of particles in rows/columns SIMD “Ball” particle model (elastic collision of circle shapes) difgerent World Scenarios / presets (gravity, water, ...) animation export

slide-55
SLIDE 55

Conclusion 25/25

Thank you for your attention!

Questions?