Intel® C++ Composer XE

利用Cilk™ Plus的Reducer解决并行程序中的竞态及按序计算问题

    使用Cilk™ Plus来对程序进行并行化比使用传统的Pthread方式来建立管理线程库容易得多,在一般情况下,利用关键字cilk_sync以及cilk_for可以使串行的程序更容易改写为并行的代码,尽管在一些复杂的并行情况下,使用cilk_sync以及cilk_for并不能解决程序中本身存在的数据竞态及多线程并行的协调管理问题。

    值得注意的是Cilk™ Plus并不是只有关键字的方式,Cilk™ Plus库也包含一些用于解决并行程序中的竞态、锁、多线程协调等问题的功能features。本文将提到的是Cilk Reducer它能有助于解决常见的累计型算法中存在的数据竞态及多线程间按序计算等问题。

1.    累计型算法常见于对一个变量进行多次叠加地更新值,比如以下代码:

  • Entwickler
  • C/C++
  • Intel® C++ Composer XE
  • Intel® Cilk™ Plus
  • Lizenzvertrag: 

    Cilk™ Plus并行程序的串行等价程序的执行过程

        C++社区的趋势近年来主要是通过以添加更多的库而不是语言关键字来实现增加程序的功能性,比如Threading Building Blocks以及Parallel Patterns库,但与主流发展趋势不同的是,Intel的Cilk™ Plus的实现方式则是以后者的形式——语言关键字来增加程序功能的,本文将就此给出分析。


        每一个使用关键字来定义并行Cilk™ Plus的程序都有一个已在编译器实现中定义好的串行语义。 通过将每一个cilk_sync及cilk_spawn替换为空,且将每一个cilk_for以for关键字来替代,编译器由此将并行的Cilk™ Plus程序处理为一个有效的串行C/C++程序。 当两个逻辑并行的线程同时访问同一内存位置且至少一个为写内存操作时,程序行为此时出现竞态,如果一个Cilk™ Plus并行程序没有竞态发生的话,此时它将产生与其串行等价程序相同的结果。编译器是如何保证其串行等价的结果一致的?考虑以下的代码:

  • Entwickler
  • C/C++
  • Intel® C++ Composer XE
  • Intel® Cilk™ Plus
  • Lizenzvertrag: 


    I've been trying to understand what the implicit_index intrinsic may be intended for.  It's tricky to get adequate performance from it, and apparently not possible in some of the more obvious contexts (unless the goal is only to get a positive vectorization report).

    It seems to be competitive for the usage of setting up an identity matrix.

    In the context of dividing its result by 2, different treatments are required on MIC and host:

    Converting Cilkview data to seconds

    Hey folks,

    I'm working with a system that needs the work and span of the programs I'm running in seconds and nanoseconds to run properly, and running Cilkview on them gives me work and span in processor instructions. Does anyone know of a way to convert that data from instructions to a unit of time?



    Downloaded Composer XE Linux Online Installer Bootstrap may not have Execute Permission

    Default permissions of online installer bootstrap scripts depend on default permissions based on the umask procedure and security setup of the downloading tool. If the downloaded online installer bootstrap scripts do not have execution permission, users should do chmod +x "installer bootstrap scripts"

  • Entwickler
  • Linux*
  • C/C++
  • Fortran
  • Intel® C++ Composer XE
  • Intel® Fortran Composer XE
  • Less performance on 16 core than on 4 ?!

    Hi there,

    I evaluated my cilk application using "taskset -c 0-(x-1) MYPROGRAM) to analyze scaling behavior.


    I was very suprised to see, that the performances increases up to a number of cores but decreases afterwards.

    for 2 Cores, I gain a speedup of 1,85. for 4, I gain 3.15. for 8 4.34 - but with 12 cores the performance drops down
    to a speedup close to the speedup gained by 2 cores (1.99).
    16 cores performe slightly better (2.11)

    Exception when run project at debug mode using cilk_for

    Dear all,

    I have used cilk_plus to make parallel processing into my source code with visual studio 2008 IDE.

    But when I build it at debug mode, the project throw an exception below:

    "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function pointer declared with a different calling convention"

    How can  I resolve it to make debug mode operated ?

    Thanks of all,

    Tam Nguyen


    Cilk Tools error while loading shared libraries

    I have successfully compiled cilkplus for gcc (4.8 branch) on Ubuntu 14.04 LTS and compiled the example program fib on the cilkplus website.  I would like to run cilkview and cilkscreen on it, and so I downloaded cilk tools from the website as well.  However, when I try to run cilkview, I get the following error:

    Cilkview: Generating scalability data
    -t: error while loading shared libraries: -t: cannot open shared object file: No such file or directory
    Intel® C++ Composer XE abonnieren