The Cilk Road to Open Source

Intel has announced that it is placing the Cilk Plus Compiler and runtime into open source which means Intel is driving forward endeavours to ensure C/C++ becomes a starting point for a standard parallel programming language. 

It’s an interesting move and one that is predicated on simplicity of design, which in the esoteric world of parallel programming could have a lot of value.  I’ve made a reference to Cilk Plus in a blog posting earlier this year pointing out that Intel was intent on achieving a level of standardisation. And it seems to have reached this point.

The Cilk Plus language is an extension of C/C++ which supports parallel programming. Cilk technology was acquired by Intel in 2009 and since then the company has turned it into one of three pillars of Intel’s parallel building blocks.  The other two building blocks are Threading Building Blocks and Array Building Blocks.

In a recent ‘call to arms’ blog post James Reinders, Intel’s chief evangelist for software and an Intel expert in the area of parallelism, said: ‘It’s time to make parallelism a full first class citizen in C and C++… the time has come for high level constructs for task and data parallelism to be explicitly added to C and C++. This will enable C and C++ to be fully portable, easily intelligible and consistently decipherable by a compiler.”

Cilk is essentially a general-purpose programming language for multithreaded parallel programming. It supports parallel programming through the addition of three keywords and vector friendly array notation.  As a result, it encompasses both task-level parallelism and data parallelism in a shared memory environment.

By placing it into the open source community, Intel is essentially making a call for arms for the development of a standard C/C++ parallel programming language. 

Because Cilk Plus only adds a handful of extra constructs to C/C++, it offers a more mainstream alternative to task parallel frameworks like Open MP and more complex vector-oriented programming languages.

To use the parallel features of Cilk two key words are needed: spawn and sync. The spawn keyword indicates that the procedure call it modifies can safely operate in parallel with other executing code. The sync keyword indicates that execution of the current procedure cannot proceed until all previously spawned procedures have completed and returned their results to the parent frame.

Reinders says there is strong value in adding some basic task parallelism and data parallel support into both C and C++. “In terms of task parallelism nothing is more proven than the simple spawn/sync and parallel for of Cilk Plus,” he says, adding that in terms of data parallelism “nothing is more simple than extending syntax to make data parallelism explicit via array operations.”

Intel says its plan is to implement the full Intel Cilk Plus extension, as laid out in the Intel Cilk Plus Language Specification and this is the first release of what is going to be an ongoing project. The company quite openly says it doesn’t have all the answers and is frankly asking for help and advice from developers. So if you’ve got any valuable input don’t be shy. James Reinders’ blog is a good place to contact Intel.

In terms of potential drawbacks one commentator points out that the release of a new parallel toolkit every few months can be a mixed blessing. While choice is good it’s difficult enough to decide which tool kit will survive and flourish and which will fade away.

An earlier blog post by Reinders addresses this to some extent and its well worth a read. It puts the open release of Cilk Plus Compiler and runtime in the wider context of C/C++ for parallel programming, Intel’s parallel building blocks and OpenMP. It also gives you a little bit of history about Cilk’s beginnings as a research language at the Massachusetts Institute of Technology.

One Response

  1. […] of the blog. The round-up covers new parallel programming language Parasail; Cilk Plus, which Intel made open source last summer; OpenCL, which enables you to write applications that can run across different processor types […]

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: