不仅映射和减法支持并行化,映射和减法运算也可结合到单个并行循环中,这样效率更高。
Not only are mapping and reduction amenable to parallelization, but the map and reduce operations can be combined into a single parallel pass, which is even more efficient.
图3中图形化地显示了其效果:传统的程序将连续地执行循环,而OpenMP实现则创建多个线程,从而并行地执行for块。
The effect is shown graphically in Figure 3: a traditional program would execute the loop sequentially, whereas the OpenMP implementation creates threads to parallelize the for block.
在并行编译中,循环变换是开发程序并行度的主要方法,但存在复杂控制流的非紧密嵌套循环往往无法得到有效的并行化。
Loop transformation is the basic way to maximization parallelism, but it doesn't work in the case of non - perfect nested loop with complicated control flow.
应用推荐