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.

How to define extra memory for openmp example

Other Parts Discussed in Thread: SYSBIOS

Hi

I am trying to test my code using openmp  with 8 cores, 
example modified to 8 cores works well but I added my code
that needs some memory about 5Mbytes in global variables, and the compiler
shows next errors

<Linking>
"./configPkg/linker.cmd", line 249: error #10099-D: program will not fit into

   available memory.  run placement with alignment fails for section ".far"
>> Compilation failure
   size 0xfd64b4 .  Available memory ranges:
   MSMCSRAM_NOCACHE   size: 0x300000     unused: 0x27fee0     max hole:
   0x27fee0  
"./configPkg/linker.cmd", line 120: error #10099-D: program will not fit into
   available memory.  run placement with alignment fails for section
   ".localfar" size 0x40ae5c .  Available memory ranges:
   L2SRAM       size: 0x80000      unused: 0x7eedc      max hole: 0x7eedc   
error #10010: errors encountered during linking; "hello_openmp_evm6678.out" not
   built
gmake: *** [hello_openmp_evm6678.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****


Somebody could tell me how to modified the amount of memory to  get this example works
properly.


Thanks in advance.
Julian

  • Julian

    For large data buffers it's best to control where you place these global variables by adding something like the following code:

    CFG file

    Program.sectMap[".inputbuff"]  = "DDR3";

    C file

    #pragma DATA_SECTION(buffer, ".inputbuff");
    #pragma DATA_ALIGN(buffer, 128);
    char buffer[bufsize];

    main () {

    }

  • Uday,

    I have changed data definition with DATA_SECTION and it works

    well. I tested my functions and they work well, these functions process a couple of arrays in a for loop, until here

    everything is alright.

    But when I add the #pragma omp for directive  before for loop, this cause the running ends suddenly and the console shows:

    [C66xx_0] ti.sysbios.knl.Task: line 355: E_stackOverflow: Task 0x90000088 stack overflow.
    xdc.runtime.Error.raise: terminating execution

    I have opened ROV and this is what it shows.

    I search for omp utils and I found  that in omp_config_pe66.c is defined the stack

    /* stackSize__C */
    __FAR__ const CT__ti_omp_utils_OpenMP_stackSize ti_omp_utils_OpenMP_stackSize__C = (xdc_SizeT)0x8000;

    so the question is It is posible modify it?, because I can not write on that file or maybe Is there other place where I can modify

    this StackSize value?.

    Regards

    Julian

  • Hi,

    I have added the follow line  to cfg file

    OpenMP.stackSize = 0x9000;

    and it modifies the line

    /* stackSize__C */
    __FAR__ const CT__ti_omp_utils_OpenMP_stackSize ti_omp_utils_OpenMP_stackSize__C = (xdc_SizeT)0x8000;


    to

    /* stackSize__C */
    __FAR__ const CT__ti_omp_utils_OpenMP_stackSize ti_omp_utils_OpenMP_stackSize__C = (xdc_SizeT)0x9000;


    and it seems to solve the problem.


    Regards

    Julian