Commit e85f28b1 authored by Nick R. Papior's avatar Nick R. Papior
Browse files

Fixed PEXSI compilation and deferred the Nodes count

- A couple of define flags for PEXSI was not up to date,
  possibly lost during the merge(?). Well...

- Updated print-out of computational method in read_options.

- Moved printing of number of nodes to one line
parent 0a2e8078
......@@ -35,6 +35,7 @@ C
logical, save :: SIESTA_worker = .false.
integer, save :: Node = 0
integer, save :: Nodes = 1
integer, save :: PEXSINodes = 1
integer, save :: BlockSize = 24
integer, save :: ProcessorY = 1
......@@ -55,7 +56,7 @@ C
subroutine parallel_init() ! Initializes Node, Nodes, and IOnode
#ifdef MPI
use mpi_siesta, only: MPI_Comm_World
logical,save:: initialized=.false.
logical, save:: initialized=.false.
integer :: MPIerror
if (.not.initialized) then
call MPI_Comm_Rank( MPI_Comm_World, Node, MPIerror )
......
......@@ -662,27 +662,26 @@ subroutine read_options( na, ns, nspin )
value=method, dictRef='siesta:SCFmethod' )
endif
if (leqi(method,'matrix')) then
isolve = MATRIX_WRITE
if (ionode) then
write(6,'(a,4x,a)') 'redata: Method of Calculation = ',&
'Matrix write only'
endif
else if (leqi(method,'diagon')) then
if (leqi(method,'matrix')) then
isolve = MATRIX_WRITE
if (ionode) then
write(*,3) 'redata: Method of Calculation', 'Matrix write only'
endif
else if (leqi(method,'diagon')) then
isolve = SOLVE_DIAGON
! DivideAndConquer is now the default
DaC = fdf_get('Diag.DivideAndConquer',.true.)
if (ionode) then
write(6,3) 'redata: Method of Calculation', 'Diagonalization'
write(6,1) 'redata: Divide and Conquer', DaC
write(*,3) 'redata: Method of Calculation', 'Diagonalization'
write(*,1) 'redata: Divide and Conquer', DaC
endif
else if (leqi(method,'ordern')) then
isolve = SOLVE_ORDERN
DaC = .false.
if (ionode) then
write(6,3) 'redata: Method of Calculation','Order-N'
write(*,3) 'redata: Method of Calculation','Order-N'
endif
if (nspin .gt. 2) then
call die( 'redata: You chose the Order-N solution option '// &
......@@ -697,21 +696,21 @@ subroutine read_options( na, ns, nspin )
call_diagon_first_step=fdf_integer('OMM.DiagonFirstStep',call_diagon_default)
minim_calc_eigenvalues=fdf_boolean('OMM.Eigenvalues',.false.)
if (ionode) then
write(6,3) 'redata: Method of Calculation', 'Orbital Minimization Method'
write(*,3) 'redata: Method of Calculation', 'Orbital Minimization Method'
endif
else if (leqi(method,"pexsi")) then
#ifdef PEXSI
isolve = SOLVE_PEXSI
if (ionode) then
write(6,'(a,4x,a)') 'redata: Method of Calculation = ', &
'PEXSI'
endif
#ifdef SIESTA__PEXSI
isolve = SOLVE_PEXSI
if (ionode) then
write(*,3) 'redata: Method of Calculation', 'PEXSI'
endif
#else
call die("PEXSI solver is not compiled in. Use -DPEXSI")
call die("PEXSI solver is not compiled in. Use -DSIESTA__PEXSI")
#endif
#ifdef TRANSIESTA
else if (leqi(method,'transi') .or. leqi(method,'transiesta') ) then
else if (leqi(method,'transi') .or. leqi(method,'transiesta') &
.or. leqi(method,'negf') ) then
isolve = SOLVE_TRANSI
if (ionode) then
write(*,3) 'redata: Method of Calculation','Transiesta'
......@@ -721,6 +720,9 @@ subroutine read_options( na, ns, nspin )
call die( 'redata: The method of solution must be either '//&
#ifdef TRANSIESTA
'Transiesta, '//&
#endif
#ifdef SIESTA__PEXSI
'PEXSI, '//&
#endif
'OrderN, OMM or Diagon' )
endif
......
......@@ -60,7 +60,7 @@
C Begin of coordinate relaxation iteration
relaxd = .false.
#ifdef PEXSI
#ifdef SIESTA__PEXSI
! Broadcast relevant things for program logic
! These were set in siesta_options, called only by "SIESTA_workers".
call broadcast(inicoor,comm=true_MPI_Comm_World)
......@@ -71,7 +71,7 @@ C Begin of coordinate relaxation iteration
call siesta_forces( istep )
if (SIESTA_worker) call siesta_move( istep, relaxd )
#ifdef PEXSI
#ifdef SIESTA__PEXSI
call broadcast(relaxd,comm=true_MPI_Comm_World)
#endif
if (.not. relaxd) then
......
......@@ -67,7 +67,7 @@
use m_compute_energies, only: compute_energies
use m_mpi_utils, only: broadcast
use fdf
#ifdef PEXSI
#ifdef SIESTA__PEXSI
use m_pexsi, only: pexsi_finalize_scfloop
#endif
......@@ -114,7 +114,7 @@
call write_debug( ' PRE siesta_forces' )
#endif
#ifdef PEXSI
#ifdef SIESTA__PEXSI
! Broadcast relevant things for program logic
! These were set in read_options, called only by "SIESTA_workers".
call broadcast(nscf,comm=true_MPI_Comm_World)
......@@ -372,7 +372,7 @@
endif ! SIESTA_worker
#ifdef PEXSI
#ifdef SIESTA__PEXSI
call broadcast(last_step,comm=true_MPI_Comm_World)
call broadcast(iscf,comm=true_MPI_Comm_World)
#endif
......@@ -380,7 +380,7 @@
end do
#ifdef PEXSI
#ifdef SIESTA__PEXSI
if (isolve == SOLVE_PEXSI) then
call pexsi_finalize_scfloop()
endif
......
......@@ -44,7 +44,7 @@
use siesta_cmlsubs, only: siesta_cml_init
use m_timestamp, only: timestamp
use m_wallclock, only: wallclock
use parallel, only: Node, Nodes, IOnode
use parallel, only: Node, Nodes, PEXSINodes, IOnode
use parallel, only: SIESTA_worker
use parallel, only: SIESTA_Group, SIESTA_Comm
use densematrix, only: Haux, Saux, Psi
......@@ -140,6 +140,8 @@ C Initialise MPI and set processor number
call MPI_Comm_Rank( MPI_Comm_World, Node, MPIerror )
call MPI_Comm_Size( MPI_Comm_World, Nodes, MPIerror )
! Keeper for PEXSI-runs..
PEXSINodes = Nodes
if (Node == 0) then
call get_command_line_options()
if (use_explicit_output_file) then
......@@ -150,9 +152,6 @@ C Initialise MPI and set processor number
endif
endif
if (Node == 0) write(6,"(a,i6)")
$ "** Total Number of Nodes: ", Nodes
if (.not. fdf_parallel()) then
call die('siesta_init: ERROR: FDF module ' //
& 'doesn''t have parallel support')
......@@ -195,6 +194,7 @@ C Initialise MPI and set processor number
SIESTA_worker = .true.
Node = 0
Nodes = 1
PEXSINodes = 1
#endif
IOnode = SIESTA_worker .and. (Node .eq. 0)
......@@ -219,11 +219,15 @@ C Initialise MPI and set processor number
if (IOnode) then
call prversion()
#ifdef MPI
if (Nodes.gt.1) then
write(6,'(/,a,i0,a)')
& '* Running on ', Nodes, ' nodes in parallel'
if ( PEXSINodes /= Nodes ) then
write(6,'(/,a,2(i0,a))')
& '* Running on ', Nodes, ' SIESTA-nodes and ',
& PEXSINodes, ' PEXSI-nodes in parallel'
else if ( Nodes > 1 ) then
write(6,'(/,a,i0,a)')
& '* Running on ', Nodes, ' nodes in parallel'
else
write(6,'(/,a)') '* Running in serial mode with MPI'
write(6,'(/,a)') '* Running in serial mode with MPI'
endif
#else
write(6,'(/,a)') '* Running in serial mode'
......
......@@ -27,7 +27,6 @@ MODULE siesta_options
logical :: compat_pre_v4_dynamics ! General switch
logical :: mix_scf_first ! Mix first SCF step?
logical :: mix_charge ! New: mix fourier components of rho
logical :: mixH ! Mix H instead of DM
......
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