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: What are the additional overhead when using OpenMP multi-core?

Part Number: TMS320C6678

Hi all,

My customer have 2 questions while using OpenMP multi-core application.

1. When running the demo listed below, single-core cost 0.21s, quad-core cost 0.17s, eight-core cost 0.14s, why the time cost isn't multiple? What are the additional overhead when using OpenMP multi-core?

2. When running customer's own algorithm, single-core cost 0.8s, quad-core cost 0.9s, eight-core cost 0.3s, why the time cost of quad-core is higher than single-core? And how to optimize it?

#include <ti/omp/omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <c6x.h>
void test()
{
int a = 0;
for (int j = 0; j<100000; j++)
a++;
}
void main()
{
int i;
printf("starting running\n");
unsigned long long t1,t2;
TSCL = 0;
TSCH = 0;
t1 = _itoll(TSCH,TSCL);

#pragma omp parallel for private(i)
for ( i = 0; i<100; i++){
test();
}
t2 = _itoll(TSCH,TSCL);
printf("time is: %ld\n",(t2-t1)/10000);
}

Thanks,

Wesley.

  • Hi Wesley,

    Our team will need some time to gather data in the lab. Please allow us a few days and we will get back to you.

    BR
    Tsvetolin Shulev
  • Hi Wesley,

    The execution time of a OpenMP program depends on the "parallel" to "serial" percentage as well as the overhead from the inter processor communication for running multi-thread. Accordingly, users need to balance the parallelism percentage and the overhead from multi-threads to achieve optimal performance.

    TI OpenMP Runtime 2.2 implements support for the OpenMP 3.0 API specification, hence the resources in openmp.org should be helpful to customer's proprietary algorithm - www.openmp.org/.../ .

    Regards,
    Garrett