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.

openMP Project Configuration



Hi Guys ,

I learn to programm c6678 using openM. My problem concern a the configuration (cfg) for my applicattion. I want to parallelize a sorter processing of data.

I have a total amount of data = 256 * 2080 ( float) . the sorter processing must be work on data parallel on the 8 core .

This is my approach to do that :

Configuration File :

  • put the total amount of data  in a shared Memory
  • each core receive read a 32 * 2080 data from Shared memory und store that to his private memory

that is my Configuration File :

/* load the common configuration file */
xdc.loadCapsule('ti/omp/common.cfg.xs');

var System = xdc.useModule('xdc.runtime.System');
System.extendedFormats = "%$S";

var OpenMP = xdc.useModule('ti.omp.utils.OpenMP');
OpenMP.setNumProcessors(8); 

Program.sectMap["ddr"] = new Program.SectionSpec();
Program.sectMap["ddr"].loadSegment = "DDR3";

Program.sectMap[".threadprivate"] = new Program.SectionSpec();
Program.sectMap[".threadprivate"].loadSegment = "L2SRAM";                                     // to store 32*2080 for each Core

Program.sectMap["Buffer"] = new Program.SectionSpec();
Program.sectMap["Buffer"].loadSegment = "DDR3";                                                      // to store 256 * 2080 data

Questions : It is Configuration make sense for my Problem?

    I don´t no if it is necesserayl to configure the Plattform using CCS Tools-> RTSC Tools->Plattform ?

 in C. File :

#pragma DATA_SECTION (pInputData , "Buffer")
float *pInputData;

#pragma DATA_SECTION (pOutputData , "Buffer")
float *pOutputData;

#pragma DATA_SECTION (localBuffer, "threadprivate")

float localBuffer[32*256];

void main()

{

// init Buffer

#pragma OMP Parallel

}

can Somebody help me to resolve this ?

Best Regards

Lopez

  • Hi Guys , I want to give more Information about the Implementation of my C. File :

    void main()

    {

    // init the Input buffer

    pInputData  = (float*) malloc * sizeof(float) * (2080 * 256);

    // parallel distribution for data Block to each Core

    #pragma omp parallel private (tid , localBuffer) shared (pInputData)

    {

    int i = tid * 32 * 2080 ;                          // start position to read data on pInputData for each core

    memcpy(localBuffer , &pInputData[i], sizeof(float) * 2080 * 32);

    // wait each core receive his data Block

    #pragma omp barrier

    }

    }

    Questions : After the pragma omp barrier , I need to start now the parallel sorter process using the private (tid and localBuffer) for each core , It is possible to realize that inside the first parrel region ( after the #pragma omp barrier ?)

    Thank you

    Lopez