Browse Source

Fix OMP num specify issue

In current code, no matter what number of threads specified, all
available CPU count is used when invoking OMP, which leads to very bad
performance if the workload is small while all available CPUs are big.
Lots of time are wasted on inter-thread sync. Fix this issue by really
using the number specified by the variable 'num' from calling API.

Signed-off-by: Chen, Guobing <guobing.chen@intel.com>
tags/v0.3.11^2
Chen, Guobing 5 years ago
parent
commit
0c1c903f1e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      driver/others/blas_server_omp.c

+ 1
- 1
driver/others/blas_server_omp.c View File

@@ -335,7 +335,7 @@ int exec_blas(BLASLONG num, blas_queue_t *queue){
break;
}

#pragma omp parallel for schedule(OMP_SCHED)
#pragma omp parallel for num_threads(num) schedule(OMP_SCHED)
for (i = 0; i < num; i ++) {

#ifndef USE_SIMPLE_THREADED_LEVEL3


Loading…
Cancel
Save