https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Parallel_QuicksortParallel Quicksort - Versionsgeschichte2025-06-04T09:22:57ZVersionsgeschichte dieser Seite in WikipediaMediaWiki 1.45.0-wmf.3https://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=248236255&oldid=prevPhantsom: /* growthexperiments-addlink-summary-summary:2|1|0 */2024-09-01T19:59:02Z<p>Linkvorschlag-Funktion: 2 Links hinzugefügt.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 1. September 2024, 21:59 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 17:</td>
<td colspan="2" class="diff-lineno">Zeile 17:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Reihenfolge bei der Allokation von Prozessoren an Untermengen wird dynamisch angepasst. Prozessor 1 partitioniert die Menge der Elemente mit Index <math>(1,n)</math>. Die erste entstandene Untermenge, <math>(1, k_{1} - 1)</math>, verarbeitet wieder Prozessor 1 und die zweite, <math>(k_{1} +1, n)</math>, Prozessor 2. Die Menge der Elemente <math>(k_1 + 1, n)</math> ist o.&nbsp;B.&nbsp;d.&nbsp;A. die kleinere von beiden. Daher ist es plausibler, dass diese von Prozessor 2 schneller partitioniert wird. Prozessor 2 fordert also früher als Prozessor 1 für seine Untermengen einen neuen Prozessor an. Infolgedessen verarbeitet Prozessor 2 die eine erhaltene Untermenge, während Prozessor 3 die andere. Wenn Prozessor 1 einen neuen Prozessor anfordert, bekommt er Prozessor 4, weil dieser zurzeit frei ist.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Reihenfolge bei der Allokation von Prozessoren an Untermengen wird dynamisch angepasst. Prozessor 1 partitioniert die Menge der Elemente mit Index <math>(1,n)</math>. Die erste entstandene Untermenge, <math>(1, k_{1} - 1)</math>, verarbeitet wieder Prozessor 1 und die zweite, <math>(k_{1} +1, n)</math>, Prozessor 2. Die Menge der Elemente <math>(k_1 + 1, n)</math> ist o.&nbsp;B.&nbsp;d.&nbsp;A. die kleinere von beiden. Daher ist es plausibler, dass diese von Prozessor 2 schneller partitioniert wird. Prozessor 2 fordert also früher als Prozessor 1 für seine Untermengen einen neuen Prozessor an. Infolgedessen verarbeitet Prozessor 2 die eine erhaltene Untermenge, während Prozessor 3 die andere. Wenn Prozessor 1 einen neuen Prozessor anfordert, bekommt er Prozessor 4, weil dieser zurzeit frei ist.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Das folgende Pseudocode skizziert eine Implementierung von Parallel Quicksort. <math>M</math> bezeichnet die maximale Größe des Array, welcher effizienter mit einem sequentiellen Sortieralgorithmus, z.&nbsp;B. [[Insertionsort]], zu sortieren ist.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Das folgende <ins style="font-weight: bold; text-decoration: none;">[[</ins>Pseudocode<ins style="font-weight: bold; text-decoration: none;">]]</ins> skizziert eine Implementierung von Parallel Quicksort. <math>M</math> bezeichnet die maximale Größe des Array, welcher effizienter mit einem sequentiellen Sortieralgorithmus, z.&nbsp;B. [[Insertionsort]], zu sortieren ist.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang="c"></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang="c"></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PROCEDURE QUICKSORT (L,U);</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PROCEDURE QUICKSORT (L,U);</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 37:</td>
<td colspan="2" class="diff-lineno">Zeile 37:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Dieser Ansatz erreicht eine niedrigere Beschleunigung gegenüber dem sequentiellen Quicksort<ref name=":0">{{Literatur |Autor=Quinn, Michael J. (Michael Jay) |Titel=Instructor's manual to accompany Designing efficient algorithms for parallel computers |Verlag=McGraw-Hill Book Co |Datum=1987 |ISBN=0-07-051072-5}}</ref>.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Dieser Ansatz erreicht eine niedrigere Beschleunigung gegenüber dem sequentiellen Quicksort<ref name=":0">{{Literatur |Autor=Quinn, Michael J. (Michael Jay) |Titel=Instructor's manual to accompany Designing efficient algorithms for parallel computers |Verlag=McGraw-Hill Book Co |Datum=1987 |ISBN=0-07-051072-5}}</ref>.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Um eine <math>n</math>-elementige Menge mit einem Pivotelement aus der gleichen Menge zu partitionieren, braucht man <math>n-1</math> Vergleiche. Es sei angenommen, dass ein Vergleich eine Zeiteinheit braucht. Weiterhin, sei die ursprüngliche Größe des Arrays <math>n=2^k-1</math>, die Anzahl an Prozessoren <math>p=2^m</math> mit <math>m<k</math> und das ausgewählte Pivotelement immer der wahre Median von der zu partitionierenden Untermenge.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Um eine <math>n</math>-elementige Menge mit einem <ins style="font-weight: bold; text-decoration: none;">[[</ins>Pivotelement<ins style="font-weight: bold; text-decoration: none;">]]</ins> aus der gleichen Menge zu partitionieren, braucht man <math>n-1</math> Vergleiche. Es sei angenommen, dass ein Vergleich eine Zeiteinheit braucht. Weiterhin, sei die ursprüngliche Größe des Arrays <math>n=2^k-1</math>, die Anzahl an Prozessoren <math>p=2^m</math> mit <math>m<k</math> und das ausgewählte Pivotelement immer der wahre Median von der zu partitionierenden Untermenge.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Unter diesen Annahmen kann die Anzahl der Vergleiche des sequentiellen Algorithmus durch die folgende Rekurrenzrelation bestimmt werden:</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Unter diesen Annahmen kann die Anzahl der Vergleiche des sequentiellen Algorithmus durch die folgende Rekurrenzrelation bestimmt werden:</div></td>
</tr>
</table>Phantsomhttps://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=246451676&oldid=prevOschoett: /* Laufzeit */ Typo2024-07-04T06:30:45Z<p><span class="autocomment">Laufzeit: </span> Typo</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 4. Juli 2024, 08:30 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 57:</td>
<td colspan="2" class="diff-lineno">Zeile 57:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><math>C_1 = (n+1) \log{p} - 2 (p -1 )</math></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><math>C_1 = (n+1) \log{p} - 2 (p -1 )</math></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In dem zweiten Abschnitt gibt es mehr Untermengen als Prozessoren verfügbar. Wenn es angenommen wird, dass jeder Prozessor <del style="font-weight: bold; text-decoration: none;">gleichviele</del> Vergleiche durchführt, ist die Laufzeit die Anzahl der Vergleiche dividiert durch <math>p</math>. Daher folgt:</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>In dem zweiten Abschnitt gibt es mehr Untermengen als Prozessoren verfügbar. Wenn es angenommen wird, dass jeder Prozessor <ins style="font-weight: bold; text-decoration: none;">gleich viele</ins> Vergleiche durchführt, ist die Laufzeit die Anzahl der Vergleiche dividiert durch <math>p</math>. Daher folgt:</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><math>C_2(n) = T(n) - C_1(n)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><math>C_2(n) = T(n) - C_1(n)</div></td>
</tr>
</table>Oschoetthttps://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=240791111&oldid=prevSquasher: Interwikilink gem. Richtlinie unerwünscht, daher entfernt bzw. angepasst2024-01-03T08:44:39Z<p>Interwikilink gem. <a href="/wiki/Wikipedia:V#ANR" class="mw-redirect" title="Wikipedia:V">Richtlinie</a> unerwünscht, daher entfernt bzw. angepasst</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 3. Januar 2024, 10:44 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 75:</td>
<td colspan="2" class="diff-lineno">Zeile 75:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Der Algorithmus wird in drei Schritten ausgeführt. Erstens wird die ursprüngliche Menge <math>S</math> von <math>n</math> Elementen in <math>p</math> Blöcken aufgeteilt, sodass jeder Block <math>\lceil n/p \rceil</math> Elemente hat, außer der letzte, welcher weniger als <math>\lceil n/p \rceil </math> Elemente haben kann. Jedem Prozessor wird einen Block zugewiesen, d. h. Prozessor <math>i</math> verarbeitet Block <math>i</math>. Ein Pivotelement <math>a</math> wird auswählt und jedem Prozessor mit einem [[<del style="font-weight: bold; text-decoration: none;">:en:Broadcast (parallel pattern)|</del>Parallel Broadcasting]] herausgeschickt.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Der Algorithmus wird in drei Schritten ausgeführt. Erstens wird die ursprüngliche Menge <math>S</math> von <math>n</math> Elementen in <math>p</math> Blöcken aufgeteilt, sodass jeder Block <math>\lceil n/p \rceil</math> Elemente hat, außer der letzte, welcher weniger als <math>\lceil n/p \rceil </math> Elemente haben kann. Jedem Prozessor wird einen Block zugewiesen, d. h. Prozessor <math>i</math> verarbeitet Block <math>i</math>. Ein Pivotelement <math>a</math> wird auswählt und jedem Prozessor mit einem [[Parallel Broadcasting]] herausgeschickt.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem zweiten Schritt markiert jeder Prozessor alle Elemente aus seinem Block mit entweder 0 oder 1, abhängig davon, ob das Element kleiner oder größer als das Pivotelement <math>a</math> ist. Mit einem parallelen [[Präfixsumme#Parallele Berechnung|Präfix Algorithmus]] kann der Rank von jedem Element innerhalb der Gruppe 0 bzw. Gruppe 1 berechnet werden. Die Idee ist, alle Elemente aus allen Blöcken, die mit "0" markiert wurden, vor alle "1"-Elemente aller Blöcken in einem weiteren Array <math>B</math> zu speichern. Der Index vom Element in <math>B</math> wird anhand seines Ranks und der Nummer seines Blocks berechnet. So hat man alle Elemente aus der ursprünglichen Menge <math>S</math> in zwei Teile aufgeteilt – die Menge <math>S_1</math> mit allen "0"-Elementen und <math>S_2</math> mit allen "1"-Elementen.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem zweiten Schritt markiert jeder Prozessor alle Elemente aus seinem Block mit entweder 0 oder 1, abhängig davon, ob das Element kleiner oder größer als das Pivotelement <math>a</math> ist. Mit einem parallelen [[Präfixsumme#Parallele Berechnung|Präfix Algorithmus]] kann der Rank von jedem Element innerhalb der Gruppe 0 bzw. Gruppe 1 berechnet werden. Die Idee ist, alle Elemente aus allen Blöcken, die mit "0" markiert wurden, vor alle "1"-Elemente aller Blöcken in einem weiteren Array <math>B</math> zu speichern. Der Index vom Element in <math>B</math> wird anhand seines Ranks und der Nummer seines Blocks berechnet. So hat man alle Elemente aus der ursprünglichen Menge <math>S</math> in zwei Teile aufgeteilt – die Menge <math>S_1</math> mit allen "0"-Elementen und <math>S_2</math> mit allen "1"-Elementen.</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 85:</td>
<td colspan="2" class="diff-lineno">Zeile 85:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Laufzeit von dem Algorithmus hängt von der Wahl des Pivotelements. Eine Möglichkeit ist, ein zufälliges Element als Pivot zu nehmen.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Laufzeit von dem Algorithmus hängt von der Wahl des Pivotelements. Eine Möglichkeit ist, ein zufälliges Element als Pivot zu nehmen.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Annehmend, kann ein Prozessor eine zufällige ganze Zahl <math>k</math> von dem Bereich <math>\{1,2,.., n\}</math> in konstante Zeit generieren, dann entspricht die Partitionierung mit Pivotelement – das Element mit Index <math>k</math>, einem Random [[Binäre Suche|Binary Search]]. Die Analyse<ref>{{Literatur |Autor=Luc Devroye |Titel=A note on the height of binary search trees |Sammelwerk=Journal of the ACM |Band=33 |Nummer=3 |Datum=1986-05-01 |ISSN=0004-5411 |Seiten=489–498 |DOI=10.1145/5925.5930}}</ref> besagt, dass für die Höhe, <math>H_n</math>, von einem [[<del style="font-weight: bold; text-decoration: none;">:en:Random binary tree|</del>Random-Binary-Search-Tree]] mit <math>n</math> Elementen, gilt <math> \lim_{n \to \infty} (H_n \ln n) = 4.31107... </math>. Daher liegt die Tiefe der Rekursion bei <math>O( \log n)</math>. Das Pivotelement muss zusätzlich noch verschickt werden. Dies erfolgt in <math>O( \log p )</math><ref>{{Literatur |Autor=Vishkin, U. |Titel=Synchronous parallel computation - a survey. |Verlag=Courant Institute of Mathematical Sciences, New York University |Datum=1983-04 |OCLC=1085604497}}</ref>. Jeder Prozessor muss dann die Elemente in seinem Block markieren, die Präfix Summe muss berechnet werden<ref>{{Literatur |Autor=Richard Cole, Uzi Vishkin |Titel=Approximate and exact parallel scheduling with applications to list, tree and graph problems |Sammelwerk=27th Annual Symposium on Foundations of Computer Science (sfcs 1986) |Verlag=IEEE |Datum=1986 |ISBN=0-8186-0740-8 |DOI=10.1109/sfcs.1986.10}}</ref> und die Elemente verschoben werden. Dies braucht gesamt <math>O(n/p + \log p)</math>. Anschließend berechnet man die Gesamtlaufzeit für diesen Fall, diese ist <math>O((n/p)+\log p ) \log n )</math> erwartet.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Annehmend, kann ein Prozessor eine zufällige ganze Zahl <math>k</math> von dem Bereich <math>\{1,2,.., n\}</math> in konstante Zeit generieren, dann entspricht die Partitionierung mit Pivotelement – das Element mit Index <math>k</math>, einem Random [[Binäre Suche|Binary Search]]. Die Analyse<ref>{{Literatur |Autor=Luc Devroye |Titel=A note on the height of binary search trees |Sammelwerk=Journal of the ACM |Band=33 |Nummer=3 |Datum=1986-05-01 |ISSN=0004-5411 |Seiten=489–498 |DOI=10.1145/5925.5930}}</ref> besagt, dass für die Höhe, <math>H_n</math>, von einem [[Random-Binary-Search-Tree]] mit <math>n</math> Elementen, gilt <math> \lim_{n \to \infty} (H_n \ln n) = 4.31107... </math>. Daher liegt die Tiefe der Rekursion bei <math>O( \log n)</math>. Das Pivotelement muss zusätzlich noch verschickt werden. Dies erfolgt in <math>O( \log p )</math><ref>{{Literatur |Autor=Vishkin, U. |Titel=Synchronous parallel computation - a survey. |Verlag=Courant Institute of Mathematical Sciences, New York University |Datum=1983-04 |OCLC=1085604497}}</ref>. Jeder Prozessor muss dann die Elemente in seinem Block markieren, die Präfix Summe muss berechnet werden<ref>{{Literatur |Autor=Richard Cole, Uzi Vishkin |Titel=Approximate and exact parallel scheduling with applications to list, tree and graph problems |Sammelwerk=27th Annual Symposium on Foundations of Computer Science (sfcs 1986) |Verlag=IEEE |Datum=1986 |ISBN=0-8186-0740-8 |DOI=10.1109/sfcs.1986.10}}</ref> und die Elemente verschoben werden. Dies braucht gesamt <math>O(n/p + \log p)</math>. Anschließend berechnet man die Gesamtlaufzeit für diesen Fall, diese ist <math>O((n/p)+\log p ) \log n )</math> erwartet.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem Fall, dass das Pivotelement nicht zufällig gewählt wurde, hängt die Laufzeit des Algorithmus von der Rekursionstiefe und damit auch von dem Verhältnis der Größen <math>S_1</math> und <math>S_2</math> ab. Die Rekursionstiefe vom Algorithmus kann auf <math>O( \log n )</math> begrenzt werden, wenn <math>S_1</math> und <math>S_2</math> ungefähr gleich sind. Dies kann gewährleistet werden, indem die Auswahl des Pivotelements mit dem Parallel Median Finding Algorithm von Akl auf eine EREW PRAM in <math>O(\log \log n)</math> Zeit<ref>Akl, S. G. "Parallel Selection in O(log log n) Time Using O(n/log log n) Processors." ''Technical Report 88-221, Department of Computing and Information Science, Queen's University, Kingston, Ontario'' (1988).</ref> erfolgt. Das Markieren, die Präfix Summe und das Verschieben der Elemente erfolgt analog zu dem anderen Fall. Mit dem [[Brent-Verfahren]] kann folglich der Algorithmus in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministisch implementiert werden.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem Fall, dass das Pivotelement nicht zufällig gewählt wurde, hängt die Laufzeit des Algorithmus von der Rekursionstiefe und damit auch von dem Verhältnis der Größen <math>S_1</math> und <math>S_2</math> ab. Die Rekursionstiefe vom Algorithmus kann auf <math>O( \log n )</math> begrenzt werden, wenn <math>S_1</math> und <math>S_2</math> ungefähr gleich sind. Dies kann gewährleistet werden, indem die Auswahl des Pivotelements mit dem Parallel Median Finding Algorithm von Akl auf eine EREW PRAM in <math>O(\log \log n)</math> Zeit<ref>Akl, S. G. "Parallel Selection in O(log log n) Time Using O(n/log log n) Processors." ''Technical Report 88-221, Department of Computing and Information Science, Queen's University, Kingston, Ontario'' (1988).</ref> erfolgt. Das Markieren, die Präfix Summe und das Verschieben der Elemente erfolgt analog zu dem anderen Fall. Mit dem [[Brent-Verfahren]] kann folglich der Algorithmus in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministisch implementiert werden.</div></td>
</tr>
</table>Squasherhttps://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=234512615&oldid=prev93.202.155.94: Index ist maskulin2023-06-11T10:40:19Z<p>Index ist maskulin</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 11. Juni 2023, 12:40 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 77:</td>
<td colspan="2" class="diff-lineno">Zeile 77:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Der Algorithmus wird in drei Schritten ausgeführt. Erstens wird die ursprüngliche Menge <math>S</math> von <math>n</math> Elementen in <math>p</math> Blöcken aufgeteilt, sodass jeder Block <math>\lceil n/p \rceil</math> Elemente hat, außer der letzte, welcher weniger als <math>\lceil n/p \rceil </math> Elemente haben kann. Jedem Prozessor wird einen Block zugewiesen, d. h. Prozessor <math>i</math> verarbeitet Block <math>i</math>. Ein Pivotelement <math>a</math> wird auswählt und jedem Prozessor mit einem [[:en:Broadcast (parallel pattern)|Parallel Broadcasting]] herausgeschickt.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Der Algorithmus wird in drei Schritten ausgeführt. Erstens wird die ursprüngliche Menge <math>S</math> von <math>n</math> Elementen in <math>p</math> Blöcken aufgeteilt, sodass jeder Block <math>\lceil n/p \rceil</math> Elemente hat, außer der letzte, welcher weniger als <math>\lceil n/p \rceil </math> Elemente haben kann. Jedem Prozessor wird einen Block zugewiesen, d. h. Prozessor <math>i</math> verarbeitet Block <math>i</math>. Ein Pivotelement <math>a</math> wird auswählt und jedem Prozessor mit einem [[:en:Broadcast (parallel pattern)|Parallel Broadcasting]] herausgeschickt.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>In dem zweiten Schritt markiert jeder Prozessor alle Elemente aus seinem Block mit entweder 0 oder 1, abhängig davon, ob das Element kleiner oder größer als das Pivotelement <math>a</math> ist. Mit einem parallelen [[Präfixsumme#Parallele Berechnung|Präfix Algorithmus]] kann der Rank von jedem Element innerhalb der Gruppe 0 bzw. Gruppe 1 berechnet werden. Die Idee ist, alle Elemente aus allen Blöcken, die mit "0" markiert wurden, vor alle "1"-Elemente aller Blöcken in einem weiteren Array <math>B</math> zu speichern. <del style="font-weight: bold; text-decoration: none;">Das</del> Index vom Element in <math>B</math> wird anhand seines Ranks und der Nummer seines Blocks berechnet. So hat man alle Elemente aus der ursprünglichen Menge <math>S</math> in zwei Teile aufgeteilt – die Menge <math>S_1</math> mit allen "0"-Elementen und <math>S_2</math> mit allen "1"-Elementen.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>In dem zweiten Schritt markiert jeder Prozessor alle Elemente aus seinem Block mit entweder 0 oder 1, abhängig davon, ob das Element kleiner oder größer als das Pivotelement <math>a</math> ist. Mit einem parallelen [[Präfixsumme#Parallele Berechnung|Präfix Algorithmus]] kann der Rank von jedem Element innerhalb der Gruppe 0 bzw. Gruppe 1 berechnet werden. Die Idee ist, alle Elemente aus allen Blöcken, die mit "0" markiert wurden, vor alle "1"-Elemente aller Blöcken in einem weiteren Array <math>B</math> zu speichern. <ins style="font-weight: bold; text-decoration: none;">Der</ins> Index vom Element in <math>B</math> wird anhand seines Ranks und der Nummer seines Blocks berechnet. So hat man alle Elemente aus der ursprünglichen Menge <math>S</math> in zwei Teile aufgeteilt – die Menge <math>S_1</math> mit allen "0"-Elementen und <math>S_2</math> mit allen "1"-Elementen.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Der dritte Schritt besteht aus der Überprüfung der Länge von <math>S_1</math> und <math>S_2</math> und wenn diese mehr als ein Element enthalten, folgt ein rekursiver Aufruf von Schritt eins auf beide.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Der dritte Schritt besteht aus der Überprüfung der Länge von <math>S_1</math> und <math>S_2</math> und wenn diese mehr als ein Element enthalten, folgt ein rekursiver Aufruf von Schritt eins auf beide.</div></td>
</tr>
</table>93.202.155.94https://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=227702177&oldid=prevSchaebibuxe: /* Parallelisierung von Quicksort auf EREW PRAM */2022-11-05T19:16:28Z<p><span class="autocomment">Parallelisierung von Quicksort auf EREW PRAM</span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 5. November 2022, 21:16 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 72:</td>
<td colspan="2" class="diff-lineno">Zeile 72:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Parallelisierung von Quicksort auf EREW PRAM ==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Parallelisierung von Quicksort auf EREW PRAM ==</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Im Jahr 1991, stellen Zhang und Nageswara eine Möglichkeit für die Parallelisierung von Quicksort auf einer [[Parallel Random Access Machine|EREW PRAM]] vor<ref name=":2">{{Literatur |Autor=Weixiong Zhang, Nageswara S. V. Rao |Titel=Optimal parallel quicksort on EREW PRAM |Sammelwerk=BIT |Band=31 |Nummer=1 |Datum=1991-03 |ISSN=0006-3835 |Seiten=69–74 |DOI=10.1007/bf01952784}}</ref>. Der Algorithmus sortiert <math>n</math> Elemente mit <math>p</math> Prozessoren in <math>O((n/p<del style="font-weight: bold; text-decoration: none;">)</del>+\log p ) \log n )</math> erwartete Laufzeit und in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministische Laufzeit mit <math>O(n)</math> an Speicherbedarf. In dem Fall, dass <math>p = O(n/ \log n)</math> ist, dann sind die Kosten optimal in Bezug auf das Produkt von der Zeit und Anzahl von Prozessoren.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Im Jahr 1991, stellen Zhang und Nageswara eine Möglichkeit für die Parallelisierung von Quicksort auf einer [[Parallel Random Access Machine|EREW PRAM]] vor<ref name=":2">{{Literatur |Autor=Weixiong Zhang, Nageswara S. V. Rao |Titel=Optimal parallel quicksort on EREW PRAM |Sammelwerk=BIT |Band=31 |Nummer=1 |Datum=1991-03 |ISSN=0006-3835 |Seiten=69–74 |DOI=10.1007/bf01952784}}</ref>. Der Algorithmus sortiert <math>n</math> Elemente mit <math>p</math> Prozessoren in <math>O((n/p+\log p ) \log n )</math> erwartete Laufzeit und in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministische Laufzeit mit <math>O(n)</math> an Speicherbedarf. In dem Fall, dass <math>p = O(n/ \log n)</math> ist, dann sind die Kosten optimal in Bezug auf das Produkt von der Zeit und Anzahl von Prozessoren.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
</tr>
</table>Schaebibuxehttps://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=212829872&oldid=prevTuxedoMask2002: Rechtschreibfehler korrigiert, umgangssprachliche Formulierungen gegen Hochdeutsch ersetzt.2021-06-10T07:03:12Z<p>Rechtschreibfehler korrigiert, umgangssprachliche Formulierungen gegen Hochdeutsch ersetzt.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 10. Juni 2021, 09:03 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 93:</td>
<td colspan="2" class="diff-lineno">Zeile 93:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Zuerst <del style="font-weight: bold; text-decoration: none;">kommt</del> <del style="font-weight: bold; text-decoration: none;">die</del> <del style="font-weight: bold; text-decoration: none;">Wahl</del> <del style="font-weight: bold; text-decoration: none;">des Pivotelements</del>.&#160;Dieses ist der Median <del style="font-weight: bold; text-decoration: none;">von mehrere</del> Elementen aus dem Array. Die Partitionierungsphase fängt mit der Aufteilung der Elemente in <del style="font-weight: bold; text-decoration: none;">kleineren</del> Gruppen <del style="font-weight: bold; text-decoration: none;">oder</del> Chunks an. <del style="font-weight: bold; text-decoration: none;">Dann</del> <del style="font-weight: bold; text-decoration: none;">bekommt</del> jeder Thread&#160;zwei Chunks zur Verarbeitung. <del style="font-weight: bold; text-decoration: none;">Wenn</del> <del style="font-weight: bold; text-decoration: none;">es</del> <del style="font-weight: bold; text-decoration: none;">weniger</del> Chunks <del style="font-weight: bold; text-decoration: none;">gibt, sodass</del> diese <del style="font-weight: bold; text-decoration: none;">Bedienung</del> <del style="font-weight: bold; text-decoration: none;">erfüllt</del> <del style="font-weight: bold; text-decoration: none;">werden kann</del>, werden weniger Threads<del style="font-weight: bold; text-decoration: none;">,</del> als <del style="font-weight: bold; text-decoration: none;">erwünscht,</del> benutzt. Jeder Thread sortiert seine Elemente, sodass in <del style="font-weight: bold; text-decoration: none;">dem</del> linken Chunk nur Elemente kleiner als das Pivotelement liegen<del style="font-weight: bold; text-decoration: none;"> und</del> bzw. nur größere <del style="font-weight: bold; text-decoration: none;">in dem</del> rechten. Dann reserviert <del style="font-weight: bold; text-decoration: none;">parallel</del> jeder Thread Platz für seine zwei Chunks. Die <del style="font-weight: bold; text-decoration: none;">linke</del> Chunks <del style="font-weight: bold; text-decoration: none;">von</del> <del style="font-weight: bold; text-decoration: none;">jedem</del> <del style="font-weight: bold; text-decoration: none;">Thread</del> <del style="font-weight: bold; text-decoration: none;">kommen</del> <del style="font-weight: bold; text-decoration: none;">am</del> Anfang <del style="font-weight: bold; text-decoration: none;">vom</del> <del style="font-weight: bold; text-decoration: none;">Array</del> <del style="font-weight: bold; text-decoration: none;">und</del> die <del style="font-weight: bold; text-decoration: none;">rechte</del> Chunks am Ende. Damit ist die Partitionierung <del style="font-weight: bold; text-decoration: none;">fertig</del>.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Zuerst <ins style="font-weight: bold; text-decoration: none;">wird</ins> <ins style="font-weight: bold; text-decoration: none;">das</ins> <ins style="font-weight: bold; text-decoration: none;">Pivotelement</ins> <ins style="font-weight: bold; text-decoration: none;">gewählt</ins>.&#160;Dieses ist der Median <ins style="font-weight: bold; text-decoration: none;">mehrerer</ins> Elementen aus dem Array. Die Partitionierungsphase fängt mit der Aufteilung der Elemente in <ins style="font-weight: bold; text-decoration: none;">kleinere</ins> Gruppen<ins style="font-weight: bold; text-decoration: none;">,</ins> <ins style="font-weight: bold; text-decoration: none;">auch</ins> Chunks<ins style="font-weight: bold; text-decoration: none;"> genannt,</ins> an. <ins style="font-weight: bold; text-decoration: none;">Anschließend</ins> <ins style="font-weight: bold; text-decoration: none;">erhält</ins> jeder Thread&#160;zwei Chunks zur Verarbeitung. <ins style="font-weight: bold; text-decoration: none;">Existieren</ins> <ins style="font-weight: bold; text-decoration: none;">nicht</ins> <ins style="font-weight: bold; text-decoration: none;">genügend</ins> Chunks <ins style="font-weight: bold; text-decoration: none;">um</ins> diese <ins style="font-weight: bold; text-decoration: none;">Bedingung</ins> <ins style="font-weight: bold; text-decoration: none;">zu</ins> <ins style="font-weight: bold; text-decoration: none;">erfüllen</ins>, werden weniger Threads als <ins style="font-weight: bold; text-decoration: none;">angefordert</ins> benutzt. Jeder Thread sortiert seine Elemente, sodass in <ins style="font-weight: bold; text-decoration: none;">seinem</ins> linken Chunk nur Elemente kleiner als das Pivotelement liegen bzw. nur größere <ins style="font-weight: bold; text-decoration: none;">im</ins> rechten. Dann reserviert jeder Thread<ins style="font-weight: bold; text-decoration: none;"> parallel</ins> Platz für seine zwei Chunks. Die <ins style="font-weight: bold; text-decoration: none;">linken</ins> Chunks <ins style="font-weight: bold; text-decoration: none;">jedes</ins> <ins style="font-weight: bold; text-decoration: none;">Threads</ins> <ins style="font-weight: bold; text-decoration: none;">werden</ins> <ins style="font-weight: bold; text-decoration: none;">an</ins> <ins style="font-weight: bold; text-decoration: none;">den</ins> Anfang <ins style="font-weight: bold; text-decoration: none;">dieses</ins> <ins style="font-weight: bold; text-decoration: none;">Arrays</ins> <ins style="font-weight: bold; text-decoration: none;">geschrieben,</ins> die <ins style="font-weight: bold; text-decoration: none;">rechten</ins> Chunks am Ende. Damit ist die Partitionierung <ins style="font-weight: bold; text-decoration: none;">beendet</ins>.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Balancierte Lastverteilung ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Balancierte Lastverteilung ===</div></td>
</tr>
</table>TuxedoMask2002https://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=198802106&oldid=prevCrazy1880: Vorlagen-fix (OCLC)2020-04-13T08:57:18Z<p>Vorlagen-fix (OCLC)</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 13. April 2020, 10:57 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 17:</td>
<td colspan="2" class="diff-lineno">Zeile 17:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Reihenfolge bei der Allokation von Prozessoren an Untermengen wird dynamisch angepasst. Prozessor 1 partitioniert die Menge der Elemente mit Index <math>(1,n)</math>. Die erste entstandene Untermenge, <math>(1, k_{1} - 1)</math>, verarbeitet wieder Prozessor 1 und die zweite, <math>(k_{1} +1, n)</math>, Prozessor 2. Die Menge der Elemente <math>(k_1 + 1, n)</math> ist o.&nbsp;B.&nbsp;d.&nbsp;A. die kleinere von beiden. Daher ist es plausibler, dass diese von Prozessor 2 schneller partitioniert wird. Prozessor 2 fordert also früher als Prozessor 1 für seine Untermengen einen neuen Prozessor an. Infolgedessen verarbeitet Prozessor 2 die eine erhaltene Untermenge, während Prozessor 3 die andere. Wenn Prozessor 1 einen neuen Prozessor anfordert, bekommt er Prozessor 4, weil dieser zurzeit frei ist.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Reihenfolge bei der Allokation von Prozessoren an Untermengen wird dynamisch angepasst. Prozessor 1 partitioniert die Menge der Elemente mit Index <math>(1,n)</math>. Die erste entstandene Untermenge, <math>(1, k_{1} - 1)</math>, verarbeitet wieder Prozessor 1 und die zweite, <math>(k_{1} +1, n)</math>, Prozessor 2. Die Menge der Elemente <math>(k_1 + 1, n)</math> ist o.&nbsp;B.&nbsp;d.&nbsp;A. die kleinere von beiden. Daher ist es plausibler, dass diese von Prozessor 2 schneller partitioniert wird. Prozessor 2 fordert also früher als Prozessor 1 für seine Untermengen einen neuen Prozessor an. Infolgedessen verarbeitet Prozessor 2 die eine erhaltene Untermenge, während Prozessor 3 die andere. Wenn Prozessor 1 einen neuen Prozessor anfordert, bekommt er Prozessor 4, weil dieser zurzeit frei ist.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Das folgende Pseudocode skizziert eine Implementierung von Parallel Quicksort. <math>M</math> bezeichnet die maximale Größe des Array, welcher effizienter mit einem sequentiellen Sortieralgorithmus, z.&nbsp;B. [[Insertionsort]], zu sortieren ist.<del style="font-weight: bold; text-decoration: none;"> </del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Das folgende Pseudocode skizziert eine Implementierung von Parallel Quicksort. <math>M</math> bezeichnet die maximale Größe des Array, welcher effizienter mit einem sequentiellen Sortieralgorithmus, z.&nbsp;B. [[Insertionsort]], zu sortieren ist.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang="c"></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang="c"></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PROCEDURE QUICKSORT (L,U);</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PROCEDURE QUICKSORT (L,U);</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 85:</td>
<td colspan="2" class="diff-lineno">Zeile 85:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Laufzeit von dem Algorithmus hängt von der Wahl des Pivotelements. Eine Möglichkeit ist, ein zufälliges Element als Pivot zu nehmen.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Laufzeit von dem Algorithmus hängt von der Wahl des Pivotelements. Eine Möglichkeit ist, ein zufälliges Element als Pivot zu nehmen.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Annehmend, kann ein Prozessor eine zufällige ganze Zahl <math>k</math> von dem Bereich <math>\{1,2,.., n\}</math> in konstante Zeit generieren, dann entspricht die Partitionierung mit Pivotelement – das Element mit Index <math>k</math>, einem Random [[Binäre Suche|Binary Search]]. Die Analyse<ref>{{Literatur |Autor=Luc Devroye |Titel=A note on the height of binary search trees |Sammelwerk=Journal of the ACM |Band=33 |Nummer=3 |Datum=1986-05-01 |ISSN=0004-5411 |Seiten=489–498 |DOI=10.1145/5925.5930}}</ref> besagt, dass für die Höhe, <math>H_n</math>, von einem [[:en:Random binary tree|Random-Binary-Search-Tree]] mit <math>n</math> Elementen, gilt <math> \lim_{n \to \infty} (H_n \ln n) = 4.31107... </math>. Daher liegt die Tiefe der Rekursion bei <math>O( \log n)</math>. Das Pivotelement muss zusätzlich noch verschickt werden. Dies erfolgt in <math>O( \log p )</math><ref>{{Literatur |Autor=Vishkin, U. |Titel=Synchronous parallel computation - a survey. |Verlag=Courant Institute of Mathematical Sciences, New York University |Datum=1983-04 |<del style="font-weight: bold; text-decoration: none;">Online</del>=<del style="font-weight: bold; text-decoration: none;">http://worldcat.org/oclc/</del>1085604497<del style="font-weight: bold; text-decoration: none;"> |Abruf=2020-02-15</del>}}</ref>. Jeder Prozessor muss dann die Elemente in seinem Block markieren, die Präfix Summe muss berechnet werden<ref>{{Literatur |Autor=Richard Cole, Uzi Vishkin |Titel=Approximate and exact parallel scheduling with applications to list, tree and graph problems |Sammelwerk=27th Annual Symposium on Foundations of Computer Science (sfcs 1986) |Verlag=IEEE |Datum=1986 |ISBN=0-8186-0740-8 |DOI=10.1109/sfcs.1986.10}}</ref> und die Elemente verschoben werden. Dies braucht gesamt <math>O(n/p + \log p)</math>. Anschließend berechnet man die Gesamtlaufzeit für diesen Fall, diese ist <math>O((n/p)+\log p ) \log n )</math> erwartet.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Annehmend, kann ein Prozessor eine zufällige ganze Zahl <math>k</math> von dem Bereich <math>\{1,2,.., n\}</math> in konstante Zeit generieren, dann entspricht die Partitionierung mit Pivotelement – das Element mit Index <math>k</math>, einem Random [[Binäre Suche|Binary Search]]. Die Analyse<ref>{{Literatur |Autor=Luc Devroye |Titel=A note on the height of binary search trees |Sammelwerk=Journal of the ACM |Band=33 |Nummer=3 |Datum=1986-05-01 |ISSN=0004-5411 |Seiten=489–498 |DOI=10.1145/5925.5930}}</ref> besagt, dass für die Höhe, <math>H_n</math>, von einem [[:en:Random binary tree|Random-Binary-Search-Tree]] mit <math>n</math> Elementen, gilt <math> \lim_{n \to \infty} (H_n \ln n) = 4.31107... </math>. Daher liegt die Tiefe der Rekursion bei <math>O( \log n)</math>. Das Pivotelement muss zusätzlich noch verschickt werden. Dies erfolgt in <math>O( \log p )</math><ref>{{Literatur |Autor=Vishkin, U. |Titel=Synchronous parallel computation - a survey. |Verlag=Courant Institute of Mathematical Sciences, New York University |Datum=1983-04 |<ins style="font-weight: bold; text-decoration: none;">OCLC</ins>=1085604497}}</ref>. Jeder Prozessor muss dann die Elemente in seinem Block markieren, die Präfix Summe muss berechnet werden<ref>{{Literatur |Autor=Richard Cole, Uzi Vishkin |Titel=Approximate and exact parallel scheduling with applications to list, tree and graph problems |Sammelwerk=27th Annual Symposium on Foundations of Computer Science (sfcs 1986) |Verlag=IEEE |Datum=1986 |ISBN=0-8186-0740-8 |DOI=10.1109/sfcs.1986.10}}</ref> und die Elemente verschoben werden. Dies braucht gesamt <math>O(n/p + \log p)</math>. Anschließend berechnet man die Gesamtlaufzeit für diesen Fall, diese ist <math>O((n/p)+\log p ) \log n )</math> erwartet.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem Fall, dass das Pivotelement nicht zufällig gewählt wurde, hängt die Laufzeit des Algorithmus von der Rekursionstiefe und damit auch von dem Verhältnis der Größen <math>S_1</math> und <math>S_2</math> ab. Die Rekursionstiefe vom Algorithmus kann auf <math>O( \log n )</math> begrenzt werden, wenn <math>S_1</math> und <math>S_2</math> ungefähr gleich sind. Dies kann gewährleistet werden, indem die Auswahl des Pivotelements mit dem Parallel Median Finding Algorithm von Akl auf eine EREW PRAM in <math>O(\log \log n)</math> Zeit<ref>Akl, S. G. "Parallel Selection in O(log log n) Time Using O(n/log log n) Processors." ''Technical Report 88-221, Department of Computing and Information Science, Queen's University, Kingston, Ontario'' (1988).</ref> erfolgt. Das Markieren, die Präfix Summe und das Verschieben der Elemente erfolgt analog zu dem anderen Fall. Mit dem [[Brent-Verfahren]] kann folglich der Algorithmus in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministisch implementiert werden.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem Fall, dass das Pivotelement nicht zufällig gewählt wurde, hängt die Laufzeit des Algorithmus von der Rekursionstiefe und damit auch von dem Verhältnis der Größen <math>S_1</math> und <math>S_2</math> ab. Die Rekursionstiefe vom Algorithmus kann auf <math>O( \log n )</math> begrenzt werden, wenn <math>S_1</math> und <math>S_2</math> ungefähr gleich sind. Dies kann gewährleistet werden, indem die Auswahl des Pivotelements mit dem Parallel Median Finding Algorithm von Akl auf eine EREW PRAM in <math>O(\log \log n)</math> Zeit<ref>Akl, S. G. "Parallel Selection in O(log log n) Time Using O(n/log log n) Processors." ''Technical Report 88-221, Department of Computing and Information Science, Queen's University, Kingston, Ontario'' (1988).</ref> erfolgt. Das Markieren, die Präfix Summe und das Verschieben der Elemente erfolgt analog zu dem anderen Fall. Mit dem [[Brent-Verfahren]] kann folglich der Algorithmus in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministisch implementiert werden.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Implementierung von Quicksort in MCSTL ==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Implementierung von Quicksort in MCSTL ==</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Eine parallele Implementierung für Quicksort ist in der MCSTL Bibliothek<ref>{{Literatur |Autor=Putze, Felix. |Titel=MCSTL: the multi-core standard template library |Verlag=ACM |Datum=2007 |<del style="font-weight: bold; text-decoration: none;">Online</del>=<del style="font-weight: bold; text-decoration: none;">http://worldcat.org/oclc/</del>854741854<del style="font-weight: bold; text-decoration: none;"> |Abruf=2020-02-16</del>}}</ref> zu finden. Die zwei Funktionen <math>parallel\_sort\_qsb</math> und <math>parallel\_sort\_qs</math> stehen zur Verfügung. Der Hauptunterschied bei <math>parallel\_sort\_qs</math> liegt bei der durch [[Work stealing]] realisierten balancierten Lastverteilung. Bei beiden Funktionen ist die Pivotwahl <!-- und Arbeitsverteilung -->von einem Prozessor und die Partitionierung parallel von mehreren Prozessoren durchgeführt. Die gewünschte Anzahl von Threads, die benutzt werden müssen, wird als Parameter an dem Algorithmus gegeben.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Eine parallele Implementierung für Quicksort ist in der MCSTL Bibliothek<ref>{{Literatur |Autor=Putze, Felix. |Titel=MCSTL: the multi-core standard template library |Verlag=ACM |Datum=2007 |<ins style="font-weight: bold; text-decoration: none;">OCLC</ins>=854741854}}</ref> zu finden. Die zwei Funktionen <math>parallel\_sort\_qsb</math> und <math>parallel\_sort\_qs</math> stehen zur Verfügung. Der Hauptunterschied bei <math>parallel\_sort\_qs</math> liegt bei der durch [[Work stealing]] realisierten balancierten Lastverteilung. Bei beiden Funktionen ist die Pivotwahl <!-- und Arbeitsverteilung -->von einem Prozessor und die Partitionierung parallel von mehreren Prozessoren durchgeführt. Die gewünschte Anzahl von Threads, die benutzt werden müssen, wird als Parameter an dem Algorithmus gegeben.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
</tr>
</table>Crazy1880https://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=198474574&oldid=prevKrd am 4. April 2020 um 17:14 Uhr2020-04-04T17:14:53Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 4. April 2020, 19:14 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{QS-Antrag|25. Februar 2020|2=''Wikifizieren'' [[Benutzer:Lutheraner|Lutheraner]] ([[Benutzer Diskussion:Lutheraner|Diskussion]]) 16:33, 25. Feb. 2020 (CET)}}</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''Parallel Quicksort''' beschreibt Parallelisierungen des sequentiellen Algorithmus [[Quicksort]], welcher auf dem [[Teile-und-herrsche-Verfahren|Teile-und-Herrsche-Prinzip]] basiert.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>'''Parallel Quicksort''' beschreibt Parallelisierungen des sequentiellen Algorithmus [[Quicksort]], welcher auf dem [[Teile-und-herrsche-Verfahren|Teile-und-Herrsche-Prinzip]] basiert.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>Krdhttps://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=197295924&oldid=prevSnookerado: Vorlagenfix2020-02-29T20:48:40Z<p>Vorlagenfix</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 29. Februar 2020, 22:48 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 4:</td>
<td colspan="2" class="diff-lineno">Zeile 4:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Wie Quicksort teilt Parallel Quicksort eine Menge von Elementen mithilfe eines Pivotelements in zwei Teilmengen auf, sodass die Elemente in der einen Teilmenge kleiner als das Pivot sind und die Elemente in der anderen Teilmenge größer oder gleich dem Pivot sind. Danach werden die neuen Mengen wieder jeweils in Teilmengen unterteilt.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Wie Quicksort teilt Parallel Quicksort eine Menge von Elementen mithilfe eines Pivotelements in zwei Teilmengen auf, sodass die Elemente in der einen Teilmenge kleiner als das Pivot sind und die Elemente in der anderen Teilmenge größer oder gleich dem Pivot sind. Danach werden die neuen Mengen wieder jeweils in Teilmengen unterteilt.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Dieses Vorgehen kann auf verschiedene Arten parallel implementiert werden. Zum einen können mehrere Mengen von jeweils einem Prozess in neue Teilmengen aufgeteilt werden<ref name=":1">{{Literatur |Autor=D.J. Evans, R.C Dunbar |Titel=The parallel quicksort algorithm part i–run time analysis |Sammelwerk=International Journal of Computer Mathematics |Band=12 |Nummer=1 |Datum=1982-01 |ISSN=0020-7160<del style="font-weight: bold; text-decoration: none;"> |DOI=10.1080/00207168208803323</del> |Seiten=19–55 |<del style="font-weight: bold; text-decoration: none;">Online</del>=<del style="font-weight: bold; text-decoration: none;">http://dx.doi.org/</del>10.1080/00207168208803323<del style="font-weight: bold; text-decoration: none;"> |Abruf=2020-02-15</del>}}</ref>. Dies hat den Nachteil, dass der erste Rekursionslevel nicht parallelisiert ist und der Speedup gegenüber Quicksort auf <math>O(\log n)</math> begrenzt ist. Zum anderen können mehrere Prozesse zusammen arbeiten und gemeinsam eine einzelne Menge aufteilen. Dieser Ansatz hat sich in der Praxis als effizienter erwiesen. Parallel Quicksort kann im PRAM Modell mit einer Laufzeit von <math>O((n/p + \log p + \log \log n)\log n)</math> implementiert werden<ref name=":2" />.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Dieses Vorgehen kann auf verschiedene Arten parallel implementiert werden. Zum einen können mehrere Mengen von jeweils einem Prozess in neue Teilmengen aufgeteilt werden<ref name=":1">{{Literatur |Autor=D.J. Evans, R.C Dunbar |Titel=The parallel quicksort algorithm part i–run time analysis |Sammelwerk=International Journal of Computer Mathematics |Band=12 |Nummer=1 |Datum=1982-01 |ISSN=0020-7160 |Seiten=19–55 |<ins style="font-weight: bold; text-decoration: none;">DOI</ins>=10.1080/00207168208803323}}</ref>. Dies hat den Nachteil, dass der erste Rekursionslevel nicht parallelisiert ist und der Speedup gegenüber Quicksort auf <math>O(\log n)</math> begrenzt ist. Zum anderen können mehrere Prozesse zusammen arbeiten und gemeinsam eine einzelne Menge aufteilen. Dieser Ansatz hat sich in der Praxis als effizienter erwiesen. Parallel Quicksort kann im PRAM Modell mit einer Laufzeit von <math>O((n/p + \log p + \log \log n)\log n)</math> implementiert werden<ref name=":2" />.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Naiver Ansatz ==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Naiver Ansatz ==</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 13:</td>
<td colspan="2" class="diff-lineno">Zeile 13:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Es ist dabei möglich, dass manche Prozessoren schneller mit der Partitionierung seiner Untermenge fertig sind, im Vergleich zu anderen. Eine Warteschlange kann dazu benutzt werden, wo die Zeiger auf noch nicht partitionierte Untermengen gespeichert werden. Bei der Entfernung von der Warteschlange sind die größeren Untermengen bevorzugt, da diese neue kleinere Untermengen erzeugen, die wiederum in die Warteschlange kommen. Das Ziel dabei ist, möglichst viele Untermengen zu haben, und dabei die Prozessoren dauerhaft besetzt zu halten.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Es ist dabei möglich, dass manche Prozessoren schneller mit der Partitionierung seiner Untermenge fertig sind, im Vergleich zu anderen. Eine Warteschlange kann dazu benutzt werden, wo die Zeiger auf noch nicht partitionierte Untermengen gespeichert werden. Bei der Entfernung von der Warteschlange sind die größeren Untermengen bevorzugt, da diese neue kleinere Untermengen erzeugen, die wiederum in die Warteschlange kommen. Das Ziel dabei ist, möglichst viele Untermengen zu haben, und dabei die Prozessoren dauerhaft besetzt zu halten.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Datei:Allokation von Prozessoren.svg|mini|Allokation von Prozessoren bei der Ausführung von Parallel Quicksort|<del style="font-weight: bold; text-decoration: none;">alternativtext</del>=<del style="font-weight: bold; text-decoration: none;">|350x350px</del>]]</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Datei:Allokation von Prozessoren.svg|mini<ins style="font-weight: bold; text-decoration: none;">|350x350px</ins>|Allokation von Prozessoren bei der Ausführung von Parallel Quicksort|<ins style="font-weight: bold; text-decoration: none;">alt</ins>=]]</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==== Allokation von Prozessoren ====</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==== Allokation von Prozessoren ====</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Reihenfolge bei der Allokation von Prozessoren an Untermengen wird dynamisch angepasst. Prozessor 1 partitioniert die Menge der Elemente mit Index <math>(1,n)</math>. Die erste entstandene Untermenge, <math>(1, k_{1} - 1)</math>, verarbeitet wieder Prozessor 1 und die zweite, <math>(k_{1} +1, n)</math>, Prozessor 2. Die Menge der Elemente <math>(k_1 + 1, n)</math> ist o.&nbsp;B.&nbsp;d.&nbsp;A. die kleinere von beiden. Daher ist es plausibler, dass diese von Prozessor 2 schneller partitioniert wird. Prozessor 2 fordert also früher als Prozessor 1 für seine Untermengen einen neuen Prozessor an. Infolgedessen verarbeitet Prozessor 2 die eine erhaltene Untermenge, während Prozessor 3 die andere. Wenn Prozessor 1 einen neuen Prozessor anfordert, bekommt er Prozessor 4, weil dieser zurzeit frei ist.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Reihenfolge bei der Allokation von Prozessoren an Untermengen wird dynamisch angepasst. Prozessor 1 partitioniert die Menge der Elemente mit Index <math>(1,n)</math>. Die erste entstandene Untermenge, <math>(1, k_{1} - 1)</math>, verarbeitet wieder Prozessor 1 und die zweite, <math>(k_{1} +1, n)</math>, Prozessor 2. Die Menge der Elemente <math>(k_1 + 1, n)</math> ist o.&nbsp;B.&nbsp;d.&nbsp;A. die kleinere von beiden. Daher ist es plausibler, dass diese von Prozessor 2 schneller partitioniert wird. Prozessor 2 fordert also früher als Prozessor 1 für seine Untermengen einen neuen Prozessor an. Infolgedessen verarbeitet Prozessor 2 die eine erhaltene Untermenge, während Prozessor 3 die andere. Wenn Prozessor 1 einen neuen Prozessor anfordert, bekommt er Prozessor 4, weil dieser zurzeit frei ist.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Das folgende Pseudocode skizziert eine Implementierung von Parallel Quicksort. <math>M</math> bezeichnet die maximale Größe des Array, welcher effizienter mit einem sequentiellen Sortieralgorithmus, z.&nbsp;B. [[Insertionsort]], zu sortieren ist. <syntaxhighlight lang="c"></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Das folgende Pseudocode skizziert eine Implementierung von Parallel Quicksort. <math>M</math> bezeichnet die maximale Größe des Array, welcher effizienter mit einem sequentiellen Sortieralgorithmus, z.&nbsp;B. [[Insertionsort]], zu sortieren ist. </div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang="c"></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PROCEDURE QUICKSORT (L,U);</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>PROCEDURE QUICKSORT (L,U);</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>IF U-L > M THEN;</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>IF U-L > M THEN;</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 35:</td>
<td colspan="2" class="diff-lineno">Zeile 36:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Laufzeit ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Laufzeit ===</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Dieser Ansatz erreicht eine niedrigere Beschleunigung gegenüber dem sequentiellen Quicksort<ref name=":0">{{Literatur |Autor=Quinn, Michael J. (Michael Jay) |Titel=Instructor's manual to accompany Designing efficient algorithms for parallel computers |Verlag=McGraw-Hill Book Co |Datum=1987 |ISBN=0-07-051072-5<del style="font-weight: bold; text-decoration: none;"> |Online=http://worldcat.org/oclc/53588516 |Abruf=2020-02-16</del>}}</ref>.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Dieser Ansatz erreicht eine niedrigere Beschleunigung gegenüber dem sequentiellen Quicksort<ref name=":0">{{Literatur |Autor=Quinn, Michael J. (Michael Jay) |Titel=Instructor's manual to accompany Designing efficient algorithms for parallel computers |Verlag=McGraw-Hill Book Co |Datum=1987 |ISBN=0-07-051072-5}}</ref>.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Um eine <math>n</math>-elementige Menge mit einem Pivotelement aus der gleichen Menge zu partitionieren, braucht man <math>n-1</math> Vergleiche. Es sei angenommen, dass ein Vergleich eine Zeiteinheit braucht. Weiterhin, sei die ursprüngliche Größe des Arrays <math>n=2^k-1</math>, die Anzahl an Prozessoren <math>p=2^m</math> mit <math>m<k</math> und das ausgewählte Pivotelement immer der wahre Median von der zu partitionierenden Untermenge.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Um eine <math>n</math>-elementige Menge mit einem Pivotelement aus der gleichen Menge zu partitionieren, braucht man <math>n-1</math> Vergleiche. Es sei angenommen, dass ein Vergleich eine Zeiteinheit braucht. Weiterhin, sei die ursprüngliche Größe des Arrays <math>n=2^k-1</math>, die Anzahl an Prozessoren <math>p=2^m</math> mit <math>m<k</math> und das ausgewählte Pivotelement immer der wahre Median von der zu partitionierenden Untermenge.</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 72:</td>
<td colspan="2" class="diff-lineno">Zeile 73:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Parallelisierung von Quicksort auf EREW PRAM ==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Parallelisierung von Quicksort auf EREW PRAM ==</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Im Jahr 1991, stellen Zhang und Nageswara eine Möglichkeit für die Parallelisierung von Quicksort auf einer [[Parallel Random Access Machine|EREW PRAM]] vor<ref name=":2">{{Literatur |Autor=Weixiong Zhang, Nageswara S. V. Rao |Titel=Optimal parallel quicksort on EREW PRAM |Sammelwerk=BIT |Band=31 |Nummer=1 |Datum=1991-03 |ISSN=0006-3835<del style="font-weight: bold; text-decoration: none;"> |DOI=10.1007/bf01952784</del> |Seiten=69–74 |<del style="font-weight: bold; text-decoration: none;">Online</del>=<del style="font-weight: bold; text-decoration: none;">http://dx.doi.org/</del>10.1007/bf01952784<del style="font-weight: bold; text-decoration: none;"> |Abruf=2020-02-15</del>}}</ref>. Der Algorithmus sortiert <math>n</math> Elemente mit <math>p</math> Prozessoren in <math>O((n/p)+\log p ) \log n )</math> erwartete Laufzeit und in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministische Laufzeit mit <math>O(n)</math> an Speicherbedarf. In dem Fall, dass <math>p = O(n/ \log n)</math> ist, dann sind die Kosten optimal in Bezug auf das Produkt von der Zeit und Anzahl von Prozessoren.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Im Jahr 1991, stellen Zhang und Nageswara eine Möglichkeit für die Parallelisierung von Quicksort auf einer [[Parallel Random Access Machine|EREW PRAM]] vor<ref name=":2">{{Literatur |Autor=Weixiong Zhang, Nageswara S. V. Rao |Titel=Optimal parallel quicksort on EREW PRAM |Sammelwerk=BIT |Band=31 |Nummer=1 |Datum=1991-03 |ISSN=0006-3835 |Seiten=69–74 |<ins style="font-weight: bold; text-decoration: none;">DOI</ins>=10.1007/bf01952784}}</ref>. Der Algorithmus sortiert <math>n</math> Elemente mit <math>p</math> Prozessoren in <math>O((n/p)+\log p ) \log n )</math> erwartete Laufzeit und in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministische Laufzeit mit <math>O(n)</math> an Speicherbedarf. In dem Fall, dass <math>p = O(n/ \log n)</math> ist, dann sind die Kosten optimal in Bezug auf das Produkt von der Zeit und Anzahl von Prozessoren.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 85:</td>
<td colspan="2" class="diff-lineno">Zeile 86:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Laufzeit von dem Algorithmus hängt von der Wahl des Pivotelements. Eine Möglichkeit ist, ein zufälliges Element als Pivot zu nehmen.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Laufzeit von dem Algorithmus hängt von der Wahl des Pivotelements. Eine Möglichkeit ist, ein zufälliges Element als Pivot zu nehmen.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Annehmend, kann ein Prozessor eine zufällige ganze Zahl <math>k</math> von dem Bereich <math>\{1,2,.., n\}</math> in konstante Zeit generieren, dann entspricht die Partitionierung mit Pivotelement – das Element mit Index <math>k</math>, einem Random [[Binäre Suche|Binary Search]]. Die Analyse<ref>{{Literatur |Autor=Luc Devroye |Titel=A note on the height of binary search trees |Sammelwerk=Journal of the ACM |Band=33 |Nummer=3 |Datum=1986-05-01 |ISSN=0004-5411<del style="font-weight: bold; text-decoration: none;"> |DOI=10.1145/5925.5930</del> |Seiten=489–498 |<del style="font-weight: bold; text-decoration: none;">Online</del>=<del style="font-weight: bold; text-decoration: none;">http://dx.doi.org/</del>10.1145/5925.5930<del style="font-weight: bold; text-decoration: none;"> |Abruf=2020-02-15</del>}}</ref> besagt, dass für die Höhe, <math>H_n</math>, von einem [[:en:Random binary tree|Random-Binary-Search-Tree]] mit <math>n</math> Elementen, gilt <math> \lim_{n \to \infty} (H_n \ln n) = 4.31107... </math>. Daher liegt die Tiefe der Rekursion bei <math>O( \log n)</math>. Das Pivotelement muss zusätzlich noch verschickt werden. Dies erfolgt in <math>O( \log p )</math><ref>{{Literatur |Autor=Vishkin, U. |Titel=Synchronous parallel computation - a survey. |Verlag=Courant Institute of Mathematical Sciences, New York University |Datum=1983-04 |Online=http://worldcat.org/oclc/1085604497 |Abruf=2020-02-15}}</ref>. Jeder Prozessor muss dann die Elemente in seinem Block markieren, die Präfix Summe muss berechnet werden<ref>{{Literatur |Autor=Richard Cole, Uzi Vishkin |Titel=Approximate and exact parallel scheduling with applications to list, tree and graph problems |Sammelwerk=27th Annual Symposium on Foundations of Computer Science (sfcs 1986) |Verlag=IEEE |Datum=1986<del style="font-weight: bold; text-decoration: none;">-10</del> |ISBN=0-8186-0740-8 |DOI=10.1109/sfcs.1986.10<del style="font-weight: bold; text-decoration: none;"> |Online=http://dx.doi.org/10.1109/sfcs.1986.10 |Abruf=2020-02-15</del>}}</ref> und die Elemente verschoben werden. Dies braucht gesamt <math>O(n/p + \log p)</math>. Anschließend berechnet man die Gesamtlaufzeit für diesen Fall, diese ist <math>O((n/p)+\log p ) \log n )</math> erwartet.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Annehmend, kann ein Prozessor eine zufällige ganze Zahl <math>k</math> von dem Bereich <math>\{1,2,.., n\}</math> in konstante Zeit generieren, dann entspricht die Partitionierung mit Pivotelement – das Element mit Index <math>k</math>, einem Random [[Binäre Suche|Binary Search]]. Die Analyse<ref>{{Literatur |Autor=Luc Devroye |Titel=A note on the height of binary search trees |Sammelwerk=Journal of the ACM |Band=33 |Nummer=3 |Datum=1986-05-01 |ISSN=0004-5411 |Seiten=489–498 |<ins style="font-weight: bold; text-decoration: none;">DOI</ins>=10.1145/5925.5930}}</ref> besagt, dass für die Höhe, <math>H_n</math>, von einem [[:en:Random binary tree|Random-Binary-Search-Tree]] mit <math>n</math> Elementen, gilt <math> \lim_{n \to \infty} (H_n \ln n) = 4.31107... </math>. Daher liegt die Tiefe der Rekursion bei <math>O( \log n)</math>. Das Pivotelement muss zusätzlich noch verschickt werden. Dies erfolgt in <math>O( \log p )</math><ref>{{Literatur |Autor=Vishkin, U. |Titel=Synchronous parallel computation - a survey. |Verlag=Courant Institute of Mathematical Sciences, New York University |Datum=1983-04 |Online=http://worldcat.org/oclc/1085604497 |Abruf=2020-02-15}}</ref>. Jeder Prozessor muss dann die Elemente in seinem Block markieren, die Präfix Summe muss berechnet werden<ref>{{Literatur |Autor=Richard Cole, Uzi Vishkin |Titel=Approximate and exact parallel scheduling with applications to list, tree and graph problems |Sammelwerk=27th Annual Symposium on Foundations of Computer Science (sfcs 1986) |Verlag=IEEE |Datum=1986 |ISBN=0-8186-0740-8 |DOI=10.1109/sfcs.1986.10}}</ref> und die Elemente verschoben werden. Dies braucht gesamt <math>O(n/p + \log p)</math>. Anschließend berechnet man die Gesamtlaufzeit für diesen Fall, diese ist <math>O((n/p)+\log p ) \log n )</math> erwartet.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem Fall, dass das Pivotelement nicht zufällig gewählt wurde, hängt die Laufzeit des Algorithmus von der Rekursionstiefe und damit auch von dem Verhältnis der Größen <math>S_1</math> und <math>S_2</math> ab. Die Rekursionstiefe vom Algorithmus kann auf <math>O( \log n )</math> begrenzt werden, wenn <math>S_1</math> und <math>S_2</math> ungefähr gleich sind. Dies kann gewährleistet werden, indem die Auswahl des Pivotelements mit dem Parallel Median Finding Algorithm von Akl auf eine EREW PRAM in <math>O(\log \log n)</math> Zeit<ref>Akl, S. G. "Parallel Selection in O(log log n) Time Using O(n/log log n) Processors." ''Technical Report 88-221, Department of Computing and Information Science, Queen's University, Kingston, Ontario'' (1988).</ref> erfolgt. Das Markieren, die Präfix Summe und das Verschieben der Elemente erfolgt analog zu dem anderen Fall. Mit dem [[Brent-Verfahren]] kann folglich der Algorithmus in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministisch implementiert werden.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In dem Fall, dass das Pivotelement nicht zufällig gewählt wurde, hängt die Laufzeit des Algorithmus von der Rekursionstiefe und damit auch von dem Verhältnis der Größen <math>S_1</math> und <math>S_2</math> ab. Die Rekursionstiefe vom Algorithmus kann auf <math>O( \log n )</math> begrenzt werden, wenn <math>S_1</math> und <math>S_2</math> ungefähr gleich sind. Dies kann gewährleistet werden, indem die Auswahl des Pivotelements mit dem Parallel Median Finding Algorithm von Akl auf eine EREW PRAM in <math>O(\log \log n)</math> Zeit<ref>Akl, S. G. "Parallel Selection in O(log log n) Time Using O(n/log log n) Processors." ''Technical Report 88-221, Department of Computing and Information Science, Queen's University, Kingston, Ontario'' (1988).</ref> erfolgt. Das Markieren, die Präfix Summe und das Verschieben der Elemente erfolgt analog zu dem anderen Fall. Mit dem [[Brent-Verfahren]] kann folglich der Algorithmus in <math>O((n/p + \log p + \log \log n) \log n)</math> deterministisch implementiert werden.</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 93:</td>
<td colspan="2" class="diff-lineno">Zeile 94:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Arbeitsweise ===</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Zuerst kommt die Wahl des Pivotelements.<del style="font-weight: bold; text-decoration: none;"> </del>Dieses ist der Median von mehrere Elementen aus dem Array. Die Partitionierungsphase fängt mit der Aufteilung der Elemente in kleineren Gruppen oder Chunks an. Dann bekommt jeder Thread<del style="font-weight: bold; text-decoration: none;"> </del>zwei Chunks zur Verarbeitung. Wenn es weniger Chunks gibt, sodass diese Bedienung erfüllt werden kann, werden weniger Threads, als erwünscht, benutzt. Jeder Thread sortiert seine Elemente, sodass in dem linken Chunk nur Elemente kleiner als das Pivotelement liegen und bzw. nur größere in dem rechten. Dann reserviert parallel jeder Thread Platz für seine zwei Chunks. Die linke Chunks von jedem Thread kommen am Anfang vom Array und die rechte Chunks am Ende. Damit ist die Partitionierung fertig.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Zuerst kommt die Wahl des Pivotelements.<ins style="font-weight: bold; text-decoration: none;">&#160;</ins>Dieses ist der Median von mehrere Elementen aus dem Array. Die Partitionierungsphase fängt mit der Aufteilung der Elemente in kleineren Gruppen oder Chunks an. Dann bekommt jeder Thread<ins style="font-weight: bold; text-decoration: none;">&#160;</ins>zwei Chunks zur Verarbeitung. Wenn es weniger Chunks gibt, sodass diese Bedienung erfüllt werden kann, werden weniger Threads, als erwünscht, benutzt. Jeder Thread sortiert seine Elemente, sodass in dem linken Chunk nur Elemente kleiner als das Pivotelement liegen und bzw. nur größere in dem rechten. Dann reserviert parallel jeder Thread Platz für seine zwei Chunks. Die linke Chunks von jedem Thread kommen am Anfang vom Array und die rechte Chunks am Ende. Damit ist die Partitionierung fertig.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Balancierte Lastverteilung ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Balancierte Lastverteilung ===</div></td>
</tr>
</table>Snookeradohttps://de.wikipedia.org/w/index.php?title=Parallel_Quicksort&diff=197172668&oldid=prevSüdseeküste: link2020-02-25T19:10:24Z<p>link</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 25. Februar 2020, 21:10 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 1:</td>
<td colspan="2" class="diff-lineno">Zeile 1:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{QS-Antrag|25. Februar 2020|2=''Wikifizieren'' [[Benutzer:Lutheraner|Lutheraner]] ([[Benutzer Diskussion:Lutheraner|Diskussion]]) 16:33, 25. Feb. 2020 (CET)}}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{QS-Antrag|25. Februar 2020|2=''Wikifizieren'' [[Benutzer:Lutheraner|Lutheraner]] ([[Benutzer Diskussion:Lutheraner|Diskussion]]) 16:33, 25. Feb. 2020 (CET)}}</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''Parallel Quicksort''' beschreibt Parallelisierungen des sequentiellen Algorithmus [[Quicksort]], welcher auf dem Teile-und-Herrsche-Prinzip basiert.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''Parallel Quicksort''' beschreibt Parallelisierungen des sequentiellen Algorithmus [[Quicksort]], welcher auf dem <ins style="font-weight: bold; text-decoration: none;">[[Teile-und-herrsche-Verfahren|</ins>Teile-und-Herrsche-Prinzip<ins style="font-weight: bold; text-decoration: none;">]]</ins> basiert.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Wie Quicksort teilt Parallel Quicksort eine Menge von Elementen mithilfe eines Pivotelements in zwei Teilmengen auf, sodass die Elemente in der einen Teilmenge kleiner als das Pivot sind und die Elemente in der anderen Teilmenge größer oder gleich dem Pivot sind. Danach werden die neuen Mengen wieder jeweils in Teilmengen unterteilt.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Wie Quicksort teilt Parallel Quicksort eine Menge von Elementen mithilfe eines Pivotelements in zwei Teilmengen auf, sodass die Elemente in der einen Teilmenge kleiner als das Pivot sind und die Elemente in der anderen Teilmenge größer oder gleich dem Pivot sind. Danach werden die neuen Mengen wieder jeweils in Teilmengen unterteilt.</div></td>
</tr>
</table>Südseeküste