# -*- INI -*-
#
# Copyright (C) 2015-2021 ABINIT Group (Yann Pouillon)
#
# This file is part of the ABINIT software package. For license information,
# please see the COPYING file in the top-level directory of the ABINIT source
# distribution.
#

#
# Config file for the support of linear algebra in Abinit
#
# Note: The following statements are in the Python "INI" format, with
#       case-sensitivity activated.
#
# Each of the following sections corresponds to a linear algebra component.
#
# Available options:
#
#   * contexts   : specific conditons, like e.g. MPI or GPU (mandatory);
#   * depends    : dependencies on other linear algebra components (optional);
#   * extensions : list of interesting extension routines (optional);
#   * includes   : required C headers or Fortran modules (optional);
#   * language   : programming language of the component (mandatory);
#   * libraries  : list of library names to look for (mandatory);
#   * replaces   : component superseded by the current one (optional);
#   * routines   : list of routines to check (mandatory);
#   * optional   : whether the component is optional (mandatory).
#

# WARNING: modify the defaults with *extreme* care!
[DEFAULT]
contexts = all
language = fortran
optional = no

[blas]
libraries = blas goto goto2
routines =
  saxpy,daxpy,caxpy,zaxpy
  sgemv,dgemv,cgemv,zgemv
  sgemm,dgemm,cgemm,zgemm
extensions = axpby:saxpby,daxpby,caxpby,zaxpby gemm3m:cgemm3,zgemm3m

[cblas]
depends = blas
language = c
libraries = cblas
routines =
  cblas_saxpy cblas_daxpy cblas_caxpy cblas_zaxpy
  cblas_sgemv cblas_dgemv cblas_cgemv cblas_zgemv
  cblas_sgemm cblas_dgemm cblas_cgemm cblas_zgemm
optional = yes

[blas_mkl]
contexts = intel
replaces = blas
libraries = @mkl_config
routines =
  saxpy,daxpy,caxpy,zaxpy
  sgemv,dgemv,cgemv,zgemv
  sgemm,dgemm,cgemm,zgemm
extensions =
  mkl_imatcopy:mkl_simatcopy,mkl_dimatcopy,mkl_cimatcopy,mkl_zimatcopy
  mkl_omatcopy:mkl_somatcopy,mkl_domatcopy,mkl_comatcopy,mkl_zomatcopy
  mkl_omatadd:mkl_somatadd,mkl_domatadd,mkl_comatadd,mkl_zomatadd
optional = yes

[lapack]
depends = blas
libraries = lapack
routines = zhpev

[lapacke]
depends = blas
language = c
includes = lapacke.h
libraries = lapacke
routines = zhpev_
optional = yes

[lapack_mkl]
contexts = intel
depends = mkl_blas
replaces = lapack
libraries = @mkl_config
routines = zhpev

[scalapack]
contexts = mpi
depends = blas lapack
libraries = scalapack
routines = blacs_gridinit pzheevx
optional = yes

[scalapack_mkl]
contexts = intel mpi
replaces = scalapack
depends = mkl_blas mkl_lapack
libraries = @mkl_config
routines = blacs_gridinit pzheevx
optional = yes

[elpa_old]
contexts = mpi
depends = scalapack
includes = elpa1
libraries = elpa
routines = elpa_transpose_vectors
optional = yes

[elpa_new]
contexts = mpi
depends = scalapack
replaces = elpa_old
includes = elpa1
libraries = elpa
routines = elpa_transpose_vectors
optional = yes

[magma_old]
contexts = mpi gpu
depends = lapack
libraries = magma
routines = magmaf_zhegvd
optional = yes

[magma_new]
contexts = mpi gpu
depends = lapack
replaces = magma_old
libraries = magma
routines = magmaf_zhegvd magma_init magma_finalize
optional = yes

[plasma]
contexts = mpi
depends = lapacke
includes = plasma.mod
libraries = plasma
routines = plasma_zhegv
optional = yes
