--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2017 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# Configuration for the SCALAPACK library:
+#
+
+SET(FEATURE_SCALAPACK_DEPENDS MPI LAPACK)
+
+
+MACRO(FEATURE_SCALAPACK_FIND_EXTERNAL var)
+ FIND_PACKAGE(SCALAPACK)
+
+ IF(SCALAPACK_FOUND)
+ SET(${var} TRUE)
+ CHECK_MPI_INTERFACE(SCALAPACK ${var})
+ ENDIF()
+ENDMACRO()
+
+CONFIGURE_FEATURE(SCALAPACK)
--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2017 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# Try to find the SCALAPACK library
+#
+# This module exports
+#
+# SCALAPACK_LIBRARIES
+# SCALAPACK_LINKER_FLAGS
+#
+
+SET(SCALAPACK_DIR "" CACHE PATH "An optional hint to a SCALAPACK directory")
+SET(BLACS_DIR "" CACHE PATH "An optional hint to a BLACS directory")
+SET_IF_EMPTY(SCALAPACK_DIR "$ENV{SCALAPACK_DIR}")
+SET_IF_EMPTY(BLACS_DIR "$ENV{BLACS_DIR}")
+
+#
+# Search for scalapack:
+#
+
+DEAL_II_FIND_LIBRARY(SCALAPACK_LIBRARY NAMES scalapack scalapack-openmpi scalapack-pvm scalapack-mpi scalapack-mpich scalapack-mpich2 scalapack-lam
+ HINTS ${SCALAPACK_DIR}
+ PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+ )
+
+#
+# Well, depending on the version of scalapack and the distribution it might
+# be necessary to search for blacs, too.
+IF (SCALAPACK_LIBRARY)
+ MESSAGE(STATUS "Check if BLACS is embedded in ScaLAPACK library")
+
+ CLEAR_CMAKE_REQUIRED()
+ SET(CMAKE_REQUIRED_FLAGS ${MPI_CXX_COMPILE_FLAGS} ${MPI_CXX_LINK_FLAGS})
+ SET(CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH})
+ SET(CMAKE_REQUIRED_LIBRARIES ${MPI_LIBRARIES} ${SCALAPACK_LIBRARY} ${LAPACK_LIBRARIES})
+ CHECK_CXX_SOURCE_COMPILES(
+ "
+ #include <mpi.h>
+ extern \"C\"
+ {
+ int Csys2blacs_handle(MPI_Comm comm);
+ }
+ int main() {
+ const int res = Csys2blacs_handle(MPI_COMM_WORLD);
+ }
+ "
+ SCALAPACK_LIBRARY_HAS_BLACS
+ )
+ RESET_CMAKE_REQUIRED()
+
+ # If Blacs is not embedded, try to find it
+ IF (NOT SCALAPACK_LIBRARY_HAS_BLACS)
+ MESSAGE(STATUS "Try to find BLACS")
+ # FIXME: use instead:
+ # FIND_PACKAGE(BLACS ${SCALAPACK_FIND_QUIETLY})
+ # SET(SCALAPACK_LIBRARY ${SCALAPACK_LIBRARY} ${BLACS_LIBRARY})
+
+ # FIXME: this is potentially dangerous endeavour as we can easily pickup
+ # system-provided BLACS build with some MPI which is inconsistent with
+ # ScaLAPACK library found above.
+ FOREACH(_lib blacs blacsCinit blacsF77init)
+ STRING(TOUPPER "${_lib}" _lib_upper)
+ DEAL_II_FIND_LIBRARY(${_lib_upper}_LIBRARY
+ NAMES ${_lib} ${_lib}_MPI-LINUX-0 ${_lib}_MPI-DARWIN-0 ${_lib}-openmpi
+ HINTS ${BLACS_DIR} ${SCALAPACK_DIR} ${SCALAPACK_DIR}/../blacs/
+ PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib LIB
+ )
+ ENDFOREACH()
+ ENDIF()
+ENDIF()
+
+
+DEAL_II_PACKAGE_HANDLE(SCALAPACK
+ LIBRARIES
+ REQUIRED SCALAPACK_LIBRARY LAPACK_LIBRARIES
+ OPTIONAL BLACS_LIBRARY BLACSCINIT_LIBRARY BLACSF77INIT_LIBRARY MPI_Fortran_LIBRARIES
+ LINKER_FLAGS
+ OPTIONAL LAPACK_LINKER_FLAGS
+ CLEAR
+ SCALAPACK_LIBRARY
+ BLACS_LIBRARY BLACSCINIT_LIBRARY BLACSF77INIT_LIBRARY
+ )
DEAL_II_WITH_OPENCASCADE=1 \
DEAL_II_WITH_P4EST=1 \
DEAL_II_WITH_PETSC=1 \
+ DEAL_II_WITH_SCALAPACK=1 \
DEAL_II_WITH_SLEPC=1 \
DEAL_II_WITH_SUNDIALS=1 \
DEAL_II_WITH_THREADS=1 \
--- /dev/null
+New: add ScaLAPACKMatrix and ProcessGrid wrappers for high-performance dense linear
+algebra routines for parallel distributed memory machines.
+<br>
+(Denis Davydov, Benjamin Brands, 2017/11/20)
<dt><a name="CUDA"></a><a href="https://developer.nvidia.com/cuda-zone">CUDA</a></dt>
<dd>
<p>
- <a href="https://developer.nvidia.com/cuda-zone">CUDA</a> is a parallel
- computing platform and API model created by Nvidia. It allows software
- developers and software engineers to use CUDA-enabled GPU for general
+ <a href="https://developer.nvidia.com/cuda-zone">CUDA</a> is a parallel
+ computing platform and API model created by Nvidia. It allows software
+ developers and software engineers to use CUDA-enabled GPU for general
purpose processing.
Details about compatibility and configuration can be found <a href=external-libs/cuda.html
</dd>
+ <dt>
+ <a name="scalapack"></a>
+ <a href="http://www.netlib.org/scalapack/">scalapack</a>
+ </dt>
+ <dd>
+ <p>
+ <a href="http://www.netlib.org/scalapack/">scalapack</a>
+ is a library of high-performance linear algebra routines for parallel
+ distributed memory machines. ScaLAPACK solves dense and banded linear
+ systems, least squares problems, eigenvalue problems, and singular value
+ problems. In order to enable this feature, add
+ <code>-DSCALAPACK_DIR=/path/to/scalapack</code> to the argument list for
+ <code>cmake</code>.
+ </p>
+ </dd>
+
+
<dt><a name="slepc"></a><a href="http://www.grycap.upv.es/slepc/" target="_top">SLEPc</a></dt>
<dd>
<p>
DEAL_II_WITH_OPENCASCADE
DEAL_II_WITH_P4EST
DEAL_II_WITH_PETSC
+DEAL_II_WITH_SCALAPACK
DEAL_II_WITH_SLEPC
DEAL_II_WITH_SUNDIALS
DEAL_II_WITH_THREADS
MUPARSER_DIR,
P4EST_DIR (and SC_DIR),
PETSC_DIR and PETSC_ARCH (forming ${PETSC_DIR}/${PETSC_ARCH}),
+SCALAPACK_DIR (and optionally BLACS_DIR)
SLEPC_DIR (forming ${SLEPC_DIR}/${PETSC_ARCH}),
TBB_DIR,
TRILINOS_DIR,
DEAL_II_WITH_OPENCASCADE
DEAL_II_WITH_P4EST
DEAL_II_WITH_PETSC
+DEAL_II_WITH_SCALAPACK
DEAL_II_WITH_SLEPC
DEAL_II_WITH_SUNDIALS
DEAL_II_WITH_THREADS
#cmakedefine DEAL_II_WITH_OPENCASCADE
#cmakedefine DEAL_II_WITH_P4EST
#cmakedefine DEAL_II_WITH_PETSC
+#cmakedefine DEAL_II_WITH_SCALAPACK
#cmakedefine DEAL_II_WITH_SLEPC
#cmakedefine DEAL_II_WITH_SUNDIALS
#cmakedefine DEAL_II_WITH_THREADS
#include <deal.II/base/config.h>
-// FIXME: #ifdef DEAL_II_WITH_SCALAPACK (<--- Lapack+MPI+Scalapack)
+#ifdef DEAL_II_WITH_SCALAPACK
#include <deal.II/base/exceptions.h>
#include <deal.II/lac/full_matrix.h>
DEAL_II_NAMESPACE_CLOSE
+#endif // DEAL_II_WITH_SCALAPACK
+
#endif
#include <deal.II/lac/scalapack.h>
+
+#ifdef DEAL_II_WITH_SCALAPACK
+
#include <deal.II/base/mpi.h>
#include <deal.II/base/conditional_ostream.h>
template class ScaLAPACKMatrix<double>;
DEAL_II_NAMESPACE_CLOSE
+
+#endif // DEAL_II_WITH_SCALAPACK
IF( _var MATCHES "^(TEST|DEAL_II|ALLOW|WITH|FORCE|COMPONENT)_" OR
_var MATCHES "^(DOCUMENTATION|EXAMPLES)" OR
_var MATCHES "^(ADOLC|ARPACK|BOOST|OPENCASCADE|MUPARSER|HDF5|METIS|MPI)_" OR
- _var MATCHES "^(NETCDF|P4EST|PETSC|SLEPC|THREADS|TBB|TRILINOS)_" OR
+ _var MATCHES "^(NETCDF|P4EST|PETSC|SCALAPACK|SLEPC|THREADS|TBB|TRILINOS)_" OR
_var MATCHES "^(UMFPACK|ZLIB|LAPACK|MUPARSER|CUDA)_" OR
_var MATCHES "^(CMAKE|DEAL_II)_(C|CXX|Fortran|BUILD)_(COMPILER|FLAGS)" OR
_var MATCHES "^CMAKE_BUILD_TYPE$" OR
--build . --target setup_tests
-- ${MAKEOPTS}
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
- OUTPUT_QUIET
+ OUTPUT_QUIET
RESULT_VARIABLE _res
)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
INCLUDE(../setup_testsubproject.cmake)
PROJECT(testsuite CXX)
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_SCALAPACK)
+ DEAL_II_PICKUP_TESTS()
+ENDIF()