https://entropia.de/api.php?action=feedcontributions&user=Cls&feedformat=atomEntropia - Benutzerbeiträge [de]2024-03-29T12:34:41ZBenutzerbeiträgeMediaWiki 1.39.6https://entropia.de/index.php?title=GPN14:Towards_the_Machine-Readable_Society&diff=31351GPN14:Towards the Machine-Readable Society2014-06-22T16:02:35Z<p>Cls: </p>
<hr />
<div>{{#css:GPN14:Stylesheet}}<br />
<br />
Ein Vortrag von Christian Staudt auf der [[GPN14]].<br />
<br />
The "machine-readable state" has long been a demand of the Chaos Computer Club, calling for more government transparency by opening up data produced by the state. In the year one after Snowden however, we begin to realize how much work has already been done in the opposite direction. Governments collect and analyze electronic data about citizens on a massive scale, in an effort to make society itself machine-readable, and thereby more governable. But don't worry, it's just metadata, right?<br />
<br />
* slides [pdf]: [[Datei:TowardsTheMachineReadableSociety]]<br />
<br />
== Links ==<br />
<br />
<br />
<br />
{{Navigationsleiste GPN14}}<br />
[[Kategorie:GPN14:Events]]</div>Clshttps://entropia.de/index.php?title=GPN14:Unterkunft&diff=30675GPN14:Unterkunft2014-06-12T08:05:42Z<p>Cls: /* Biete Schlafmoeglichkeit */</p>
<hr />
<div>Es soll ja Nerds geben die auch mal die Mate wegstellen und schlafen wollen. <br />
<br />
<br />
<br />
== Suche Unterkunft ==<br />
<br />
* Name, Kontakt (jabber|irc|mail|telephon|...)<br />
<br />
<br />
== Biete Schlafmoeglichkeit ==<br />
<br />
* Name, Anzahl Schlafplaetze (noch frei), Kontakt (jabber|irc|mail|telephon|...)<br />
<br />
<br />
{| border=1 cellspacing="0" cellpadding="4"<br />
|- <br />
! align="center" | Wer<br />
! align="center" | Anzahl Plätze<br />
! align="center" | belegt<br />
! align="center" | frei<br />
! align="center" | Kommentar<br />
! align="center" | Kontakt<br />
|-<br />
| align="center" | Ralf<br />
| align="center" | 4<br />
| align="center" | 4<br />
| align="center" | 0<br />
| align="center" | 500m zur HfG<br />
| align="center" | mail: ralf@entropia.de<br />
<br />
| align="center" | -<br />
| align="center" | -<br />
| align="center" | -<br />
| align="center" | -<br />
| align="center" | <br />
| align="center" | <br />
|}<br />
<br />
== Jugendherberge ==<br />
<br />
[http://karlsruhe.jugendherberge-bw.de/ Jugendherberge Karlsruhe] 30min zu Fuß, 15min mit der Tram (Linie 3 und 2).<br />
<br />
<br />
== Hotels ==<br />
<br />
Aktuelle Preise am besten auf der jeweiligen Hotelseite, [http://www.trivago.de Trivago] und <br />
[http://www.hrs.de HRS] anschauen und vergleichen.<br />
Die angegebenen Preise sind die gefundenen günstigsten Preise pro Person und Nacht, <br />
bei drei gebuchten Übernachtungen, Stand Anfang März. Die in Klammern angegeben<br />
Zahlen sind die Trivago-Bewertungen, Sortierung nach Entfernung zur HfG.<br />
<br />
<br />
* [http://www.acora.de/de/Karlsruhe.htm Hotel Acora(82)], Dependance, ca. 5 Minuten zu Fuss, Appartement für 4 Personen 20 Euro<br />
* [http://www.acora.de/de/Karlsruhe.htm Hotel Acora(82)], Haupthaus, ca. 10 Minuten zu Fuss, Einzelzimmer 48 Euro, Doppelzimmer 28 Euro<br />
* [http://www.hotel-rio.de Hotel Rio(84)], ca. 10 Minuten zu Fuss, Einzelzimmer 74 Euro, Doppelzimmer 41 Euro<br />
* [http://www.hotel-santo.de Hotel Santo(78)], ca. 10 Minuten zu Fuss, Einzelzimmer 62 Euro, Doppelzimmer 31 Euro<br />
* [http://www.ambassador-karlsruhe.de Hotel Ambassador(80)], ca. 10 Minuten zu Fuss, Einzelzimmer 59 Euro (inkl. Frühstück), Doppelzimmer 40 Euro<br />
* [http://www.hoteleden-karlsruhe.de Hotel Eden(74)], ca. 15 Minuten zu Fuss, Einzelzimmer 49 Euro, Doppelzimmer 33 Euro<br />
* [http://www.hotelastoria-karlsruhe.de Hotel Astoria(74)], ca. 15 Minuten zu Fuss, Einzelzimmer 53 Euro, Doppelzimmer 35 Euro, Dreibettzimmer 27 Euro<br />
* [http://www.hotelelite-ka.de Hotel Elite(79)], ca. 15 Minuten zu Fuss, Einzelzimmer 58 Euro, Doppelzimmer 37 Euro, Dreierzimmer 27 Euro<br />
* [http://www.stadthotel-karlsruhe.de/ Hotel Alte Münze(76)], ca. 15 Minuten zu Fuss, Einzelzimmer 59 Euro<br />
* [http://www.hotelkarlsruhe.de/ Hotel Am Karlstor(74)], ca. 15 Minuten zu Fuss, Einzelzimmer 66 Euro, Doppelzimmer 39 Euro<br />
* [http://www.aohostels.com/de/karlsruhe/karlsruhe-hauptbahnhof/ A&O-Hostel(76)], ca. 25 Minuten zu Fuss, Preise: It's complicated...<br />
<br />
== Wohnmobil Parkplatz ==<br />
In Karlsruhe gibt es kostenlose [http://www.karlsruhe-tourismus.de/buchen/karlsruhe-hotels-privatzimmer-camping/Wohnmobilstellplaetze Stellplätze für Wohnmobile]. Zum Beispiel der [http://www.openstreetmap.org/#map=19/48.98980/8.40506 Park&Ride Parkplatz Ettlinger Allee] in GPN Nähe.<br />
<br />
<br />
{{Navigationsleiste GPN14}}</div>Clshttps://entropia.de/index.php?title=GPN14:Unterkunft&diff=30460GPN14:Unterkunft2014-05-18T16:44:37Z<p>Cls: /* Biete Schlafmoeglichkeit */</p>
<hr />
<div>Es soll ja Nerds geben die auch mal die Mate wegstellen und schlafen wollen. <br />
<br />
<br />
<br />
== Suche Unterkunft ==<br />
<br />
* Name, Kontakt (jabber|irc|mail|telephon|...)<br />
<br />
<br />
== Biete Schlafmoeglichkeit ==<br />
<br />
* Name, Anzahl Schlafplaetze (noch frei), Kontakt (jabber|irc|mail|telephon|...)<br />
<br />
<br />
{| border=1 cellspacing="0" cellpadding="4"<br />
|- <br />
! align="center" | Wer<br />
! align="center" | Anzahl Plätze<br />
! align="center" | belegt<br />
! align="center" | frei<br />
! align="center" | Kommentar<br />
! align="center" | Kontakt<br />
|-<br />
| align="center" | Ralf<br />
| align="center" | 4<br />
| align="center" | 4<br />
| align="center" | 0<br />
| align="center" | 500m zur HfG<br />
| align="center" | mail: ralf@entropia.de<br />
|-<br />
| align="center" | Chris<br />
| align="center" | 3<br />
| align="center" | 0<br />
| align="center" | 0<br />
| align="center" | 4km zur HfG<br />
| align="center" | mail: cls at posteo.de<br />
|-<br />
| align="center" | -<br />
| align="center" | -<br />
| align="center" | -<br />
| align="center" | -<br />
| align="center" | <br />
| align="center" | <br />
|}<br />
<br />
== Jugendherberge ==<br />
<br />
[http://karlsruhe.jugendherberge-bw.de/ Jugendherberge Karlsruhe] 30min zu Fuß, 15min mit der Tram (Linie 3 und 2).<br />
<br />
<br />
== Hotels ==<br />
<br />
Aktuelle Preise am besten auf der jeweiligen Hotelseite, [http://www.trivago.de Trivago] und <br />
[http://www.hrs.de HRS] anschauen und vergleichen.<br />
Die angegebenen Preise sind die gefundenen günstigsten Preise pro Person und Nacht, <br />
bei drei gebuchten Übernachtungen, Stand Anfang März. Die in Klammern angegeben<br />
Zahlen sind die Trivago-Bewertungen, Sortierung nach Entfernung zur HfG.<br />
<br />
<br />
* [http://www.acora.de/de/Karlsruhe.htm Hotel Acora(82)], Dependance, ca. 5 Minuten zu Fuss, Appartement für 4 Personen 20 Euro<br />
* [http://www.acora.de/de/Karlsruhe.htm Hotel Acora(82)], Haupthaus, ca. 10 Minuten zu Fuss, Einzelzimmer 48 Euro, Doppelzimmer 28 Euro<br />
* [http://www.hotel-rio.de Hotel Rio(84)], ca. 10 Minuten zu Fuss, Einzelzimmer 74 Euro, Doppelzimmer 41 Euro<br />
* [http://www.hotel-santo.de Hotel Santo(78)], ca. 10 Minuten zu Fuss, Einzelzimmer 62 Euro, Doppelzimmer 31 Euro<br />
* [http://www.hoteleden-karlsruhe.de Hotel Eden(74)], ca. 15 Minuten zu Fuss, Einzelzimmer 49 Euro, Doppelzimmer 33 Euro<br />
* [http://www.hotelastoria-karlsruhe.de Hotel Astoria(74)], ca. 15 Minuten zu Fuss, Einzelzimmer 53 Euro, Doppelzimmer 35 Euro, Dreibettzimmer 27 Euro<br />
* [http://www.hotelelite-ka.de Hotel Elite(79)], ca. 15 Minuten zu Fuss, Einzelzimmer 58 Euro, Doppelzimmer 37 Euro, Dreierzimmer 27 Euro<br />
* [http://www.stadthotel-karlsruhe.de/ Hotel Alte Münze(76)], ca. 15 Minuten zu Fuss, Einzelzimmer 59 Euro<br />
* [http://www.hotelkarlsruhe.de/ Hotel Am Karlstor(74)], ca. 15 Minuten zu Fuss, Einzelzimmer 66 Euro, Doppelzimmer 39 Euro<br />
* [http://www.aohostels.com/de/karlsruhe/karlsruhe-hauptbahnhof/ A&O-Hostel(76)], ca. 25 Minuten zu Fuss, Preise: It's complicated...<br />
<br />
<br />
== Wohnmobil Parkplatz ==<br />
In Karlsruhe gibt es kostenlose [http://www.karlsruhe-tourismus.de/buchen/karlsruhe-hotels-privatzimmer-camping/Wohnmobilstellplaetze Stellplätze für Wohnmobile]. Zum Beispiel der [http://www.openstreetmap.org/#map=19/48.98980/8.40506 Park&Ride Parkplatz Ettlinger Allee] in GPN Nähe.<br />
<br />
<br />
{{Navigationsleiste GPN14}}</div>Clshttps://entropia.de/index.php?title=GPN14:Motto&diff=30047GPN14:Motto2014-01-18T12:45:21Z<p>Cls: /* Hier sammeln wir Mottovorschläge für die GPN14 */</p>
<hr />
<div><br />
== Aufruf ==<br />
Hallo,<br />
<br />
dieses Jahr wird es wieder eine GoulaschProgrammiernacht (GPN) geben.<br />
Diese findet voraussichtlich vom 19.06.2014 bis 22.06.2014 in der<br />
HfG/ZKM statt.<br />
<br />
Wir suchen ein originelles Motiv für Plakate, TShirts/Hoodies uvm.<br />
Also pack den Malkasten, oder das Grafikprogramm Deines Vertrauens aus<br />
und sende uns Deine Ideen. Das Motiv sollte zu einem Motto passen.<br />
Entweder Du denkst Dir eins aus oder schaust in der bereits vorhanden<br />
Liste der Mottovorschlägen [1] nach.<br />
<br />
Hier ein paar Wünsche von uns bzgl. technische Anforderungen. Bei<br />
Problemen kannst Du Dich jederzeit an uns wenden.<br />
<br />
- Werden Pixelgrafiken verwendet, sollte man damit mindestens 100dpi bei<br />
einem A1 Ausdruck erreichen können.<br />
<br />
- Alle verwendeten Grafiken müssen frei sein oder eine geeignete Lizenz<br />
besitzen. Andere Situation müssen Fall zu Fall geklärt werden. N.B.:<br />
Obwohl die GPN ehrenamtlich organisiert und von einem gemeinnützigen<br />
Verein getragen wird, ist es eine kommerzielle Veranstaltung im Sinne<br />
der Creative-Commons-Lizenzen. Daher kann kein Inhalt verwendet werden,<br />
der unter einer Lizenz für nicht-kommerzielle Nutzung steht.<br />
<br />
- Bitte erstelle eine einfarbige, vereinfachte Version für den Textildruck.<br />
<br />
- Vektorgrafiken mit Ebenen sind erwünscht aber kein<br />
Ausschlusskriterium. Falls du besser mit Stift und Pinsel unterwegs bist<br />
können wir auch versuchen das Design zu digitalisieren.<br />
<br />
=== Wichtig ===<br />
Schicke deine Vorschläge an gpnorga@entropia.de oder lade sier direkt in<br />
das Wiki [2]. Einsendeschluss ist der 1. Februar 2014.<br />
<br />
Wir freuen uns auf eure Einsendungen<br />
Die GPN-Orga.<br />
<br />
[1] https://entropia.de/GPN14:Motto<br />
Ihr könnt auch bei den alten Mottovorschlägen nachschauen oder euch<br />
inspirieren lassen. Einfach die Zahl durch eine andere Zahl zwsichen 6<br />
und 13 ersetzen.<br />
<br />
[2] https://entropia.de/GPN14:Motto<br />
<br />
<br />
== Hier sammeln wir Mottovorschläge für die GPN14 ==<br />
<br />
* „Irgendwas mit großen Blitzen“ + Teslaspule<br />
* no space left on device<br />
* devices left in space<br />
* back to the root<br />
* Das merken die NIE<br />
[[Datei:Merkln.png|thumb]]<br />
* All Things Considered<br />
* Told you so<br />
* too big to fail<br />
<br />
<br />
{{Navigationsleiste GPN14}}</div>Clshttps://entropia.de/index.php?title=Benutzer:Cls&diff=30046Benutzer:Cls2014-01-18T12:04:09Z<p>Cls: </p>
<hr />
<div>'''Kontakt'''<br />
* Email: cls (at) posteo dot de<br />
* Jabber: cls (at) jabber dot org<br />
<br />
'''Interessen'''<br />
* work <br />
** [http://syntheism.org/wp-content/uploads/2013/06/science-stand-back.jpg science]<br />
** [http://parco.iti.kit.edu/software/networkit.shtml algorithms]<br />
** [[KaPy|Python]]<br />
* play<br />
** guitar playing and recording<br />
* politics<br />
** netzpolitik<br />
** [http://www.youtube.com/watch?v=HnoOReDd-fY intellectual property]</div>Clshttps://entropia.de/index.php?title=Benutzer:Cls&diff=30045Benutzer:Cls2014-01-18T11:56:25Z<p>Cls: </p>
<hr />
<div>'''Kontakt'''<br />
* Email: cls (at) posteo dot de<br />
* Jabber: cls (at) jabber dot org<br />
<br />
'''Interessen'''<br />
* work <br />
** algorithm engineering<br />
* play<br />
** guitar playing and recording<br />
* etc<br />
** [http://www.youtube.com/watch?v=HnoOReDd-fY intellectual property]</div>Clshttps://entropia.de/index.php?title=Benutzer:Cls&diff=30044Benutzer:Cls2014-01-18T11:52:51Z<p>Cls: Die Seite wurde neu angelegt: „'''Kontakt''' * Email: cls (at) posteo dot de * Jabber: cls (at) jabber dot org '''Interessen''' *“</p>
<hr />
<div>'''Kontakt'''<br />
* Email: cls (at) posteo dot de<br />
* Jabber: cls (at) jabber dot org<br />
<br />
'''Interessen'''<br />
*</div>Clshttps://entropia.de/index.php?title=GPN14&diff=30040GPN142014-01-18T11:28:08Z<p>Cls: </p>
<hr />
<div>== Termin ==<br />
von Donnerstag 19.06. bis Sonntag 22.06. in der Hochschule für Gestalltung (HfG), Karlsruhe<br />
<br />
<br />
== Motto Brainstorming ==<br />
<br />
* told you so<br />
<br />
== Allgemein ==<br />
siehe auch [[GPN]]</div>Clshttps://entropia.de/index.php?title=Hackerfryhstyck&diff=30032Hackerfryhstyck2014-01-16T13:20:40Z<p>Cls: /* Nächstes Frystyck */</p>
<hr />
<div>__NOTOC__<br />
<br />
==Fryhstyck statt Arbyte!==<br />
Verschwende auch du deine Zeit beim [[Wikipedia:de:Soziales Handeln|sozialisierenden]] [[Hackerfryhstyck]]!<br />
<br />
Allgemeines zum Fryhstyck: Wenn du nicht weißt, was du noch mitbringen könntest, dann trag dich einfach so ein und beteilige dich ggf. finanziell bei den Leuten, die eingekauft haben. Oder, wenn du nicht dynamisch nach der Anzahl der eingetragenen Personen Zeug mitbringen möchtest, kannst du auch mit Mengenangaben arbeiten (z.B. "2L Milch und 4 Brötchen"), damit "die Einkäufer" kalkulieren können, wie viel sie mitbringen müssen (und nicht so viel zu schleppen haben).<br />
<br />
<br />
==Nächstes Frystyck==<br />
<br />
Das nächste Frystyck findet am Samstag, den 18.01.2014 wahrscheinlich ab etwa 11:23 Uhr statt:<br />
<br />
Das Thema ist: '''GPN, GPN, MPU, ja!'''. Im Anschluss werden bessere GPN Mottos entworfen und verbessert Freiwillige vor!<br />
<br />
Wer frühstückt mit?<br />
<br />
* florolf<br />
* Nervengift<br />
* cls (Chris)<br />
<br />
==Themenfryhstycke (Ideenliste)==<br />
<br />
* Pyjamafryhstyck (mit Ybernachtung) <br />
* Flauschiges Fryhstyck<br />
* Kuchen(/Torten)-Fryhstyck<br />
* Pariser Fryhstyck<br />
* antiveganes Fryhstyck<br />
* eingelegtes Fryhstyck<br />
* Bierfryhstyck<br />
* Ernafryhstyck<br />
* 1-kilo-Fryhstyck<br />
* dekadentes Fryhstyck<br />
* Dosenfryhstyck<br />
* Dinge-die-man-unter-der-tyr-durchschieben-kann-Fryhstyck<br />
* Nacktfryhstyck<br />
* Chilifryhstyck<br />
* bio-Fryhstyck<br />
* Hägarhackerfryhstyck<br />
* BrazingBrunch a metal-joining process <br />
* Soldering or the dissolution of marriage Fryhstyck<br />
* There will be cake<br />
* Veissvurstvrystyck<br />
* Napffryhstyck<br />
<br />
==Themenfryhstycke (Erledigt)==<br />
<br />
* braunes Fryhstyck<br />
* Hack-KAR-Fryhstyck am Karfreitag<br />
* GPN9 Fryhstyck<br />
* Schwarz-weisses Fryhstyck<br />
<br />
==... und trotzdem ein sauberer Club==<br />
Natuerlich macht das ganze nur Spass wenn die Atmosphaere auch gemuetlich ist und daher<br />
nutzen wir die Gelegenheit auch gleich dazu, vorher und nachher auch etwas [[Subotnik|aufzuraeumen]].<br />
Ein wenig Spuelen, bissel leere Flaschen einsortieren ... alles schnell gemacht und<br />
nachher fuehlt sich jeder wohl im Club!<br />
<br />
<br />
[[Kategorie:Projekte]]<br />
[[Kategorie:Entropia]]<br />
[[Kategorie:Termine]]</div>Clshttps://entropia.de/index.php?title=GPN13:Motto&diff=27332GPN13:Motto2013-02-14T21:33:13Z<p>Cls: </p>
<hr />
<div>== Vorschläge ==<br />
<br />
=== Ideensammlung ===<br />
* Mett<br />
* Gulaschprogrammiermett<br />
* Speck-Drum Analyse<br />
* Hack 'n Bläh<br />
* Wir krümmen alles, außer die Raum-Zeit<br />
* Sorry HAL, but I can do that!<br />
* acht<br />
<br />
=== BYO DIY ===<br />
[[Datei:byo-diy.jpeg|200px|thumb|left|Entwurf Logovorschlag BYO-DIY]]<br />
* Vorschlag von NicApicella<br />
* '''Bring Your Own Do It Yourself''': Die GPN versteht sich einerseits als mitmach-Event (BYO), soll andrerseits zum selbermachen animieren (DIY). Insofern: "Bring was mit, bring dich ein – lerne es selbst zu machen, bastle an deinem oder fremdem Projekt(en)."<br />
* Disclaimer zum Entwurf: Ich kann nicht zeichnen, noch viel weniger in Software. :-) Das Logo soll also eher als Inspiration dienen; zumindest sollte jemand mit "mad Skillz" eine vernünftige digitale Version von machen.<br />
* Das Logo soll die drei Bereiche Hardware (-> Lötkolben), Software (-> Maus) und Gulasch (-> Suppenkelle) und deren Zusammenspiel auf der GPN verdeutlichen.<br />
<br />
<br />
=== kein Motto ===<br />
wie immer: kein Motto, aber ein Logo. hat die letzten jahre super funktioniert. lasst in dem vorschlag oben doch einfach die buchstaben weg.<br />
<br />
-- der cupe aus dem off<br />
<br />
[[Datei:Gpn-geb.png|thumb|right|Just my two cents for the GPN13 logo brainstorming - cls]]<br />
<br />
{{Navigationsleiste GPN13}}</div>Clshttps://entropia.de/index.php?title=GPN13:Motto&diff=27331GPN13:Motto2013-02-14T21:32:51Z<p>Cls: </p>
<hr />
<div>== Vorschläge ==<br />
<br />
=== Ideensammlung ===<br />
* Mett<br />
* Gulaschprogrammiermett<br />
* Speck-Drum Analyse<br />
* Hack 'n Bläh<br />
* Wir krümmen alles, außer die Raum-Zeit<br />
* Sorry HAL, but I can do that!<br />
* acht<br />
<br />
=== BYO DIY ===<br />
[[Datei:byo-diy.jpeg|200px|thumb|left|Entwurf Logovorschlag BYO-DIY]]<br />
* Vorschlag von NicApicella<br />
* '''Bring Your Own Do It Yourself''': Die GPN versteht sich einerseits als mitmach-Event (BYO), soll andrerseits zum selbermachen animieren (DIY). Insofern: "Bring was mit, bring dich ein – lerne es selbst zu machen, bastle an deinem oder fremdem Projekt(en)."<br />
* Disclaimer zum Entwurf: Ich kann nicht zeichnen, noch viel weniger in Software. :-) Das Logo soll also eher als Inspiration dienen; zumindest sollte jemand mit "mad Skillz" eine vernünftige digitale Version von machen.<br />
* Das Logo soll die drei Bereiche Hardware (-> Lötkolben), Software (-> Maus) und Gulasch (-> Suppenkelle) und deren Zusammenspiel auf der GPN verdeutlichen.<br />
<br />
<br />
=== kein Motto ===<br />
wie immer: kein Motto, aber ein Logo. hat die letzten jahre super funktioniert. lasst in dem vorschlag oben doch einfach die buchstaben weg.<br />
<br />
-- der cupe aus dem off<br />
<br />
[[Datei:Gpn-geb.png|Just my two cents for the GPN13 logo brainstorming - cls]]<br />
<br />
{{Navigationsleiste GPN13}}</div>Clshttps://entropia.de/index.php?title=Datei:Gpn-geb.png&diff=27330Datei:Gpn-geb.png2013-02-14T21:31:32Z<p>Cls: Just my two cents for the GPN13 Logo Brainstorming.</p>
<hr />
<div>== Beschreibung ==<br />
Just my two cents for the GPN13 Logo Brainstorming.<br />
== Lizenz ==<br />
{{PD}}</div>Clshttps://entropia.de/index.php?title=GPN12:Steal_This_Talk&diff=26849GPN12:Steal This Talk2012-11-21T11:22:14Z<p>Cls: /* Weblinks */</p>
<hr />
<div>{{#css:GPN12:Stylesheet}}<br />
<br />
{{Youtube|id=S_TLRegwkx0}}<br />
<br />
Vortrag von Christian Staudt auf der [[GPN12]].<br />
<br />
In den letzten Monaten kam noch mehr Dynamik in die Auseinandersetzung um Immaterialgütermonopole (alias Urheberrecht, Patente & co). "Raubkopie", "Diebstahl geistigen Eigentums", "Piraterie" - die Rechteverwerter haben den Diskurs mit drastischen Begriffen aufgeladen, um eine Verschärfung der Kontrolle zu erwirken. Zeit für einen Kurs in geistiger Selbstverteidigung. Dazu ein Blick auf Technologie, Geschichte, Ökonomie und Politik des Kopierens. Seit wann versucht man Kreativität und Innovation auf diese Art zu regulieren? Mit welchem Erfolg? Wie reagiert man auf disruptive Technologien? Ein Konflikt zeichnet sich deutlich ab: Immer mehr Wertschöpfung geschieht in immaterieller Form, und der Verkauf von Kopien ist auf Knappheit angewiesen. Gleichzeitig schaffen wir Maschinen und Netzwerke, die immer effizienter kopieren - und zwar umsonst. Was für eine Zukunft steuern wir also an?<br />
<br />
== Folien ==<br />
<br />
* [[Media:StealThisTalk.pdf|PDF]] <br />
* [[Media:StealThisTalk-html.zip|HTML (Zip)]]<br />
<br />
== English Version ==<br />
<br />
A couple of weeks after his lecture, the author "translated" his talk into english: You can find his transcription [http://blog.cyberiada.info/?p=5 on his website].<br />
<br />
== Weblinks ==<br />
<br />
* [http://falkvinge.net/2011/06/21/ten-myths-about-patents/ Ten Myths About Patents] - Rick Falkvinge<br />
* [http://levine.sscnet.ucla.edu/general/intellectual/against.htm Against Intellectual Monopoly] - Michele Boldrin and David K. Levine<br />
* [http://www.peterfrase.com/2010/12/anti-star-trek-a-theory-of-posterity/ Anti-Star Trek: A Theory of Posterity] - Peter Frase<br />
* [http://moglen.law.columbia.edu/publications/anarchism.html Anarchism Triumphant: Free Software and the Death of Copyright] - Eben Moglen<br />
<br />
{{Navigationsleiste GPN12:Vorträge}}</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25787KaPy:ParallelGameOfLife2012-07-01T18:25:47Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben. Einige Grundbegriffe:<br />
<br />
* '''Engine''' The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.<br />
* '''Client''' There is one primary object, the Client, for connecting to a cluster.<br />
* '''View''' For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.<br />
<br />
Einige Funktionen für den Anfang:<br />
<br />
* ''View.activate'' Activate IPython magics associated with this View<br />
* ''View.scatter'' Partition a Python sequence and send the partitions to a set of engines.<br />
* ''View.execute'' Executes code on targets in blocking or nonblocking manner.<br />
* ''View.__getitem__'' Get object(s) by key_s from remote namespace<br />
<br />
<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25786KaPy:ParallelGameOfLife2012-07-01T18:25:11Z<p>Cls: /* IPython.parallel */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben. Einige Grundbegriffe:<br />
<br />
* '''Engine''' The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.<br />
* '''Client''' There is one primary object, the Client, for connecting to a cluster.<br />
* '''View''' For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.<br />
<br />
Einige Funktionen für den Anfang:<br />
<br />
* ''View.activate'' Activate IPython magics associated with this View<br />
* ''View.scatter'' Partition a Python sequence and send the partitions to a set of engines.<br />
* ''View.execute'' Executes code on targets in blocking or nonblocking manner.<br />
* ''View.__getitem__'' Get object(s) by key_s from remote namespace<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25785KaPy:ParallelGameOfLife2012-07-01T18:24:27Z<p>Cls: /* IPython.parallel */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben. Einige Grundbegriffe:<br />
<br />
* '''Engine''' 'The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.'<br />
* '''Client''' 'There is one primary object, the Client, for connecting to a cluster. '<br />
* '''View''' 'For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.'<br />
<br />
Einige Funktionen für den Anfang:<br />
<br />
* ''View.activate'' 'Activate IPython magics associated with this View'<br />
* ''View.scatter'' 'Partition a Python sequence and send the partitions to a set of engines.'<br />
* ''View.execute'' 'Executes code on targets in blocking or nonblocking manner.'<br />
* ''View.__getitem__'' 'Get object(s) by key_s from remote namespace'<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25784KaPy:ParallelGameOfLife2012-07-01T18:20:44Z<p>Cls: /* IPython.parallel */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben. Einige Grundbegriffe:<br />
<br />
* '''Engine''' 'The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.'<br />
* '''Client''' 'There is one primary object, the Client, for connecting to a cluster. '<br />
* '''View''' 'For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.'<br />
<br />
Einige Funktionen für den Anfang:<br />
<br />
* View.scatter<br />
* View.execute<br />
* View.activate<br />
* View.__getitem__<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25783KaPy:ParallelGameOfLife2012-07-01T18:16:10Z<p>Cls: /* 15. Juni 2012: IPython + mpi4py = paralleles Game of Life */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben. Einige Grundbegriffe:<br />
<br />
<br />
* '''Engine''' 'The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.'<br />
* '''Client''' 'There is one primary object, the Client, for connecting to a cluster. '<br />
* '''View''' 'For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.'<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25782KaPy:ParallelGameOfLife2012-07-01T18:15:31Z<p>Cls: /* Game of Life - Codebeispiel */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
TODO: Synatx Highlighter<br />
<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben. Einige Grundbegriffe:<br />
<br />
<br />
* '''Engine''' 'The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.'<br />
* '''Client''' 'There is one primary object, the Client, for connecting to a cluster. '<br />
* '''View''' 'For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.'<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25781KaPy:ParallelGameOfLife2012-07-01T18:15:11Z<p>Cls: /* IPython.parallel */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
TODO: Synatx Highlighter<br />
<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben. Einige Grundbegriffe:<br />
<br />
<br />
* '''Engine''' 'The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.'<br />
* '''Client''' 'There is one primary object, the Client, for connecting to a cluster. '<br />
* '''View''' 'For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.'<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25780KaPy:ParallelGameOfLife2012-07-01T18:14:58Z<p>Cls: /* IPython.parallel */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
TODO: Synatx Highlighter<br />
<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben.<br />
<br />
<br />
* '''Engine''' 'The IPython engine is a Python instance that takes Python commands over a network connection. Eventually, the IPython engine will be a full IPython interpreter, but for now, it is a regular Python interpreter.'<br />
* '''Client''' 'There is one primary object, the Client, for connecting to a cluster. '<br />
* '''View''' 'For each execution model, there is a corresponding View. These views allow users to interact with a set of engines through the interface.'<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25779KaPy:ParallelGameOfLife2012-07-01T18:13:43Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
TODO: Synatx Highlighter<br />
<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst. Die Architektur wird [http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html hier] beschrieben.<br />
<br />
* '''Client'''<br />
* '''Engines'''<br />
* '''View'''<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25778KaPy:ParallelGameOfLife2012-07-01T18:08:37Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
TODO: Synatx Highlighter<br />
<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst.<br />
<br />
* '''Client'''<br />
* '''Engines'''<br />
* '''View'''<br />
<br />
=== Game of Life - Codebeispiel ===<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
# -*- coding: utf-8 -*-<br />
# <nbformat>2</nbformat><br />
<br />
# <codecell><br />
<br />
from IPython.parallel import Client<br />
<br />
c = Client()<br />
v = c[:]<br />
with v.sync_imports():<br />
import numpy as np<br />
from mpi4py import MPI<br />
from itertools import product<br />
v.block = True<br />
<br />
# shuffle ids around so that view ids match up with mpi ranks<br />
v.execute("my_rank = MPI.COMM_WORLD.Get_rank()")<br />
ranks = v["my_rank"]<br />
v = c[list(reversed(ranks))]<br />
v.block = True<br />
# enable ipython magic commands for use with this view<br />
v.activate()<br />
<br />
# use zasims display functionality to display a state to ipython<br />
from zasim.display.qt import render_state_array, qimage_to_pngstr<br />
from IPython.core.display import publish_png<br />
def display_state(config, scale=5):<br />
img = render_state_array(config).scaled(config.shape[0] * scale, config.shape[1] * scale)<br />
pngstr = qimage_to_pngstr(img)<br />
publish_png(pngstr)<br />
<br />
def build_border(config):<br />
new = np.zeros((config.shape[0] + 2, config.shape[1] + 2), config.dtype)<br />
new[1:-1, 1:-1] = config<br />
return new<br />
<br />
# <codecell><br />
<br />
def offset_pos((y, x), (a, b)):<br />
return (y + a, x + b)<br />
<br />
# calculate the standard game of life<br />
def game_of_life(cconf, nconf):<br />
result = None<br />
W, H = cconf.shape<br />
for pos in product(xrange(1, W - 1), xrange(1, H - 1)):<br />
lu = cconf[offset_pos(pos, (-1, -1))]<br />
u = cconf[offset_pos(pos, (-1, 0))]<br />
ru = cconf[offset_pos(pos, (-1, 1))]<br />
l = cconf[offset_pos(pos, (0, -1))]<br />
m = cconf[offset_pos(pos, (0, 0))]<br />
r = cconf[offset_pos(pos, (0, 1))]<br />
ld = cconf[offset_pos(pos, (1, -1))]<br />
d = cconf[offset_pos(pos, (1, 0))]<br />
rd = cconf[offset_pos(pos, (1, 1))]<br />
nonzerocount = lu + u + ru + l + r + ld + d + rd<br />
<br />
result = m<br />
if m == 0:<br />
if 3 <= nonzerocount <= 3:<br />
result = 1<br />
else:<br />
if not (2 <= nonzerocount <= 3):<br />
result = 0<br />
<br />
nconf[pos] = result<br />
<br />
# copy the sides where the opposite side is in the same array<br />
def copy_up_down(conf):<br />
W, H = conf.shape<br />
conf[Ellipsis,0] = conf[Ellipsis,H - 2]<br />
conf[Ellipsis,H - 1] = conf[Ellipsis,1]<br />
<br />
# copy the sides where the opposite side is on another engine<br />
# this uses MPI "message passing"<br />
def distribute_borders(config):<br />
W, H = config.shape<br />
r = MPI.COMM_WORLD.Get_rank()<br />
size = MPI.COMM_WORLD.Get_size()<br />
# first, send our left side to the previous engine<br />
# and receive our right outside from the next engine<br />
MPI.COMM_WORLD.Sendrecv(config[1], (r - 1) % size, 0, config[W+1], (r + 1) % size, 0)<br />
# then, send our right side to the next engine and<br />
# receive our left outside from the previous engine<br />
MPI.COMM_WORLD.Sendrecv(config[W], (r + 1) % size, 0, config[0], (r - 1) % size, 0)<br />
<br />
# <codecell><br />
<br />
# generate a random start configuration<br />
za_d = np.random.randint(0, 2, (40, 40))<br />
<br />
#za_d = np.zeros((40, 40))<br />
#za_d[1:4, 1:4] = [[0, 1, 0], [0, 0, 1], [1, 1, 1]]<br />
<br />
# distribute the starting configuration among all engines<br />
v.scatter("cconf", za_d)<br />
<br />
# push the functions we need for calculation to all engines<br />
v.push({"build_border": build_border,<br />
"game_of_life": game_of_life,<br />
"distribute_borders": distribute_borders,<br />
"copy_up_down": copy_up_down,<br />
"offset_pos": offset_pos})<br />
# generate borders for all stripes on all engines<br />
v.execute("cconf = build_border(cconf)")<br />
# and we need a "new configuration" array, so that we can<br />
# switch nconf and cconf after each step.<br />
v.execute("nconf = cconf.copy()")<br />
<br />
# <codecell><br />
<br />
def step():<br />
# first we run the game of life step reading from cconf writing into nconf<br />
v.execute("game_of_life(cconf, nconf)")<br />
# then we copy the borders locally<br />
v.execute("copy_up_down(nconf)")<br />
# and then distribute borders among engines<br />
v.execute("distribute_borders(nconf)")<br />
# and finally we switch cconf and nconf<br />
v.execute("cconf, nconf = nconf, cconf")<br />
<br />
# <codecell><br />
<br />
for i in range(10):<br />
step()<br />
# after a step, we strip the local border<br />
v.execute("view = cconf[1:-1, 1:-1]")<br />
# and gather all stripes into a big array<br />
conf_all = v.gather("view")<br />
# and display it<br />
display_state(conf_all)<br />
<br />
<br />
</syntaxhighlight><br />
<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25355KaPy:ParallelGameOfLife2012-06-16T13:31:22Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
TODO: Synatx Highlighter<br />
<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst.<br />
<br />
* '''Client'''<br />
* '''Engines'''<br />
* '''View'''<br />
<br />
=== Game of Life - Implementation ===<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25354KaPy:ParallelGameOfLife2012-06-16T13:07:47Z<p>Cls: /* IPython.parallel */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
TODO: Synatx Highlighter<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
IPython ist längst nicht mehr "nur" eine alternative Python Shell, sondern mittlerweile auch ein "tool for high level and interactive parallel computing", wie es auf der Webseite heisst.<br />
<br />
=== Game of Life - Implementation ===<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25335KaPy:ParallelGameOfLife2012-06-15T19:39:42Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
TODO: Synatx Highlighter<br />
TODO: Codebeispiel [https://gist.github.com/2938254]<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
=== Game of Life - Implementation ===<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25334KaPy:ParallelGameOfLife2012-06-15T19:37:36Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
TODO: Synatx Highlighter<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
=== Game of Life - Implementation ===<br />
<br />
=== Lektüre ===<br />
<br />
* [http://ipython.org/ipython-doc/dev/parallel/index.html Using IPython for parallel computing]</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25333KaPy:ParallelGameOfLife2012-06-15T19:36:00Z<p>Cls: /* mpi4py */</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
TODO: Synatx Highlighter<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
'''Message Passing Interface (MPI)''' ist ein Standard, der den Nachrichtenaustausch bei parallelen Berechnungen auf verteilten Computersystemen beschreibt. Eine MPI-Applikation besteht in der Regel aus mehreren miteinander kommunizierenden Prozessen, die alle zu Beginn der Programmausführung parallel gestartet werden. Alle diese Prozesse arbeiten dann gemeinsam an einem Problem und nutzen zum Datenaustausch Nachrichten, welche explizit von einem zum anderen Prozess geschickt werden. Ein Vorteil dieses Prinzips ist es, dass der Nachrichtenaustausch auch über Rechnergrenzen hinweg funktioniert.<br />
<br />
'''[http://code.google.com/p/mpi4py/ mpi4py]''' stellt Python-Bindings für den MPI-Standard zur Verfügung. Die Serialisierung von Objekten übernimmt [http://docs.python.org/library/pickle.html pickle].<br />
<br />
=== IPython.parallel ===<br />
<br />
=== Game of Life - Implementation ===<br />
<br />
=== Quellen ===</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25332KaPy:ParallelGameOfLife2012-06-15T19:31:15Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
TODO: Synatx Highlighter<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
=== mpi4py ===<br />
<br />
=== IPython.parallel ===<br />
<br />
=== Game of Life - Implementation ===<br />
<br />
=== Quellen ===</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25331KaPy:ParallelGameOfLife2012-06-15T19:28:29Z<p>Cls: </p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
TODO: Synatx Highlighter<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---></div>Clshttps://entropia.de/index.php?title=KaPy&diff=25330KaPy2012-06-15T19:28:03Z<p>Cls: /* 15. Juni 2012: IPython + mpi4py = paralleles Game of Life */</p>
<hr />
<div>{{FIXME}}<br />
<br />
Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
<br />
<br />
<br />
== [[KaPy:ParallelGameOfLife | 15. Juni 2012: IPython + mpi4py = paralleles Game of Life]] ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy:ParallelGameOfLife&diff=25329KaPy:ParallelGameOfLife2012-06-15T19:22:38Z<p>Cls: Die Seite wurde neu angelegt: „== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==“</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25328KaPy2012-06-15T19:22:28Z<p>Cls: </p>
<hr />
<div>{{FIXME}}<br />
<br />
Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
<br />
<br />
<br />
== [[KaPy:ParallelGameOfLife | 15. Juni 2012: IPython + mpi4py = paralleles Game of Life]] ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=Kapy:ParallelGameOfLife&diff=25327Kapy:ParallelGameOfLife2012-06-15T19:22:05Z<p>Cls: Die Seite wurde neu angelegt: „== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==“</p>
<hr />
<div>== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25326KaPy2012-06-15T19:21:38Z<p>Cls: /* 15. Juni 2012: IPython + mpi4py = paralleles Game of Life */</p>
<hr />
<div>{{FIXME}}<br />
<br />
Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
<br />
<br />
<br />
== [[Kapy:ParallelGameOfLife | 15. Juni 2012: IPython + mpi4py = paralleles Game of Life]] ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25325KaPy2012-06-15T19:12:23Z<p>Cls: </p>
<hr />
<div>{{FIXME}}<br />
<br />
Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
<!-- Was ist MPI?<br />
Message Passing Interface<br />
Timo: Paralleles Game of Life<br />
IPython Profiles<br />
Qtconsole<br />
from IPython.parallel import Client<br />
c = Client()<br />
c.ids<br />
view = c[:]<br />
resu<br />
Client: Verbindung zum Cluster<br />
Engines:<br />
View: Auswahl von Engines<br />
Load Balancd View: <br />
Ipython Magic %px <statement><br />
Parallel Execute<br />
z.B:<br />
%px a = 100<br />
v["a"] # gib mir inhalt aller variablen 'a'<br />
dafür view.activate()<br />
Parallelisierung<br />
Array auf Engines Verteilen<br />
view.scatter("name", array)<br />
view.execute("statement")<br />
Pickle im Hintergrund<br />
MPI.COMM_WORLD.Sendrecv<br />
Ein Befehl - vermeidet Dining Philosophers Problem.<br />
apply - nimmt Code-Objekte statt Strings<br />
Lektüretip:<br />
mpi4py Tutorial / Documentation<br />
---><br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25324KaPy2012-06-15T19:10:10Z<p>Cls: </p>
<hr />
<div>{{FIXME}}<br />
<br />
Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25323KaPy2012-06-15T19:09:45Z<p>Cls: </p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html Numpy-Array], und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25322KaPy2012-06-15T19:08:39Z<p>Cls: /* 15. Juni 2012: IPython + mpi4py = paralleles Game of Life */</p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-Numpy-Array, und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25321KaPy2012-06-15T19:08:19Z<p>Cls: /* 15. Juni 2012: IPython + mpi4py = paralleles Game of Life */</p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py]. Das Prinzip: Partitioniere das Spielfeld, ein 2D-Array, und verteile es auf mehrere Prozessoren.<br />
<br />
TODO: Notizen nachtragen<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25320KaPy2012-06-15T19:06:51Z<p>Cls: /* 15. Juni 2012: IPython + mpi4py = paralleles Game of Life */</p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py mpi4py].<br />
<br />
TODO: Notizen nachtragen<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25319KaPy2012-06-15T19:05:47Z<p>Cls: /* 15. Juni 2012: IPython + mpi4py = paralleles Game of Life */</p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
Timo präsentiert uns eine parallele Implementation des [http://de.wikipedia.org/wiki/Game_of_Life Game of Life], realisiert mit [http://ipython.org IPython] und [http://code.google.com/p/mpi4py/ mpi4py].<br />
<br />
TODO: Notizen nachtragen<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25318KaPy2012-06-15T18:56:50Z<p>Cls: </p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
TODO: Notizen nachtragen<br />
<br />
<br />
== <FUTURE> : Wie verpacke ich meine Python-Software richtig? - setuptools, pip, sphinx & Co ==</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25317KaPy2012-06-15T18:54:09Z<p>Cls: </p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython + mpi4py = paralleles Game of Life ==<br />
<br />
TODO: Notizen nachtragen</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25316KaPy2012-06-15T18:53:42Z<p>Cls: </p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython und mpi4py ==<br />
<br />
TODO: Notizen nachtragen</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25315KaPy2012-06-15T18:45:10Z<p>Cls: </p>
<hr />
<div>Die '''Karlsruhe Python User Group (KaPy)''' trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython und mpi4py ==<br />
<br />
TODO:</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25313KaPy2012-06-15T18:41:23Z<p>Cls: </p>
<hr />
<div>Die **Karlsruhe Python User Group (KaPy)** trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython und mpi4py ==<br />
<br />
TODO:</div>Clshttps://entropia.de/index.php?title=KaPy&diff=25312KaPy2012-06-15T18:41:03Z<p>Cls: </p>
<hr />
<div>Die **Karlsruhe Python User Group (KaPy)** trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython und mpi4py ==<br />
<br />
TODO:<br />
<br />
<br />
<source lang="python"><br />
def main():<br />
print "Hallo Welt!"<br />
<br />
if __name__ == '__main__':<br />
main()<br />
</source></div>Clshttps://entropia.de/index.php?title=KaPy&diff=25311KaPy2012-06-15T18:39:58Z<p>Cls: </p>
<hr />
<div>Die **Karlsruhe Python User Group (KaPy)** trifft sich in den Räumen des Entropia jeweils am dritten Freitag im Monat. Manchmal (aber nur manchmal) haben Fra... die KaPysten einen Vortrag vorbeireitet. Meistens aber nicht.<br />
<br />
Eine Mailing Liste gibt es unter https://lists.bl0rg.net/cgi-bin/mailman/listinfo/kapy<br />
<br />
{{FIXME}}<br />
<br />
<br />
<br />
== 15. Juni 2012: IPython und mpi4py ==<br />
<br />
TODO:</div>Clshttps://entropia.de/index.php?title=GPN12:Steal_This_Talk&diff=25080GPN12:Steal This Talk2012-06-10T08:57:39Z<p>Cls: </p>
<hr />
<div>{{#css:GPN12:Stylesheet}}<br />
<br />
Vortrag von Christian Staudt auf der [[GPN12]].<br />
<br />
In den letzten Monaten kam noch mehr Dynamik in die Auseinandersetzung um Immaterialgütermonopole (alias Urheberrecht, Patente & co). "Raubkopie", "Diebstahl geistigen Eigentums", "Piraterie" - die Rechteverwerter haben den Diskurs mit drastischen Begriffen aufgeladen, um eine Verschärfung der Kontrolle zu erwirken. Zeit für einen Kurs in geistiger Selbstverteidigung. Dazu ein Blick auf Technologie, Geschichte, Ökonomie und Politik des Kopierens. Seit wann versucht man Kreativität und Innovation auf diese Art zu regulieren? Mit welchem Erfolg? Wie reagiert man auf disruptive Technologien? Ein Konflikt zeichnet sich deutlich ab: Immer mehr Wertschöpfung geschieht in immaterieller Form, und der Verkauf von Kopien ist auf Knappheit angewiesen. Gleichzeitig schaffen wir Maschinen und Netzwerke, die immer effizienter kopieren - und zwar umsonst. Was für eine Zukunft steuern wir also an?<br />
<br />
'''Folien:''' <br />
<br />
* (.pdf) [[Datei:StealThisTalk.pdf]] <br />
* (.html) [[Datei:StealThisTalk-html.zip]]<br />
<br />
[[Kategorie:GPN12]]<br />
[[Kategorie:Vorträge]]<br />
{{Navigationsleiste GPN12}}</div>Cls