Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • Thomas GloeOctober 12, 2009 5:00 AM PDT   
    ippSetNumThreads

    Dear Forum Members,

    one way recommended to control the number of threads in an application using Intel IPP is to use ippSetNumThreads. Actually I did this at the beginning of my main function and set the number of threads to 1. However, when the application is running on our hpc-cluster with Quadcore or Octocore Nodes, the application creates 4 Threads instead of one. Due to the fact, that my code itself creates no threads at all, I was wondering why the Intel Ipp Library is creating more than one thread. (The cluster is running under SLES 10.1 in combination with Intel Ipp 6.0). Has anyone else observed this behaviour. Are there any restrictions or requirements where ippSetNumThreads has to be called or is it not sufficient to call ippSetNumThreads once?

    Thomas


    Vladimir Dudnik (Intel)October 12, 2009 6:23 AM PDT
    Rate
     
    Re: ippSetNumThreads

    Hi Thomas,

    Intel IPP is threaded using OpenMP API. The OpenMP run time will create number of threads equal to number of cores on your system. How much threads will do real work for IPP depends on value you set with ippSetNumThreads function. In your case these additional threads are always in sleep state and do not require any cpu cycles.

    Regards,
      Vladimir

    Thomas GloeOctober 12, 2009 7:42 AM PDT
    Rate
     
    Re: ippSetNumThreads

    Hi Thomas,

    Intel IPP is threaded using OpenMP API. The OpenMP run time will create number of threads equal to number of cores on your system. How much threads will do real work for IPP depends on value you set with ippSetNumThreads function. In your case these additional threads are always in sleep state and do not require any cpu cycles.

    Regards,
    Vladimir

    Hi Vladimir,

    thanks for your interesting answer, but I think I do not really understand the behaviour of IPP in this case. According to your argumentation, a call of ippGetNumThreads previously to ippSetNumThreads should be equal to the number of threads after calling ippSetNumThreads. However in my case, the number of threads returned by ippGetNumThreads is larger (NThreads=8) than the observed number of threads after setting ippSetNumThreads (NThreads=4). Does this mean, that some of the Threads are switched in sleep state and others are destroyed?

    Thanks,
    Thomas


    Vladimir Dudnik (Intel)October 12, 2009 8:07 AM PDT
    Rate
     
    Re: ippSetNumThreads


    GetNumThreads should return default number which is equal to number of cores on your system if you did not call SetNumThreads before. But after you set some particular number of threads with SetNumThreads call, then GetNumThreads should return this number.

    Regards,
      Vladimir



    Thomas GloeOctober 12, 2009 8:50 AM PDT
    Rate
     
    Re: ippSetNumThreads


    GetNumThreads should return default number which is equal to number of cores on your system if you did not call SetNumThreads before. But after you set some particular number of threads with SetNumThreads call, then GetNumThreads should return this number.

    Regards,
    Vladimir

    I absolutely agree, but my question was pointing on another issue. According to your comment, Open MP in the Intel IPP starts a number of threads according to the number of cores in the system? These threads are switched to sleep state, if ippSetNumThreads was called with a number less than the available number of cores. Furthermore, the IPP manual says that the initial number of threads returned by ippGetNumThreads (previously to any call of ippSetNumThreads) is equal to the number of cores in a system.

    So my question is, why is the number of threads returned by ippGetNumThreads (directly after starting the program and without calling ippSetNumThreads) different to the number of observable threads when the program is running? In my case the number of 'possible' threads returned by ippGetNumThreads (without calling ippSetNumThreads before) is 8 and the number of observable threads running in the system after calling ippSetNumThreads( 1 ) is 4. I'm not sure, but considering your post, I think, there should be 8 threads again (7 threads in the sleep state and one thread working)?

    Maybe this is due to some internals of the library and there are always 4 threads independent of the number of available cores in the system, or some of the threads are destroyed?

    ippGetNumThreads in the manual: This function returns the number of OMP threads specified by the user previously. If it has not been specified, the function returns the initial number of threads that depends on the number of logical processors.

    Best regards,

    Thomas



    Vladimir Dudnik (Intel)October 12, 2009 9:02 AM PDT
    Rate
     
    Re: ippSetNumThreads

    Thomas,

    I think it is specific for OpenMP run time how many threads it will create by default. But you may be sure that with ippSetNumThreads(N) you direct IPP (and underlaying OpenMP run time) to only use N threads.

    Regards,
      Vladimir


Forum jump:  

Intel Software Network Forums Statistics

17,025 users have contributed to 48,319 threads and 172,758 posts to date.

In the past 24 hours, we have 11 new thread(s) 54 new posts(s), and 47 new user(s).

In the past 3 days, the most popular thread for everyone has been Optimalization of sine function\'s taylor expansion The most posts were made to Most likely, the issue is that The post with the most views is Optimalization of sine function\'s taylor expansion

Please welcome our newest member redfruit83


For more complete information about compiler optimizations, see our Optimization Notice.