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.

C66X,OpenMP

Other Parts Discussed in Thread: TMS320C6678

Hello:

         I'm using OpenMP module on my TMS320C6678 EVM and the OMP edition is 1.1.2.6. Q1: In .cfg file, is parameter  "threadPriority" represent the  priority of masterFxn (typically main() function)  and just like the other SYS/BIOS threads' priority that can be high priority threads preempted?

        Q2:  When using OpenMP module, we always create a HeapOMP as SYS/BIOS's default heap. There is a local heap and a shared heap in HeapOMP. I wonder if values malloced out of OMP instructions are located in shared heap and values malloced in the OMP instructs are located in local heap? Just as value "a","b" ,"c"in the routine below.

         float *a=(float*)malloc(sizeof(float));

        int b=0;

         #pragma omp parallel firstprivate(b)

{

         int c=0;

         b=1;

}

So,"a" is located in shared heap,"c" is located in local heap, "b" is located in Data Memory (typically in shared memory region), but when running the parallel routine, each core will generate a copy of "b" in stack. Am I right?

       Q3: As we know there is a ".threadprivate" section used by threadprivate instruction, but are there any other secions used by other specific instrutions?

       To sum up, could any one provide a detailed, comprehensive memory alloction when using OpenMP?

Thank You!

 

  • And, does omp directives can only be called in masterFxn thread? Why can not other SYS/BIOS threads ?

  • > And, does omp directives can only be called in masterFxn thread?
    > Why can not other SYS/BIOS threads ?

    OpenMP constructs are only supported from threads created by the OpenMP runtime.
    This is an implementation detail: As there is no underlaying OS which supports multiple cpu-cores, the OpenMP runtime has to manage those issues itself. However, it has no control over  threads which were created outside of the OpenMP context.

    > I wonder if values malloced out of OMP instructions are located
    > in shared heap and values malloced in the OMP instructs are located in local heap?

    The easiest way to find out is to malloc and to have a look at the address returned by malloc.
    As you know the address-ranges you've configured in your rtsc-config file, you can conclude where the memory came from.

    > So,"a" is located in shared heap,"c" is located in local heap, "b" is located in Data Memory
    c is located on the stack of the OpenMP thread, as is b initially (which is in DDR3 - or MSM).


    > but when running the parallel routine, each core will generate a copy of "b" in stack. Am I right?
    I have to admit I am not 100% sure where the copy is made, but yes each cores gets is own copy.


    >T
    o sum up, could any one provide a detailed, comprehensive memory alloction when using OpenMP?

    The OpenMP implementation is open-source and shipped by default with your OpenMP rtsc package, and the platform-specific layer actually consists of well readable code built on top of IPC MessageQs.
    I know this could be understood ironically, but it isn't. I actually avoided looking at the source for quite a while, just to find out it wasn hard at all to understand and gave me insights not found in any of TIs user guides ;)


    Regards, Clemens

  • Yes, thank you for your tips, Clemens. If we want to know it completely, we have to look through the bottom source files. I'll check it out.