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.

Question on Sample OpenMP configuration file post



Hi everyone,

This post is actually about another post by a member of TI, Sample OpenMP configuration file. I don't want to mess that page. My question is, by using that configuration file and the platform.xdc, does it mean that

   1. SharedRegion is in APP_HEAPOMP,

   2. HeapOMP.sharedRegionId is in DDR3_DATA, and

   3. OpenMP.stackRegionId is in DDR3_DATA as well?

In the configuration file, all three above is set to 2. From other pages, I understand that when set the OpenMP.stackRegionID to -1, this will map the region to L2SRAM, and 2 for DDR3. Since in the platform.xdc, the DDR3 now has 3 section; DDR3 for codeMemory, DDR3_DATA for dataMemory and APP_HEAPOMP for (I believe) for the SharedRegion, setting those values to 2 made me confuse. 

I'm a beginner in OpenMP in this embedded system (C6678L). Hope the answer later can improve my understanding. Thanks also to the TI member that wrote the page.

Many thanks,

Rizuan

  • Rizuan,

    APP_HEAPOMP, DDR3_DATA and DDR3 are names of regions in memory as defined in the sample Platform file. The sample configuration file uses DDR3 for code and DDR3_DATA for data.

    The SharedRegion definition in the configuration file creates a shared region in APP_HEAPOMP and assigns it an id of 2.

    • Setting HeapOMP.sharedRegionId to 2 specifies that all mallocs in the application are satisfied out of the heap created in SharedRegion #2
    • Setting OpenMP.stackRegionId to 2 specifies that OpenMP thread stacks are allocated out of the same heap in SharedRegion #2

    Typically, OpenMP.stackRegionId is set to a SharedRegion Id - the only exception is -1 which is used to indicate L2SRAM.

    Note: The OpenMP runtime internally creates SharedRegion 0 (in OpenMP.xs).

    Ajay

  • Hi Ajay,

    Thanks. Your explanation makes me understand better now.

    Let said if I assign the SharedRegion with Id = 2 and I set all the HeapOMP.sharedRegionId, OpenMP.stackRegionId to 2 in my project, and I have created several variables like input, A, B, and C using Memory_alloc, by utilizing a heap in my DDR3 but the initialization is at the beginning of my program i.e. outside the parallel region. Then in my code I have:

    #pragma omp parallel shared(input) private(A, B, C)

    {

    .......

    From your explanation in your previous post before, I understand that the memory section that have the heap above should be my SharedRegion. Am I right?

    This question is related to my problem and discussing about the same project that you have replied here.

    Many thanks, Ajay.

    Kind regards,

    Rizuan

  • Rizuan,

    A malloc() will allocate out of the heap in Shared Region 2. The behavior of Memory_alloc will depend on the first argument - if it's NULL, the allocation will occur out of heap in Shared Region 2.

    Ajay