floating-point

Управление режимами вычислений с плавающей запятой при использовании Intel® Threading Building Blocks

В Intel® Threading Building Blocks (Intel® TBB) 4.2, обновление 4, появилась расширенная поддержка управления параметрами вычислений с плавающей запятой. Теперь эти параметры можно указать при вызове большинства параллельных алгоритмов (включая flow::graph). В этом блоге мне бы хотелось рассказать о некоторых особенностях, новых функциях и общей поддержке вычислений с плавающей запятой в Intel TBB. Этот блог не посвящен общей поддержке вычислений с плавающей запятой в ЦП.

  • Entwickler
  • Intel AppUp® Developer
  • Partner
  • Professoren
  • Studenten
  • Android*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8.x
  • Unix*
  • Android*
  • Server
  • Windows*
  • C/C++
  • Experten
  • Anfänger
  • Fortgeschrittene
  • Intel® Threading Building Blocks
  • tbb
  • floating-point
  • fp
  • FPU
  • floating-point settings
  • FP settings
  • FPU settings
  • FPU controls
  • CPU settings
  • CPU controls
  • Entwicklungstools
  • Bildungswesen
  • Open Source
  • Parallel Computing
  • Threading
  • Controlling floating-point modes when using Intel® Threading Building Blocks

    Intel® Threading Building Blocks (Intel® TBB) 4.2 Update 4 introduced enhanced support for managing floating-pointing settings. Floating-point settings can now be specified at the invocation of most parallel algorithms (including flow::graph). In this blog I want to pay attention to some peculiarities and details of the new feature and overall floating-point settings support in Intel TBB. This blog is not devoted to general floating-point support in the CPU.

  • Entwickler
  • Intel AppUp® Developer
  • Partner
  • Professoren
  • Studenten
  • Android*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8.x
  • Unix*
  • Android*
  • Server
  • Windows*
  • C/C++
  • Experten
  • Anfänger
  • Fortgeschrittene
  • Intel® Threading Building Blocks
  • tbb
  • floating-point
  • fp
  • FPU
  • floating-point settings
  • FP settings
  • FPU settings
  • FPU controls
  • CPU settings
  • CPU controls
  • Entwicklungstools
  • Bildungswesen
  • Open Source
  • Parallel Computing
  • Threading
  • 面向英特尔® 至强融核™ 协处理器(和英特尔® 至强® 处理器)架构应用的浮点计算 R2R 再现性

     

    问题

    如果在相同处理器上针对相同输入数据重新运行相同的程序,得到的结果相同吗?

    串行代码

    串行代码浮点运算结果的差异的唯一已知来源是由外部环境更改引发的数据调整。 例如,用户动态分配了一个包含日期的新字符串。 该字符串的大小随一年中的月份或周的日期而不同,因此需要对分配的日期进行后续调整。 调整范围决定着哪些循环迭代是循环开头或循环结尾(remainder loop)的组成部分,以及哪些是矢量化内核的组成部分。 这反过来影响浮点约分运算的顺序;按照指定精度对不同直接结果执行舍入处理可缩小最终结果的差异范围。 开头、结尾和内核之间的优化不同可得出相似的差异范围。 这些差异范围可通过以下两个方式预防:

    1)      通过调整在运行时间分配的任何数据。 对于 C/C++ 编程,可使用经过调整的 malloc/calloc/free 版本等等,例如 _mm_malloc() 和 _mm_free() 或 Posix 类型。 对于 Fortran 编程,!DIR$ ATTRIBUTES ALIGN:64 :: 阵列指令,或命令行交换 -align array64byte (推荐)。 数据调整为 64 位边界也具有性能优势。

  • Entwickler
  • Apple OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8.x
  • C/C++
  • Fortran
  • Intel® C++-Compiler
  • Intel® C++ Composer XE
  • Intel® Composer XE
  • Intel® Fortran Compiler
  • Intel® Fortran Composer XE
  • Intel® Parallel Composer
  • Intel® Visual Fortran Composer XE
  • floating-point
  • reproducibility
  • Intel® Many Integrated Core Architektur
  • Consistency of Floating-Point Results using the Intel® Compiler

    Why doesn’t my application always give the same answer? Tradeoffs between floating-point accuracy, reproducibility and performance are discussed with examples;recommendations are made for improving reproducibility while limiting the impact on performance. Updated for Intel Composer XE 2015.
  • Entwickler
  • Apple OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8.x
  • C/C++
  • Fortran
  • Intel® C++-Compiler
  • Intel® Fortran Compiler
  • Intel® Parallel Composer
  • floating-point
  • reproducibility
  • consistency
  • Floating-point Settings in Worker Threads May Differ from Master Thread for OpenMP, TBB and Intel Cilk Plus

    Worker threads created by OpenMP, Intel Cilk Plus or Intel Threading Building Blocks may have different initial floating-point environments compared to the master thread that spawned them. This can lead to slight differences in floating-point results.
  • Linux*
  • Apple OS X*
  • Microsoft Windows* (XP, Vista, 7)
  • C/C++
  • Fortran
  • Intel® C++-Compiler
  • Intel® Fortran Compiler
  • Intel® Parallel Composer
  • thread
  • floating-point
  • ClosedSWDefect
  • Multiple definitions of floating-point exception parameters such as FPE_M_TRAP_OVF

    Referencing parameters related to floating-point exceptions via the IFLPORT or IFCORE and IFPORT modules may give errors such as error #6405: The same named entity from different modules and/or program units cannot be referenced. [FPE_M_TRAP_DIV0]
  • Linux*
  • Apple OS X*
  • Microsoft Windows* (XP, Vista, 7)
  • Fortran
  • Intel® Fortran Compiler
  • floating-point
  • IFPORT
  • duplicate definition
  • ClosedSWDefect
  • floating-point abonnieren