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 and pthread

Other Parts Discussed in Thread: SYSBIOS

Hi,


I am currently evaluating whether we will/can/want to use OpenMP in a new project on a multicore DSP. As I understood so far, if we use OpenMP, the DSP is running the OpenMP Runtime and not Sysbios - or is the Runtime on top of Sysbios? However, when using a parallel region, the runtime will use one thread per core to share the work, thus I do not have to worry about running and syncing several instances of Sysbios. I further understand that OpenMP usually creates pthread-code internally - is that true for the TI implementation?

My main question is as follows: We want to use some rather large libraries which were designed to be multithreaded, but not with/for OpenMP. So can I still create pthreads when using OpenMP? And if I can, will the runtime spread those pthreads across the cores?

  • Okay, I maybe posted a bit early... I found out by now that OpenMP can run on top of sybios (RTSC mode), and I can even configure the number of cores OpenMP will manage. And as there is only one thread per core and nested parallel regions won't actually be parallel, the library I mentioned will probably not work in parallel as automatically as I had hoped (unless we port it to use OpenMP). I still wonder however whether the pthreads are supported in an openmp-scenario at all, even if they will never leave the core which created them?

  • Hi,

    I have pinged the OpenMP expert to answer this post. Thank you for your patience.
  • Hi Ruediger,

    That's correct, OpenMP on DSP runs on top of SYS/BIOS, and yes you need to port your library to use OpenMP in order to auto distribute to multi-core for parallel processing. In the openmp-scenario, actually SYS/BIOS scenario, multi-thread is supported in SYS/BIOS, see the SYS/BIOS user guide section 3.2 Overview of Threading Modules,  www.ti.com.cn/.../spruex3p.pdf. Also, SYS/BIOS (v6.42.01 and higher) provides a subset of pthread APIs. These include pthread threads, mutexes, read-write locks, barriers, and condition variables, see details here: processors.wiki.ti.com/.../BIOS_POSIX_Thread_(pthread)_Support.

    Regards,
    Garrett