...
 
Commits (1)
......@@ -385,7 +385,6 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
else()
message(FATAL_ERROR "BLASMT is enabled but no parallel LAPACK was found."
"Please provide a parallel lapack library in your environment."
"For now only Intel MKL BLAS/LAPACK provider is fully supported."
)
endif()
else()
......@@ -418,6 +417,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
endif()
if (MAPHYS_BLASMT)
if (BLAS_LIBRARIES)
if("${LAPACK_LIBRARIES}" MATCHES "openblas")
add_definitions(-DUSE_OPENBLAS_)
endif()
add_definitions(-DMULTITHREAD_VERSION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
if (BLAS_PAR_LIBRARIES)
......
......@@ -24,15 +24,25 @@
#define MPH_ONFAILURE_RETURN(x) If(x<0) Return;
#endif
! mkl -- num threads controls
! Multithreading config
#if MULTITHREAD_VERSION
#ifdef USE_OPENBLAS_
! Openblas multithread
#define BLAS_SET_NUM_THREADS( x ) Call openblas_set_num_threads( (x) )
! Call omp_set_num_threads( (x) ); \
! Call omp_set_dynamic( 0 );
#else
! mkl multithreads
#define BLAS_SET_NUM_THREADS( x ) Call omp_set_num_threads( (x) ); \
Call mkl_set_num_threads( (x) );\
Call omp_set_dynamic( 0 );\
Call mkl_set_num_threads( (x) ); \
Call omp_set_dynamic( 0 ); \
Call mkl_set_dynamic( 0 );
#endif
#else
! No multithreading
#define BLAS_SET_NUM_THREADS( x )
#endif
......@@ -47,4 +57,3 @@
#define CHCKIO( x ) CHCKASSRT( x == 0, x )
! an MPI communication
#define ASSRTMPI( x ) ASSRT( x == MPI_SUCCESS )