Skip to content

Commit

Permalink
Improved ScaLAPACK support (SCALAPACK_ADDON).
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp committed Dec 16, 2024
1 parent 5c96eb3 commit dcb1228
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions config/cp2k/Linux-x86-64-intelx.arch
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,35 @@ ifneq (0,$(MPI))
endif
endif

ifneq (0,$(SCALAPACK))
ifneq (0,$(MPI))
DFLAGS += __SCALAPACK
ifneq (0,$(LEGACY))
DFLAGS += __BLACS
endif
ifeq (0,$(shell echo $(SCALAPACK) | grep -q "^-*[0-9]\+$$"; echo $$?)) # number
ifneq (-1,$(SCALAPACK))
ifneq (1,$(SCALAPACK))
DFLAGS += __SCALAPACK$(SCALAPACK)
endif
endif
endif
ifneq (,$(MKLROOT)) # link as part of MKL even for non-MKL ScaLAPACK
SCALAPACKDIR := $(MKLROOT)/lib/intel64
SCALAPACKLIB := mkl_scalapack_$(MKL_BITS)
else # not via MKL
SCALAPACKLIB := $(if $(filter-out 0,$(IMPI)),scalapack,scalapack-openmpi)
ifneq (,$(SCALAPACKDIR))
LIBS += -L$(SCALAPACKDIR)
endif
ifneq (,$(SCALAPACKLIB))
LIBS += -l$(SCALAPACKLIB)
endif
endif
LIBS += $(SCALAPACK_ADDON)
endif
endif

ifneq (0,$(NDEBUG))
DFLAGS += NDEBUG
ifneq (1,$(NDEBUG)) # CP2K and DBCSR
Expand Down Expand Up @@ -614,6 +643,9 @@ ifneq (,$(MKLROOT))
$(info MKLROOT: $(MKLROOT))
endif
endif
ifneq (,$(strip $(SCALAPACKDIR) $(SCALAPACKLIB)))
$(info ScaLAPACK: -L$(SCALAPACKDIR) -l$(SCALAPACKLIB))
endif
ifneq (0,$(LIBXSMM)) # incl. undefined
ifneq (,$(wildcard $(CP2KHOME)/../libxsmm/Makefile))
LIBXSMMROOT ?= $(abspath $(CP2KHOME)/../libxsmm)
Expand Down Expand Up @@ -919,34 +951,6 @@ $(EXTSPACKAGES): libxsmm
endif
endif

ifneq (0,$(SCALAPACK))
ifneq (0,$(MPI))
DFLAGS += __SCALAPACK
ifneq (0,$(LEGACY))
DFLAGS += __BLACS
endif
ifeq (0,$(shell echo $(SCALAPACK) | grep -q "^-*[0-9]\+$$"; echo $$?)) # number
ifneq (-1,$(SCALAPACK))
ifneq (1,$(SCALAPACK))
DFLAGS += __SCALAPACK$(SCALAPACK)
endif
endif
endif
ifneq (,$(MKLROOT)) # link as part of MKL even for non-MKL ScaLAPACK
SCALAPACKDIR := $(MKLROOT)/lib/intel64
SCALAPACKLIB := mkl_scalapack_$(MKL_BITS)
else # not via MKL
SCALAPACKLIB := $(if $(filter-out 0,$(IMPI)),scalapack,scalapack-openmpi)
ifneq (,$(SCALAPACKDIR))
LIBS += -L$(SCALAPACKDIR)
endif
ifneq (,$(SCALAPACKLIB))
LIBS += -l$(SCALAPACKLIB)
endif
endif
endif
endif

ifneq (0,$(MKL))
DFLAGS += __MKL __FFTW3
DFLAGS += $(if $(filter 1,$(MKL_DIRECT)),MKL_DIRECT_CALL_SEQ)
Expand Down

0 comments on commit dcb1228

Please sign in to comment.