
A Library of Parallel Algorithms - federicoponzi
https://www.cs.cmu.edu/~scandal/nesl/algorithms.html
======
glangdale
Back in around 2006 I was doing GPGPU regex and string matching and decided to
google around for parallel string matching algorithms. I spent a good chunk of
time scrolling around in the Vishkin's algorithm implementation and wondering
why it all felt so familiar; it was only when I scrolled back to the top of
the file that I realized it was familiar because _I wrote it_.

A fine example of why you should comment your code, as the person who reads it
in 10 years from now will be a stranger, even if that person is you.

~~~
microcolonel
> _A fine example of why you should comment your code, as the person who reads
> it in 10 years from now will be a stranger, even if that person is you._

For what it's worth, there _is_ at least a comment with your name in it. Maybe
I'm a narcissist, but those tend to jump out at me. ;- )

------
hackermailman
There is also the CMU free draft book on Parallel algorithms design
[http://www.parallel-algorithms-book.com/](http://www.parallel-algorithms-
book.com/)

~~~
Athas
This is great! I'm really inspired by the work CMU does on parallelism. They
have a parallel programming course[0] that results in some really impressive
final projects [1]. I also hear that CMU takes a "parallel-first" approach to
teaching algorithms and data structures, but I have not been able to find out
exactly how they do that.

[0]:
[http://15418.courses.cs.cmu.edu/fall2017/](http://15418.courses.cs.cmu.edu/fall2017/)

[1]:
[http://15418.courses.cs.cmu.edu/fall2016/article/13](http://15418.courses.cs.cmu.edu/fall2016/article/13)

~~~
gshrikant
There's also 15-210 Parallel and Sequential Data Structures and Algorithms [1]
which is what book GP referred to is developed for.

[1] [https://www.cs.cmu.edu/~15210/](https://www.cs.cmu.edu/~15210/)

------
alexggordon
Animations link appears to be broken. After doing some way back machine
snooping, looks like it hasn't been up since about 2000[0]. You can access the
legacy java applet animations here[1]

[0]
[https://web.archive.org/web/20000611153404/http://web.scanda...](https://web.archive.org/web/20000611153404/http://web.scandal.cs.cmu.edu/cgi-
bin/demo)

[1]
[http://www.cs.cmu.edu/~scandal/applets/](http://www.cs.cmu.edu/~scandal/applets/)

~~~
visox
Thx, the images seem to be broken/nomore

------
Athas
These algorithms are written in NESL, which is perhaps the cleanest example of
the oft-mentioned theory that parallel programming becomes simple in a
functional setting. It really is remarkable how flexible it is. Unfortunately,
I'm not sure NESL ever managed to run particularly fast in practice.

------
slaymaker1907
As someone who has done a lot of parallel programming, I really can't
recommend Java 8 streams enough. They have a bit of overhead, however, they
are incredibly easy to use and are extremely expressive.

~~~
nmg
In the talk "Clojure Concurrency" [1], Rich Hickey demands that everyone in
the room read "Java Concurrency in Practice" [2]. "It will scare the crap out
of you."

[1]
[https://youtu.be/dGVqrGmwOAw?t=23m57s](https://youtu.be/dGVqrGmwOAw?t=23m57s)
[2] [https://www.amazon.com/Java-Concurrency-Practice-Brian-
Goetz...](https://www.amazon.com/Java-Concurrency-Practice-Brian-
Goetz/dp/0321349601/)

~~~
peheje
Java 8 released march 2014. Youtube video published december 2012. Book
originally published 2006. What am I missing?

~~~
cle
The fact Java 8 streams only address a tiny sliver of the concurrency problems
addressed by JCIP.

In practice, Java 8 parallel streams are generally discouraged outside of raw
number crunching, which is rarely where we need parallel speedup anyway.

~~~
Coding_Cat
raw number crunching doesn't parallel speedup(!)?

~~~
cle
Didn't say that, I said that we rarely need parallelization for raw number
crunching. Developers use parallelization for coordinating expensive IO way
more often, and Java 8 streams solve almost nothing for that. Still need to
know and worry about other Java concurrency primitives like volatiles,
monitors, thread pools, etc. and all their pitfalls (race conditions,
deadlocks, etc.).

You should still read JCIP, it is still highly relevant in Java-land. Java 8
streams solved almost nothing in terms of concurrency (in fact they probably
created more problems than they solved...). You should still be scared of
concurrency in general, and particularly in Java. And you should definitely
consider a different language with more sane and modern concurrency primitives
if you really need concurrency.

------
Twirrim
Now if only I used NESL for anything.

