Skip to content

Commit

Permalink
[fix][index] Limit openblas threads num.
Browse files Browse the repository at this point in the history
Signed-off-by: Ketor <d.ketor@gmail.com>
  • Loading branch information
ketor authored and rock-git committed Apr 26, 2024
1 parent dd50393 commit d49794d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ DEFINE_int32(version_service_worker_num, 10, "service worker num");
DEFINE_int64(version_service_worker_max_pending_num, 0, "service worker num");

extern "C" {
extern void goto_set_num_threads(int num_threads); // NOLINT
extern void openblas_set_num_threads(int num_threads); // NOLINT
}

Expand Down Expand Up @@ -811,6 +812,7 @@ int main(int argc, char *argv[]) {

#ifdef USE_OPENBLAS
DINGO_LOG(INFO) << "USE_OPENBLAS is ON";
goto_set_num_threads(1);
openblas_set_num_threads(1);
#endif

Expand Down

0 comments on commit d49794d

Please sign in to comment.