Algorithm Engineering
„Parallele Algorithmen“
Stefan Edelkamp
Übersicht
Parallele Externe Suche
Parallele Verspätete Duplikatselimination
Parallele Expansion
Verteilte Sortierung
Parallele Strukturierte Duplikatselimination
Disjunkte Duplikatserkennungsbereiche
”Schlöser”
Parallele Algorithmen
Matrix-Multiplikation
List Ranking
Euler Tour
Verteilte Suche
Distributed setting provides more space.
Experiments show that internal time dominates I/O.
Exploiting Independence
Since each state in a Bucket is independent of the other – they can be expanded in
parallel.
Duplicates removal can be distributed on different
processors.
Bulk (Streamed) transfers much better than single ones.
Distributed Queue for Parallel Best- First Search
P0
P1
P2
<15,34, 0, 100>
<g, h, start byte, size>
<15,34, 20, 100>
TOP
<15,34, 40, 100>
<15,34, 60, 100>
Multiple Processors - Multiple Disks Variant
Sorted
buffers w.r.t the hash val Sorted Files
P1 P2 P3 P4
Divide w.r.t the hash ranges Sorted
buffers from every
processor Sorted File
h0 ….. hk-1 hk ….. hl-1
Parallel External A*
Parallel External A*
Distributed Heuristic Evaluation
Assume one child processor for each tile one master processor
B3 B1 B2
B8
B4 B5 B6 B7 B9 B10 B11 B12 B13 B14 B15 B0
B3 B1 B2
B8
B4 B5 B6 B7 B9 B10 B11 B12 B13 B14 B15 B0
Distributed Pattern Database Search
Only pattern databases that include the client tile need to be loaded on the client
Because multiple tiles in pattern, from birds eye PDB loaded multiple times
In 15-Puzzle with corner and fringe PDB this saves RAM in the order of factor 2 on each machine, compared to loading all
In 36-Puzzle with 6-tile pattern databases this saves RAM in the order of factor 6 on each machine, compared to loading all
Extends to additive pattern databases
Distributed
Heuristic Evaluation
Same bottleneck in external-memory search
Bottleneck: Duplicate detection
Duplicate paths cause parallelization overhead
A
C D
BB
C DDDD
Internal memory External memory vs.
fast slow
A
Disjoint duplicate-detection scopes
B1
B0 B4
B0 B1 B2 B3
B8
B4 B5 B6 B7 B9 B10 B11 B12 B13 B14 B15 B0 B1
B4
B3 B2
B7
B2
B3 B7
B12 B8
B13 B14 B15 B11 B8
B12 B13 B15 B11 B14
Finding disjoint duplicate-detection scopes
B1
B0 B4
0 0 0 0
0
0 0 0 0
0 0 1
0 0 0 0
0 1 1
0 2
1
B2
B3 B7
0 1 0
B8
B12 B13 B15 B11 B14
1
2 2
01 2
2 2
2 1 2
2
2 2
2
0 1
1 1
0
1 0
2
3 3
2 B1
B5 B6 B4 B9
2
3
3
4 3
3
Implementation of Parallel SDD
Hierarchical organization of hash tables
One hash table for each abstract node
Top-level hash func. = state-space projection func.
Shared-memory management
Minimum memory-allocation size m
Memory wasted is bounded by O(m#processors)
External-memory version
I/O-efficient order of node expansions
I/O-efficient replacement strategy
Benötigt nur ein Mutex
“Schloss”
B3 B1 B2
B8
B4 B5 B6 B7 B9 B10 B11 B12 B13 B14 B15 B0
Parallelle Matrix-
Multiplication
Parallele Matrix
Multiplication
Exklusives Schreiben
Parallele Kopien
Fazit Matrix
Multiplication
Paralleles List Ranking
List
Ranking
Erster Algorithmus
Prinzip
Komplexität
Verbesserungen
Strategie
Unabhängige Mengen
2-Färbung
Reduktion
Restauration
Beispiel
Variablen
Beispiel (ctd.)
Pseudo Code
Nächster Schritt
Analyse
Backup
Algo
Algo
Speicher
Analyse
Ausblick:
Randomisiert in O(n) whp?
Probleme mit DFS
Idee Euler Tour
Parallel DFS
DFS
Nummern
Allgemein
Allgemein
Allgemein
Beispiel
Ein Zyklus oder
mehrere?
Korrektheit
Korrektheit
Beispiel
Konstruktion Euler
Tour
Fazit Euler Touren
GPU Architektur
Effektivität
Hierarchischer Speicher
Hash-based Partitioning
BFS
Kernel Functions