Commit da222183 authored by Alberto Garcia's avatar Alberto Garcia
Browse files

Use SIESTA__PEXSI as symbol, and .LDOS. instead of .localdos.

Updated "ifdefs" to use SIESTA__PEXSI as flag. 

PEXSI local DOS routines now use  .LDOS. fdf flags. Updated test files.

(+ make previous 2D-array MPI "gather" interface changes in .lit files)


parent 9e8f530c
------------------------------------------------------------
August 4, 2016 A. Garcia trunk-537--pexsi-v0.8-spin-15
Use SIESTA__PEXSI as symbol, and .LDOS. instead of .localdos.
Updated "ifdefs" to use SIESTA__PEXSI as flag.
PEXSI local DOS routines now use .LDOS. fdf flags. Updated test files.
(+ make previous 2D-array MPI "gather" interface changes in .lit files)
------------------------------------------------------------
August 3, 2016 A. Garcia trunk-537--pexsi-v0.8-spin-14
Cleaner fix for init_spin behavior
......
......@@ -5785,29 +5785,29 @@ energy.
\itemsep 10pt
\parsep 0pt
\item[{\bf PEXSI.LocalDOS}] ({\it boolean}):
\index{PEXSI.LocalDOS@{\bf PEXSI.LocalDOS}}
\item[{\bf PEXSI.LDOS}] ({\it boolean}):
\index{PEXSI.LDOS@{\bf PEXSI.LDOS}}
Whether to compute the LDOS using the PEXSI technology.
{\it Default value:} {\tt .false.}
\item[{\bf PEXSI.LocalDOS.Energy}] ({\it real energy}):
\index{PEXSI.LocalDOS.Energy@{\bf PEXSI.LocalDOS.Energy}}
\item[{\bf PEXSI.LDOS.Energy}] ({\it real energy}):
\index{PEXSI.LDOS.Energy@{\bf PEXSI.LDOS.Energy}}
The (absolute) energy at which to compute the LDOS.
{\it Default value:} {\tt 0 Ryd}
\item[{\bf PEXSI.LocalDOS.Broadening}] ({\it real energy}):
\index{PEXSI.LocalDOS.Broadening@{\bf PEXSI.LocalDOS.Broadening}}
\item[{\bf PEXSI.LDOS.Broadening}] ({\it real energy}):
\index{PEXSI.LDOS.Broadening@{\bf PEXSI.LDOS.Broadening}}
The broadening parameter for the LDOS.
{\it Default value:} {\tt 0.01 Ryd}
\item[{\bf PEXSI.LocalDOS.np-per-pole}] ({\it integer}):
\index{PEXSI.LocalDOS.np-per-pole@{\bf PEXSI.LocalDOS.np-per-pole}}
\item[{\bf PEXSI.LDOS.np-per-pole}] ({\it integer}):
\index{PEXSI.LDOS.np-per-pole@{\bf PEXSI.LDOS.np-per-pole}}
The value of this parameter supersedes {\bf PEXSI.np-per-pole} for the
calculation of the LDOS, which otherwise would keep idle all but
......
......@@ -26,7 +26,7 @@ KINDS="4 8"
FPPFLAGS_MPI=-DMPI
#
PEXSI_INCFLAGS = -I/project/projectdirs/m1027/PEXSI/libpexsi_interfaces/$(PEXSI_VERSION)
FPPFLAGS_PEXSI=-DPEXSI
FPPFLAGS_PEXSI=-DSIESTA__PEXSI
#
# Extended interface
PEXSI_DIR = /project/projectdirs/m1027/PEXSI/libpexsi_edison
......@@ -48,7 +48,7 @@ LIBS = ${PEXSI_LIB} ${DSUPERLU_LIB} ${SELINV_LIB} ${SCOTCH_LIB} ${ME
LDFLAGS = -no-ipo
#
SYS=cpu_time
FPPFLAGS= $(FPPFLAGS_CDF) $(FPPFLAGS_MPI) -DMPI_TIMING -DF2003
FPPFLAGS= $(FPPFLAGS_CDF) $(FPPFLAGS_MPI) -DMPI_TIMING -DF2003 $(FPPFLAGS_PEXSI)
#
#
.F.o:
......
......@@ -4,7 +4,7 @@
PEXSI_VERSION=0.9.0
PEXSI_LIB_DIR=/gpfs/projects/bsc21/bsc21308/SIESTA/build/pexsi_v0.9.0
FPPFLAGS_PEXSI=-DPEXSI
FPPFLAGS_PEXSI=-DSIESTA__PEXSI
PEXSI_INCFLAGS=-I$(PEXSI_LIB_DIR)/fortran
SIESTA_ARCH=MareNostrum3-intel-openmpi-pexsi$(PEXSI_VERSION)
......@@ -21,7 +21,7 @@ DP_KIND=8
KINDS=$(SP_KIND) $(DP_KIND)
FFLAGS= -O3
FPPFLAGS= -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DMPI_TIMING
FPPFLAGS= -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DMPI_TIMING $(FPPFLAGS_PEXSI)
LDFLAGS=-Vaxlib
ARFLAGS_EXTRA=
......
......@@ -29,7 +29,7 @@ COMP_LIBS=
#
PEXSI_VERSION=0.8.0
PEXSI_LIB_DIR=$(HOME)/lib/PEXSI/$(PEXSI_VERSION)/openmpi-1.8.1-gfortran-4.8.3
FPPFLAGS_PEXSI=-DPEXSI
FPPFLAGS_PEXSI=-DSIESTA__PEXSI
PEXSI_INCFLAGS=-I$(PEXSI_LIB_DIR)/include
#
NETCDF_ROOT=/usr/local
......
......@@ -34,7 +34,7 @@
use parallel, only: IONode
use parallel, only: SIESTA_worker
use m_compute_ebs_shift, only: compute_ebs_shift
#ifdef PEXSI
#ifdef SIESTA__PEXSI
use m_pexsi_solver, only: pexsi_solver
#endif
use m_hsx, only : write_hs_formatted
......@@ -108,7 +108,7 @@
endif
endif
#ifdef PEXSI
#ifdef SIESTA__PEXSI
if (isolve .eq. SOLVE_PEXSI) then
! This test done in node 0 since NonCol and SpOrb
! are not set for PEXSI-solver-only processes
......
! For consistency, include the actual interface file in the library directory
#ifdef PEXSI
#ifdef SIESTA__PEXSI
!
include "f_interface.f90"
#endif
module m_pexsi
#ifdef PEXSI
#ifdef SIESTA__PEXSI
use precision, only: dp
use iso_c_binding
......
! Tangled code
module m_pexsi_dos
#ifdef PEXSI
#ifdef SIESTA__PEXSI
use precision, only : dp
public :: pexsi_dos
......
......@@ -9,7 +9,7 @@ module m_pexsi_solver
real(dp), save :: prevDmax ! For communication of max diff in DM in scf loop
! used in the heuristics for N_el tolerance
public :: prevDmax
#ifdef PEXSI
#ifdef SIESTA__PEXSI
public :: pexsi_solver
CONTAINS
......
! Tangled code
MODULE m_pexsi_local_dos
#ifdef PEXSI
#ifdef SIESTA__PEXSI
private
public :: pexsi_local_dos
......@@ -36,8 +36,8 @@
type(filesOut_t) :: filesOut ! blank output file names
energy = fdf_get('PEXSI.LocalDOS.Energy',0.0_dp,"Ry")
broadening = fdf_get('PEXSI.LocalDOS.Broadening',0.01_dp,"Ry")
energy = fdf_get('PEXSI.LDOS.Energy',0.0_dp,"Ry")
broadening = fdf_get('PEXSI.LDOS.Broadening',0.01_dp,"Ry")
! Note that we re-use Dscf, so it will be obliterated
call get_LDOS_SI( no_u, no_l, nspin, &
......@@ -63,7 +63,7 @@
END subroutine pexsi_local_dos
subroutine get_LDOS_SI( no_u, no_l, nspin_in, &
maxnh, numh, listh, H, S, &
LocalDOSDM, energy, broadening)
LDOS_DM, energy, broadening)
use precision, only : dp
use fdf
......@@ -92,7 +92,7 @@
integer, intent(in), target :: listh(maxnh), numh(no_l)
real(dp), intent(in), target :: H(maxnh,nspin_in), S(maxnh)
real(dp), intent(in) :: energy, broadening
real(dp), intent(out) :: LocalDOSDM(maxnh,nspin_in)
real(dp), intent(out) :: LDOS_DM(maxnh,nspin_in)
integer :: ih, i
integer :: info
logical :: write_ok
......@@ -170,7 +170,7 @@
call mpi_comm_size( World_Comm, numNodesTotal, ierr )
npPerPole = fdf_get("PEXSI.np-per-pole",4)
npPerPole = fdf_get("PEXSI.LocalDOS.np-per-pole",npPerPole)
npPerPole = fdf_get("PEXSI.LDOS.np-per-pole",npPerPole)
if (nspin*npPerPole > numNodesTotal) &
call die("PEXSI.np-per-pole is too big for MPI size")
......@@ -445,7 +445,7 @@
if (SIESTA_worker) then
LocalDOSDM(:,ispin) = m1%vals(1)%data(:)
LDOS_DM(:,ispin) = m1%vals(1)%data(:)
! Check no_l
if (no_l /= m1%no_l) then
call die("Mismatch in no_l")
......
! --- Tangled code
module m_redist_spmatrix
#ifdef PEXSI
#ifdef SIESTA__PEXSI
implicit none
type, public :: comm_t
integer :: src, dst, i1, i2, nitems
......
......@@ -21,7 +21,7 @@ This is the main structure of the code.
#+begin_src f90 :noweb-ref code-structure
module m_pexsi_dos
#ifdef PEXSI
#ifdef SIESTA__PEXSI
use precision, only : dp
public :: pexsi_dos
......@@ -265,7 +265,7 @@ For possibly spin-polarized calculations, we split the communicator.
! in the distribution object
allocate (PEXSI_Pole_ranks_in_World_Spin(npPerPole,nspin))
call MPI_AllGather(pexsi_pole_ranks_in_world,npPerPole,MPI_integer,&
PEXSI_Pole_Ranks_in_World_Spin,npPerPole, &
PEXSI_Pole_Ranks_in_World_Spin(1,1),npPerPole, &
MPI_integer,PEXSI_Spin_Comm,ierr)
! Create distributions known to all nodes
......@@ -569,7 +569,7 @@ integer :: j, lun
allocate(intdos_spin(npoints,nspin))
call MPI_Gather( intdos, npoints, MPI_double_precision, &
intdos_spin, npoints, MPI_double_precision, &
intdos_spin(1,1), npoints, MPI_double_precision, &
0, PEXSI_Spin_Comm, ierr )
if (mpirank == 0) then
......
......@@ -10,7 +10,7 @@ Module structure:
#+BEGIN_SRC f90 :noweb-ref module-structure
MODULE m_pexsi_local_dos
#ifdef PEXSI
#ifdef SIESTA__PEXSI
private
public :: pexsi_local_dos
......@@ -66,8 +66,8 @@ will have extension =.LDSI=.
type(filesOut_t) :: filesOut ! blank output file names
energy = fdf_get('PEXSI.LocalDOS.Energy',0.0_dp,"Ry")
broadening = fdf_get('PEXSI.LocalDOS.Broadening',0.01_dp,"Ry")
energy = fdf_get('PEXSI.LDOS.Energy',0.0_dp,"Ry")
broadening = fdf_get('PEXSI.LDOS.Broadening',0.01_dp,"Ry")
! Note that we re-use Dscf, so it will be obliterated
call get_LDOS_SI( no_u, no_l, nspin, &
......@@ -127,7 +127,7 @@ end subroutine get_LDOS_SI
#+BEGIN_SRC f90 :noweb-ref routine-header
subroutine get_LDOS_SI( no_u, no_l, nspin_in, &
maxnh, numh, listh, H, S, &
LocalDOSDM, energy, broadening)
LDOS_DM, energy, broadening)
<<used-modules>>
......@@ -137,7 +137,7 @@ end subroutine get_LDOS_SI
integer, intent(in), target :: listh(maxnh), numh(no_l)
real(dp), intent(in), target :: H(maxnh,nspin_in), S(maxnh)
real(dp), intent(in) :: energy, broadening
real(dp), intent(out) :: LocalDOSDM(maxnh,nspin_in)
real(dp), intent(out) :: LDOS_DM(maxnh,nspin_in)
#+END_SRC
*** Used modules
......@@ -263,7 +263,7 @@ per pole for the LDOS calculation.
call mpi_comm_size( World_Comm, numNodesTotal, ierr )
npPerPole = fdf_get("PEXSI.np-per-pole",4)
npPerPole = fdf_get("PEXSI.LocalDOS.np-per-pole",npPerPole)
npPerPole = fdf_get("PEXSI.LDOS.np-per-pole",npPerPole)
if (nspin*npPerPole > numNodesTotal) &
call die("PEXSI.np-per-pole is too big for MPI size")
......@@ -308,7 +308,7 @@ per pole for the LDOS calculation.
! in the distribution object
allocate (PEXSI_Pole_ranks_in_World_Spin(npPerPole,nspin))
call MPI_AllGather(pexsi_pole_ranks_in_world,npPerPole,MPI_integer,&
PEXSI_Pole_Ranks_in_World_Spin,npPerPole, &
PEXSI_Pole_Ranks_in_World_Spin(1,1),npPerPole, &
MPI_integer,PEXSI_Spin_Comm,ierr)
! Create distributions known to all nodes
......@@ -623,7 +623,7 @@ Note that only the first-pole team does this.
if (SIESTA_worker) then
LocalDOSDM(:,ispin) = m1%vals(1)%data(:)
LDOS_DM(:,ispin) = m1%vals(1)%data(:)
! Check no_l
if (no_l /= m1%no_l) then
call die("Mismatch in no_l")
......
......@@ -17,7 +17,7 @@ factorization information.
#+BEGIN_SRC f90 :noweb yes :tangle m_pexsi.F90
module m_pexsi
#ifdef PEXSI
#ifdef SIESTA__PEXSI
use precision, only: dp
use iso_c_binding
......@@ -119,7 +119,7 @@ module m_pexsi_solver
real(dp), save :: prevDmax ! For communication of max diff in DM in scf loop
! used in the heuristics for N_el tolerance
public :: prevDmax
#ifdef PEXSI
#ifdef SIESTA__PEXSI
public :: pexsi_solver
CONTAINS
......@@ -391,7 +391,7 @@ communicator. For now, this is World_Comm.
allocate (PEXSI_Pole_ranks_in_World_Spin(npPerPole,nspin))
call MPI_AllGather(pexsi_pole_ranks_in_world,npPerPole,MPI_integer,&
PEXSI_Pole_Ranks_in_World_Spin,npPerPole, &
PEXSI_Pole_Ranks_in_World_Spin(1,1),npPerPole, &
MPI_integer,PEXSI_Spin_Comm,ierr)
! Create distributions known to all nodes
......
......@@ -25,7 +25,7 @@ non-disjoint groups.
The general structure is
#+BEGIN_SRC f90 :noweb-ref code-structure
module m_redist_spmatrix
#ifdef PEXSI
#ifdef SIESTA__PEXSI
implicit none
<<module-type-declarations>>
public :: redistribute_spmatrix
......
......@@ -21,7 +21,7 @@
use m_ksv
USE m_projected_DOS, only: projected_DOS
USE m_local_DOS, only: local_DOS
#ifdef PEXSI
#ifdef SIESTA__PEXSI
USE m_pexsi_local_DOS, only: pexsi_local_DOS
USE m_pexsi_dos, only: pexsi_dos
#endif
......@@ -126,7 +126,7 @@
endif
endif
#ifdef PEXSI
#ifdef SIESTA__PEXSI
if (fdf_get("PEXSI.DOS",.false.)) then
call pexsi_dos(no_u, no_l, spinor_dim,
$ maxnh, numh, listhptr, listh, H, S, qtot, ef)
......@@ -550,8 +550,8 @@ C Find local density of states
! in 'siesta_move'
endif ! SIESTA_worker
#ifdef PEXSI
if (fdf_get("PEXSI.LocalDOS",.false.)) then
#ifdef SIESTA__PEXSI
if (fdf_get("PEXSI.LDOS",.false.)) then
call pexsi_local_DOS()
endif
#endif
......
......@@ -30,10 +30,10 @@ PEXSI.verbosity 2
#------
#--------------
PEXSI.DOS T
PEXSI.LocalDOS T
PEXSI.LocalDOS.np-per-pole 20
PEXSI.LocalDOS.Energy -3.5141 eV
PEXSI.LocalDOS.Broadening 0.05 eV
PEXSI.LDOS T
PEXSI.LDOS.np-per-pole 20
PEXSI.LDOS.Energy -3.5141 eV
PEXSI.LDOS.Broadening 0.05 eV
WriteDMHS.NetCDF F
......
......@@ -23,10 +23,10 @@ PEXSI.verbosity 2
#------
#--------------
PEXSI.DOS T
PEXSI.LocalDOS T
PEXSI.LocalDOS.np-per-pole 4
PEXSI.LocalDOS.Energy -3.5141 eV
PEXSI.LocalDOS.Broadening 0.05 eV
PEXSI.LDOS T
PEXSI.LDOS.np-per-pole 4
PEXSI.LDOS.Energy -3.5141 eV
PEXSI.LDOS.Broadening 0.05 eV
WriteDMHS.NetCDF F
......
trunk-537--pexsi-v0.8-spin-14
trunk-537--pexsi-v0.8-spin-15
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment