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 select core 1 as the primary core with OpenMP

I've got the template Code Composer OpenMP projects working (OMP hello world, and OMP matrix) using core 0 as the primary core. However, for my purposes I would like to use just 3 cores (1,2,3) with core 1 as the primary core. I can see that OpenMP.setNumProcessors(); controls the number of cores. I also see that the .cfg file creates a shared memory section using this command:

SharedRegion.setEntryMeta( HeapOMP.sharedRegionId,
                            {   base: 0x90000000,
                                len:  HeapOMP.sharedHeapSize,
                                ownerProcId: 0,
                                cacheEnable: true,
                                createHeap: true,
                                isValid: true,
                                name: "heapomp",
                            }

);

I tried changing ownerProcId to 1, but this doesn't seem to have the desired effect. Specifically, when I load cores 1, 2 and 3, core 3 exits immediately. Cores 1 and 2 stall, presumably waiting for core 0.

  • With the current version of the OpenMP runtime, you can only configure the number of cores participating in the runtime, always starting at core 0 as the master core. The following statements will configure the runtime to use DSP cores 0, 1, 2 and :

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

    The next release of the OpenMP runtime will support configuring the number of cores and the index of the master core. We do not have a release date for it at the moment.

    Ajay