diff --git a/tbox/src/CMakeLists.txt b/tbox/src/CMakeLists.txt index c2ccf55085a1e5a9e4382099f7145a9ad2441206..9947874da344934afabcce422f054ec571be3bfc 100644 --- a/tbox/src/CMakeLists.txt +++ b/tbox/src/CMakeLists.txt @@ -30,7 +30,7 @@ IF(TBB_VERSION_INTERFACE LESS 11004) ENDIF() TARGET_LINK_LIBRARIES(tbox ${TBB_LIBRARIES}) -# -- MKL/BLAS/LAPACK -- +# -- MKL -- # Do not forget to set your environement variables using: (default path) # - "C:\Program Files (x86)\Intel\Composer XE\mkl\bin\intel64\mklvars_intel64.bat" (windows, check that VS is in x64 mode) # - source /opt/intel/mkl/bin/mklvars.sh intel64 (linux) @@ -45,40 +45,17 @@ IF(USE_MKL) MESSAGE(STATUS "MKL_LIBRARIES=${MKL_LIBRARIES}") IF(MKL_INCLUDE_DIRS AND MKL_LIBRARIES) MESSAGE(STATUS "Found Intel MKL") - SET(FOUND_MKL TRUE) - SET(LAPACK_INCLUDE_DIRS ${MKL_INCLUDE_DIRS}) - SET(LAPACK_LIBRARIES ${MKL_LIBRARIES}) + TARGET_INCLUDE_DIRECTORIES(tbox PUBLIC ${MKL_INCLUDE_DIRS}) + TARGET_LINK_LIBRARIES(tbox ${MKL_LIBRARIES}) ELSE() MESSAGE(FATAL_ERROR "Intel MKL not found!") ENDIF() -# Find BLAS -ELSE() - IF(${BLA_VENDOR} MATCHES "OpenBlas") - FIND_LIBRARY(LAPACK_LIBRARIES openblas) - ELSE() - FIND_PACKAGE(LAPACK REQUIRED) #FIND_LAPACK calls FIND_BLAS - ENDIF() - IF(NOT LAPACK_LIBRARIES) - MESSAGE(FATAL_ERROR "BLAS/LAPACK not found!") - ENDIF() - MESSAGE(STATUS "LAPACK_LIBRARIES=${LAPACK_LIBRARIES}") - MESSAGE(STATUS "LAPACK_LINKER_FLAGS=${LAPACK_LINKER_FLAGS}") - MESSAGE(STATUS "BLA_VENDOR=${BLA_VENDOR}") - MESSAGE(STATUS "BLA_STATIC=${BLA_STATIC}") ENDIF() # -- Eigen -- FIND_PACKAGE(EIGEN 3.3.4 REQUIRED) -TARGET_INCLUDE_DIRECTORIES(tbox PUBLIC ${EIGEN_INCLUDE_DIRS} ${LAPACK_INCLUDE_DIRS}) +TARGET_INCLUDE_DIRECTORIES(tbox PUBLIC ${EIGEN_INCLUDE_DIRS}) TARGET_COMPILE_DEFINITIONS(tbox PUBLIC EIGEN_DONT_PARALLELIZE) -IF(FOUND_MKL) - MESSAGE(STATUS "Linking Eigen with MKL") - TARGET_COMPILE_DEFINITIONS(tbox PUBLIC EIGEN_USE_MKL_ALL) -ELSE() - MESSAGE(STATUS "Linking Eigen with BLAS ${BLA_VENDOR}") - TARGET_COMPILE_DEFINITIONS(tbox PUBLIC EIGEN_USE_BLAS) -ENDIF() -TARGET_LINK_LIBRARIES(tbox ${LAPACK_LIBRARIES}) # -- MUMPS -- IF (USE_MUMPS) diff --git a/tbox/src/wDss.cpp b/tbox/src/wDss.cpp index c412f3c6fbff521101e108e0034eef17b7a0b2ce..d29dceb634fde03baabc1912417de9218db5f132 100644 --- a/tbox/src/wDss.cpp +++ b/tbox/src/wDss.cpp @@ -46,11 +46,11 @@ void Dss::analyze(Eigen::SparseMatrix<double> const &A) AA.makeCompressed(); // Build data structure - MKL_INT opt = MKL_DSS_NON_SYMMETRIC; // consider MKL_DSS_SYMMETRIC and MKL_DSS_SYMMETRIC_STRUCTURE - MKL_INT n = AA.rows(); // matrix size (number of rows and columns) - MKL_INT nz = AA.nonZeros(); // number of non-zero entries - const MKL_INT *rStart = AA.outerIndexPtr(); // starting index of non-zero entry for a row - const MKL_INT *cIndex = AA.innerIndexPtr(); // index of column of non-zero entry + MKL_INT opt = MKL_DSS_NON_SYMMETRIC; // consider MKL_DSS_SYMMETRIC and MKL_DSS_SYMMETRIC_STRUCTURE + MKL_INT n = static_cast<int>(AA.rows()); // matrix size (number of rows and columns) + MKL_INT nz = static_cast<int>(AA.nonZeros()); // number of non-zero entries + const MKL_INT *rStart = AA.outerIndexPtr(); // starting index of non-zero entry for a row + const MKL_INT *cIndex = AA.innerIndexPtr(); // index of column of non-zero entry print(dss_define_structure(handle, opt, rStart, n, n, cIndex, nz)); // Define reordering diff --git a/tbox/src/wGmres.h b/tbox/src/wGmres.h index b0a4a44ca14328533837ca4d3ace03afc91b33fe..105706918f1ea9062d25840566518ae3171f0eaf 100644 --- a/tbox/src/wGmres.h +++ b/tbox/src/wGmres.h @@ -43,7 +43,7 @@ public: virtual void compute(Eigen::SparseMatrix<double> const &A, Eigen::Map<Eigen::VectorXd> const &b, Eigen::Map<Eigen::VectorXd> &x) override; virtual double getError() override { return solver.error(); } - virtual int getIterations() override { return solver.iterations(); } + virtual int getIterations() override { return static_cast<int>(solver.iterations()); } virtual void write(std::ostream &out) const override; #endif diff --git a/tbox/src/wMshDeform.cpp b/tbox/src/wMshDeform.cpp index e3f4e39fb0ddf366faea9cc59a47a0bfefea15cf..1c2009ca9bb360142bb2b86a43e3f79949c08795 100644 --- a/tbox/src/wMshDeform.cpp +++ b/tbox/src/wMshDeform.cpp @@ -49,6 +49,7 @@ MshDeform::MshDeform(std::shared_ptr<MshData> _msh, // Display configuration std::cout << "--- Mesh morpher (linear elasticity) ---\n" + << "Inner solver: " << *linsol << "Number of threads: " << nthreads << "\n" << std::endl; }