How does the OpenMP runtime determine the best number of threads when omp_set_dynamic is used?
e.g. Are some sort of timing mechanisms used or does the compiler give hints to the runtime of how large the task size is?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think that the OpenMP does determine the ‘best’ number of threads for an application, in any likely sense of the word ‘best’. As @aaa has commented, the runtime’s behaviour when
omp_set_dynamicis true is implementation specific.I don’t think that current Fortran/C/C++ compilers could provide information such as timings or task sizes to the runtime.
I believe that this function is available so that schedulers (and similar) can manage programs on machines, for throughput or similar.