This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320C6678:使用 OpenMP 多核时会产生哪些额外开销?

Guru**** 2602655 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/647091/tms320c6678-what-are-the-additional-overhead-when-using-openmp-multi-core

器件型号:TMS320C6678

大家好、

我的客户在使用 OpenMP 多核应用时有2个问题。

运行以下所列演示时、单核成本为0.21、四核 成本 为0.17、八核成本 为0.14、为什么时间成本不是多个?  使用 OpenMP 多内核时会产生哪些额外开销?

2. 在运行客户自己 的算法时,单核成本为0.8秒,四核 成本 为0.9秒,八核 成本 为0.3秒,为什么四核的时间成本高于单核? 以及如何对其进行优化?

#include 
#include 
#include 
#include 
void test()
{
int a = 0;
for (int j = 0;j<100000;j++)
a++;
}
void main ()
{
int i;
printf ("正在开始运行");
unsigned long t1、t2;
TSCL = 0;
TSCH = 0;
t1 =_itoll (TSCH、TSCL);unsigned long

i

(i)= 100 (parallel);i (i +)(i +);(parallel = 100)(i +);(parallel = i (i +);t i = 100)(i +);t i

t2 =_itoll (TSCH、TSCL);
printf ("时间为:%ld \n"、(t2-t1)/10000);
} 

谢谢、

Wesley。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Wesley、

    我们的团队需要一些时间来收集实验室中的数据。 请给我们几天时间、我们将会与您联系。

    BR
    Tsvetolin Shulev
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Wesley、

    OpenMP 程序的执行时间取决于"并行"到"串行"的百分比以及处理器间通信运行多线程的开销。 因此,用户需要平衡多线程的并行性百分比和开销,以实现最佳性能。

    TI OpenMP 运行时2.2实现了对 OpenMP 3.0 API 规范的支持,因此 openmp.org 中的资源应该对客户的专有算法有所帮助- www.openmp.org/.../

    此致、
    Garrett