...
 
Commits (1)
...@@ -384,9 +384,8 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -384,9 +384,8 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
endif() endif()
else() else()
message(FATAL_ERROR "BLASMT is enabled but no parallel LAPACK was found." message(FATAL_ERROR "BLASMT is enabled but no parallel LAPACK was found."
"Please provide a parallel lapack library in your environment." "Please provide a parallel lapack library in your environment."
"For now only Intel MKL BLAS/LAPACK provider is fully supported." )
)
endif() endif()
else() else()
list(APPEND MAPHYS_EXTRA_LIBRARIES ${LAPACK_LIBRARIES}) list(APPEND MAPHYS_EXTRA_LIBRARIES ${LAPACK_LIBRARIES})
...@@ -418,6 +417,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -418,6 +417,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
endif() endif()
if (MAPHYS_BLASMT) if (MAPHYS_BLASMT)
if (BLAS_LIBRARIES) if (BLAS_LIBRARIES)
if("${LAPACK_LIBRARIES}" MATCHES "openblas")
add_definitions(-DUSE_OPENBLAS_)
endif()
add_definitions(-DMULTITHREAD_VERSION) add_definitions(-DMULTITHREAD_VERSION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
if (BLAS_PAR_LIBRARIES) if (BLAS_PAR_LIBRARIES)
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
! error messages ! error messages
#ifdef MAPHYS_BACKTRACE_ERROR #ifdef MAPHYS_BACKTRACE_ERROR
! CHCKASSRT and ASSRT macros requires : ! CHCKASSRT and ASSRT macros requires :
! - the usage of "maphys_error_mod" ! - the usage of "maphys_error_mod"
! - the definition of the string FLNAME. ! - the definition of the string FLNAME.
! !
! Warning on their usage, since F90 line are truncated to 132 characters. ! Warning on their usage, since F90 line are truncated to 132 characters.
! - "x" + "res" must take ? characters ! - "x" + "res" must take ? characters
! - MPH_ONFAILURE_* "x" must take less than 20 characters ! - MPH_ONFAILURE_* "x" must take less than 20 characters
! (with 20 spaces at the begining of the line) ! (with 20 spaces at the begining of the line)
! !
#define CHCKASSRT( x, res ) Call mph_check( (x) , __LINE__, res, FLNAME ); #define CHCKASSRT( x, res ) Call mph_check( (x) , __LINE__, res, FLNAME );
...@@ -24,22 +24,32 @@ ...@@ -24,22 +24,32 @@
#define MPH_ONFAILURE_RETURN(x) If(x<0) Return; #define MPH_ONFAILURE_RETURN(x) If(x<0) Return;
#endif #endif
! mkl -- num threads controls ! Multithreading config
#if MULTITHREAD_VERSION #if MULTITHREAD_VERSION
#define BLAS_SET_NUM_THREADS( x ) Call omp_set_num_threads( (x) ); \ #ifdef USE_OPENBLAS_
Call mkl_set_num_threads( (x) );\ ! Openblas multithread
Call omp_set_dynamic( 0 );\ #define BLAS_SET_NUM_THREADS( x ) Call openblas_set_num_threads( (x) )
Call mkl_set_dynamic( 0 ); ! 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_dynamic( 0 );
#endif
#else #else
#define BLAS_SET_NUM_THREADS( x ) ! No multithreading
#define BLAS_SET_NUM_THREADS( x )
#endif #endif
! !
! specifics checks / assertions ! specifics checks / assertions
! !
! a routine info ! a routine info
#define CHCKRINFO( x ) CHCKASSRT( x >= 0, x ) #define CHCKRINFO( x ) CHCKASSRT( x >= 0, x )
! an allocation ! an allocation
#define CHCKALLOC( x ) CHCKASSRT( x == 0, x ) #define CHCKALLOC( x ) CHCKASSRT( x == 0, x )
...@@ -47,4 +57,3 @@ ...@@ -47,4 +57,3 @@
#define CHCKIO( x ) CHCKASSRT( x == 0, x ) #define CHCKIO( x ) CHCKASSRT( x == 0, x )
! an MPI communication ! an MPI communication
#define ASSRTMPI( x ) ASSRT( x == MPI_SUCCESS ) #define ASSRTMPI( x ) ASSRT( x == MPI_SUCCESS )