Parallel programming for sequential programmers

Our very own Jacob Sparre Andersen is doing a course on Parallel Ada programming for sequential programmers at Open Source Days 2013:

Assuming you already know sequential programming in a procedural programming language, this course can get you started writing parallel programs using the Ada programming language.

Short and sweet. The course contents are as follows.

  1. A quick introduction to the basics of sequential programming in Ada. — Just enough to allow you to map your existing programming knowledge to Ada. 45 minutes lecture + 45 minutes exercises.
  2. Creating and understanding basic tasks (parallel threads of execution) with Ada. — I.e. parallel programming without interaction. 45 minutes lecture + 45 minutes exercises
  3. Communication between tasks using safe, shared objects. One kind of interaction between tasks. 45 minutes lecture + 45 minutes exercises
  4. Direct communication between tasks using rendezvous. — Another kind of interaction between tasks. 45 minutes lecture + 45 minutes exercises
  5. Patterns for implementing parallel execution. 45 minutes lecture

I’m so going. Next step: Getting an Open Source Days 2013 ticket.

Paraffin 2.0 for GNAT and ICC Ada compilers

Fresh from the hands of Brad Moore comes version 2.0 of his Paraffin library.

A suite of Ada 2005 generics to facilitate iterative and recursive parallelism for multicore systems and provide safer recursion for single and multicore systems.

New stuff in version 2.0 includes:

  • Paraffin has been compiled and tested using the Irvine ICC Ada compiler, running on both Windows and Linux.
  • Paraffin has been compiled and tested using GNAT AUX on an Android Samsung Galaxy S II Smart phone.
  • Paraffin has been compiled and tested using GNAT 2010 and 2011 GPL versions of the compiler on both Windows and Linux.
  • Paraffin now includes generics that allow deep recursion using a small stack. The generics feature parallel work seeking that monitors the usage of each workers stack, and defers work if the stack resource is approaching depletion. This allows idle worker tasks to resume the deferred work with a fresh stack, in a safe manner until all the work has been completed. Testing has shown that the overhead associated with the stack monitoring is minimal, and that the performance is such that it can also be attractive to consider using on systems that only have a single core.
  • Generics have been added that filter out poor work offers based on the depth of the recursion.
  • The optimal worker count is calculated by default for iterative looping, based on the number of available cores, and the number of iterations.
  • Increased portability, by providing the “Any” target, which does not use any OS services or vendor specific libraries.
  • Numerous performance improvements, particularly for the recursive generics, which were significantly improved.
  • Various bug fixes.

I’ll gladly admit that a lot of those items are far above my paygrade – I wouldn’t even know what to do with “deep recursion using a small stack”, but I do understand the significance of such a complicated piece of software running on Android, and combined with Stephen Leake’s Ada “Hello World” on Android success this seems like another great step towards being able to use Ada to build Android applications.

You can download Paraffin here and you can read Brad’s full announcement here.