Skip to content

Commit

Permalink
Fix: disable setting omp thread automatically (#1496)
Browse files Browse the repository at this point in the history
In some cases, setting openmp thread number after program started has
no effect in third-party libs(e.g. BLAS).
Users should set thread number by themselves.
  • Loading branch information
caic99 committed Nov 15, 2022
1 parent de0a130 commit 85285bb
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions source/src_parallel/parallel_global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,6 @@ void Parallel_Global::read_mpi_parameters(int argc,char **argv)
MPI_Comm_size(shmcomm, &process_num);
MPI_Comm_rank(shmcomm, &local_rank);
MPI_Comm_free(&shmcomm);
int desired_thread_num = max_thread_num / process_num;
if (desired_thread_num != current_thread_num && current_thread_num == max_thread_num)
{
// OpenMP thread num not set
omp_set_num_threads(desired_thread_num);
current_thread_num = omp_get_max_threads();
}
if (current_thread_num * process_num != max_thread_num && local_rank==0)
{
// only output info in local rank 0
Expand Down

0 comments on commit 85285bb

Please sign in to comment.