Cilk++ is three keywords and a runtime system that extend C++ to the realm of multicore programming. The platform-independent Cilk++ solution, illustrated below, addresses the key multicore programming challenges of development time, software reliability, and performance.
Cilk++ consists of five components:
Duncan McCallum, CEO of Cilk Arts, discusses the Cilk++ solution for multicore-enabling C++ applications
|
-
The three Cilk++ keywords: These keywords extend serial C++ into the realm of parallel programming. The keywords, when applied to an existing or new serial application, produce a Cilk++ source file which is a multicore-enabled version of the serial application. Other than the addition of the Cilk++ keywords to the serial code, little change to the original serial code is required to exploit its inherent parallelism. And other than the added keywords, the Cilk++ source is nearly identical to the serial original. That is, the Cilk++ source retains the serial semantics of your C++ code. As a result, programmers still work in the serial domain using their existing tools, making Cilk++ easy to learn and use. Serial debug and regression systems remain unchanged, thereby making it easy to affirm that no new serial bugs are introduced. Serial correctness is assured.
- The Cilk++ compiler: The Cilk++ compiler recognizes the three Cilk++ keywords and generates a parallel application. Because the Cilk++ compiler is an extension of an industry standard compiler (currently, Microsoft Visual C++ and GCC are supported), the native extensions and optimizations provided by the base compiler are supported. The resulting Cilk++ program runs with minimal - often immeasurable - overhead on a single processor.
- The Cilk++ Runtime System: The Cilk++ RTS is a component delivered with the binary executable of the Cilk-ified program. The RTS contains a proprietary "work-stealing" scheduler which delivers best-in-class application performance.
- The Cilk++ Race Detector: The CilkscreenTM race detector is used to test a Cilk++ binary program to ensure its parallel correctness. The race detector is mathematically guaranteed to find all race conditions in a Cilk-ified code. Identifying all cases where the result of the parallel execution could differ from the serial version ensures parallel correctness. In combination with the guarantee of serial correctness, CilkScreen assures that your multicore-enabled application is as reliable as the serial original.
- Cilk++ Hyperobjects: Global and other non-local variables can inhibit parallelism by inducing data races. Cilk hyperobjects are an innovative construct designed to solve data race problems created by parallel accesses to global variables.
