Commit Graph

3830 Commits

Author SHA1 Message Date
degironc 2f60e1196c changes previously imolemented to the q-function smoothing are actually applied
when tq_smoothing is true. previously, the unsmoothed fourier/back-fourier transfmomed 
functions where erroneously copied into qfuncl.
tqr=.true. and .false. give now very similar results when smoothing is applied.
And smoothing is adjusted so as to do the least necessary to acheive this. 



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13683 c92efa57-630b-4861-b058-cf58834340f0
2017-08-04 09:36:48 +00:00
degironc 3e6b4f8e76 MAJOR restructuring of the FFTXlib library
In real space processors are organized in a 2D pattern.

Each processor owns data from a sub-set of Z-planes and a sub-set of Y-planes.
In reciprocal space each processor owns Z-columns that belong to a sub set of
X-values. This allows to split the processors in two sets for communication
in the YZ and XY planes.
In alternative, if the situation allows for it, a task group paralelization is used
(with ntg=nyfft) where complete XY planes of ntg wavefunctions are collected and Fourier
trasnformed in G space by different task-groups. This is preferable to the Z-proc + Y-proc
paralleization if task group can be used because a smaller number of larger ammounts of 
data are transferred. Hence three types of fft are implemented: 
 
  !
  !! ... isgn = +-1 : parallel 3d fft for rho and for the potential
  !
  !! ... isgn = +-2 : parallel 3d fft for wavefunctions
  !
  !! ... isgn = +-3 : parallel 3d fft for wavefunctions with task group
  !
  !! ... isgn = +   : G-space to R-space, output = \sum_G f(G)exp(+iG*R)
  !! ...              fft along z using pencils        (cft_1z)
  !! ...              transpose across nodes           (fft_scatter_yz)
  !! ...              fft along y using pencils        (cft_1y)
  !! ...              transpose across nodes           (fft_scatter_xy)
  !! ...              fft along x using pencils        (cft_1x)
  !
  !! ... isgn = -   : R-space to G-space, output = \int_R f(R)exp(-iG*R)/Omega
  !! ...              fft along x using pencils        (cft_1x)
  !! ...              transpose across nodes           (fft_scatter_xy)
  !! ...              fft along y using pencils        (cft_1y)
  !! ...              transpose across nodes           (fft_scatter_yz)
  !! ...              fft along z using pencils        (cft_1z)
  !
  ! If task_group_fft_is_active the FFT acts on a number of wfcs equal to 
  ! dfft%nproc2, the number of Y-sections in which a plane is divided. 
  ! Data are reshuffled by the fft_scatter_tg routine so that each of the 
  ! dfft%nproc2 subgroups (made by dfft%nproc3 procs) deals with whole planes 
  ! of a single wavefunciton.
  !

fft_type module heavily modified, a number of variables renamed with more intuitive names 
(at least to me), a number of more variables introduced for the Y-proc parallelization.

Task_group module made void. task_group management is now reduced to the logical component
 fft_desc%have_task_groups of fft_type_descriptor type variable fft_desc.

In term of interfaces, the 'easy' calling sequences are

SUBROUTINE invfft/fwfft( grid_type, f, dfft, howmany )

  !! where:
  !! 
  !! **grid_type = 'Dense'** : 
  !!   inverse/direct fourier transform of potentials and charge density f
  !!   on the dense grid (dfftp). On output, f is overwritten
  !! 
  !! **grid_type = 'Smooth'** :
  !!   inverse/direct fourier transform of  potentials and charge density f
  !!   on the smooth grid (dffts). On output, f is overwritten
  !! 
  !! **grid_type = 'Wave'** :
  !!   inverse/direct fourier transform of  wave functions f
  !!   on the smooth grid (dffts). On output, f is overwritten
  !!
  !! **grid_type = 'tgWave'** :
  !!   inverse/direct fourier transform of  wave functions f with task group
  !!   on the smooth grid (dffts). On output, f is overwritten
  !!
  !! **grid_type = 'Custom'** : 
  !!   inverse/direct fourier transform of potentials and charge density f
  !!   on a custom grid (dfft_exx). On output, f is overwritten
  !! 
  !! **grid_type = 'CustomWave'** :
  !!   inverse/direct fourier transform of  wave functions f
  !!   on a custom grid (dfft_exx). On output, f is overwritten
  !! 
  !! **dfft = FFT descriptor**, IMPORTANT NOTICE: grid is specified only by dfft.
  !!   No check is performed on the correspondence between dfft and grid_type.
  !!   grid_type is now used only to distinguish cases 'Wave' / 'CustomWave' 
  !!   from all other cases
                                                                                                 

Many more files modified.




git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13676 c92efa57-630b-4861-b058-cf58834340f0
2017-08-01 20:31:02 +00:00
giannozz 5c32736c3c Magnetic anisotropy with Force Theorem wasn't working any longer with new I/O
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13669 c92efa57-630b-4861-b058-cf58834340f0
2017-07-31 19:35:11 +00:00
pietrodelugas c961d6b145 for XML I/O in pw.x and cp.x iotk has been replaced with FoX
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13654 c92efa57-630b-4861-b058-cf58834340f0
2017-07-30 17:59:35 +00:00
degironc 7798cfa83a PW/src/make.depend updated
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13647 c92efa57-630b-4861-b058-cf58834340f0
2017-07-30 06:57:25 +00:00
degironc 4636bca635 KS_Solvers directory has been created with three subdirectories:
KS_Solvers/CG, KS_Solvers/Davidson, KS_Solvers/Davidson_RCI.
Two are currently used by QE, the third one implements the Davidson
diagonalization within the Reverse Communication Interface paradigm,
courtesy of Micael Oliveira.

KS_Solvers routines depend only on lower level libraries, notably UtilXlib, 
LAXlib, (SCA)LAPACK, and BLAS.

reorganization can be improved. For instance some duplicated routines like
cdiaghg and rdiaghg could/should be moved in LAXlib. This could reduce the need
to include  KS_Solvers directories in the link step of many codes.    

Minimal changes to calling sequence have been made, essentially just adding
h_psi,s_psi,g_psi and h_1psi,s_1psi routines names as arguments (with a
specific calling sequence ihardcode inside the routines that agree with PWSCF one). 
This could be avoided adopting the RCI paradigm.

Compiled in serial and parallel, 177/182 pw tests passed (3 that were failing 
even before on my laptop pw-berry, pw-langevin, pw-pawatom + 2 unknown==not tested), 
12 /17 cp tests passed (some o2-us-para-pbe-X fail but the same was for the 
original version)

I assume the modified calling procedure is working and the problem lies somewhere else.
 
Randomly tested some examples in pw, ph, pwcond and it seams to work.

Please report any problem.





git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13644 c92efa57-630b-4861-b058-cf58834340f0
2017-07-29 12:19:19 +00:00
giannozz 3e30b7b51c The previous commit of mine broke compilation of everything: I had forgotten
that the F77_FUNC trick was used also in FFTXlib/fftw.c. Now it is removed for
good. There is a new file of interfaces. In case of a strange behavior with
FFTW, this is for sure the culprint.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13642 c92efa57-630b-4861-b058-cf58834340f0
2017-07-28 15:17:10 +00:00
degironc fe8300299c mp_diag.f90 moved from Modules to LAXlib
dependencies updated


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13641 c92efa57-630b-4861-b058-cf58834340f0
2017-07-28 14:21:28 +00:00
giannozz 322baa015d Re-installed some minor changes to C and timing functions, aimed towards
removal of old-style fortran to C binding and of configure hacks. The
fortran timing functions are now f_tcpu and f_wall, with obvious meaning


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13631 c92efa57-630b-4861-b058-cf58834340f0
2017-07-27 17:26:36 +00:00
degironc 7fd27ba0ad UtilXlib directory created to contain a library (libutil.a) for
basic operations: error handling, timing clocks, interfaces to basic mpi 
calls, find free units...
These routines are moved from Modules and dependencies to other modules
are removed. 

MANY files are updated to comply with the move.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13629 c92efa57-630b-4861-b058-cf58834340f0
2017-07-26 11:15:20 +00:00
pietrodelugas 829c167d22 Small improvements in the printout of the convergence info:
number of optimization steps is printed only for relaxations and md;
for nscf calculations the n_scf_steps field is set to 1 instead of 0.   


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13614 c92efa57-630b-4861-b058-cf58834340f0
2017-07-22 07:53:29 +00:00
degironc df126dd3f9 previous commit (13604) broke the noncolin density calculation.
BEWARE if npol is included from a module at the top of the routine
and is declared again after a CONTAINS section... the compiled does
not complain and the unitialized value of npol is used !

I think it should be considered a compiler bug.
  


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13608 c92efa57-630b-4861-b058-cf58834340f0
2017-07-18 21:18:53 +00:00
giannozz 93832116a9 Some more minor C-fortran cleanup
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13606 c92efa57-630b-4861-b058-cf58834340f0
2017-07-18 17:35:40 +00:00
degironc e1d6b18de9 more changes at the smmothing of beta- and q-funcions
US variable qq renamed qq_nt and a new variable qq_na added
because in real space the integral may depend (slightly) on
the atomic position and an atomic value is needed to compute
exactly normalizable wfc.  
Whenever realspace tricks are not used  qq_nt is used.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13604 c92efa57-630b-4861-b058-cf58834340f0
2017-07-15 23:16:18 +00:00
giannozz 9d3cd8474e Home-made definition of C_POINTER, used by FFTW, replaced by standard
iso_c_module types and variables


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13600 c92efa57-630b-4861-b058-cf58834340f0
2017-07-15 14:24:22 +00:00
degironc f8f30aa97a beta smoothing routine modified so that no more than eps(=1.d-8) of the integral is lost in real space.
if tprint=.true. the intended function meaning is written in the beta files.
  


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13590 c92efa57-630b-4861-b058-cf58834340f0
2017-07-09 13:52:31 +00:00
degironc 9fc90fdae6 The construction of the lists of points in the spheres around the atoms that
are used when realspace=.true. or tqr=.true. is modified so that it works correctly
even when the spheres spill out of the wigner seitz cell.
For sufficiently large cells it makes no difference but for some monoatomic crystal 
structures the sphere was incorrectly trimmed.
The execution time should improve for large cells as only a limited region of space
around each atom is examined.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13588 c92efa57-630b-4861-b058-cf58834340f0
2017-06-30 22:12:37 +00:00
giannozz 66bce3c243 Bogus error with disk_io='none' and structural optimization. and wasted I/O:
charge density at previous iteration was saved even when not needed.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13581 c92efa57-630b-4861-b058-cf58834340f0
2017-06-30 07:29:03 +00:00
giannozz 0bc1db1525 Improved memory estimator by Pietro Bonfa'
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13580 c92efa57-630b-4861-b058-cf58834340f0
2017-06-27 16:28:33 +00:00
giannozz 15114f8975 kpoints.f90 updated to work with all "ibrav". Untested.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13576 c92efa57-630b-4861-b058-cf58834340f0
2017-06-22 12:07:33 +00:00
giannozz 094e922a58 Array if_pos turning on or off specific force component is allocated only by
pw.x and cp.x and no longer by any postprocessor codes. Any attempt to use its
contents will trigger an error. "output_tau" now checks that it is allocated.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13570 c92efa57-630b-4861-b058-cf58834340f0
2017-06-14 07:09:30 +00:00
giannozz ca0e7ce92a Recent commit contained a macroscopic bug preventing I/O of rho and wfc.
read_wfc and read_rhog aligned to the same logic of rwrite_wfc and write_rhog.
May or may not work. 


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13569 c92efa57-630b-4861-b058-cf58834340f0
2017-06-14 06:39:05 +00:00
giannozz 927e3a174f Cleanup of new binary I/O: write_wfc and write_rhog now work (maybe) with
pools and band groups (not sure with both, but this doesn't happen now). 
To be dobe for read_wfc and read_rhog as well.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13567 c92efa57-630b-4861-b058-cf58834340f0
2017-06-10 19:52:06 +00:00
pietrodelugas 97544fe42c FCP output fields are not more printed out when non initialized; as prescribed by the schema tha the Functional is indicated by its short name also in output
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13561 c92efa57-630b-4861-b058-cf58834340f0
2017-06-09 20:49:09 +00:00
giannozz ed9ce5ec0c Conversion from lattice vectors to celldm parameters moved into a separate
subroutine and closer to routine "latgen" performing the opposite operation.

NOTE: postprocessing codes that use ibrav and celldm, shouldn't!


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13555 c92efa57-630b-4861-b058-cf58834340f0
2017-06-07 17:36:20 +00:00
pietrodelugas 81f2080545 other corrections to the celldm recalculation, added case ibrav=-3, fixed case ibrav=7
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13552 c92efa57-630b-4861-b058-cf58834340f0
2017-06-07 11:32:56 +00:00
pietrodelugas a931f66194 fixes for the ricalculation of celldm for ibrav = -5, -12 and 13
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13550 c92efa57-630b-4861-b058-cf58834340f0
2017-06-07 07:03:31 +00:00
giannozz 1b92a21136 celldm were incorrectly recomputed for ibrav=1 when reading the XML file.
This may lead to funny results in postprocessing codes that unfortunately
still use celldm 


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13548 c92efa57-630b-4861-b058-cf58834340f0
2017-06-06 16:37:01 +00:00
pietrodelugas 0c9ca78026 hdf5 interface has been readapted to recent changes of the binary output. H5F5 interface now works for 1.10.x as well as 1.8.x libraries and can be compiled using serial hdf5 libraries
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13545 c92efa57-630b-4861-b058-cf58834340f0
2017-06-04 17:42:17 +00:00
giannozz 4aa0376b0f Some improvements (?) to documentation and coding of "average.x"
Some minor fixes (misspells etc.)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13540 c92efa57-630b-4861-b058-cf58834340f0
2017-06-01 08:25:32 +00:00
oliviero ff3abc4d44 Added a check in real-space loops to prevent possible bugs when nr1x .NE. nr1
Added a check to avoid that real-space loops operate on non-physical gridpoints
which are only there to speed up specific flavors of FFTS. Apparently no
effects on machines with standard FFTS (all pw tests passed), but can't verify 
the actual case where the bug may occur.  


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13538 c92efa57-630b-4861-b058-cf58834340f0
2017-05-30 15:12:46 +00:00
oliviero cda2b017bc removed redundant ggradient subroutine, duplicate of hessian
ggradient, originally developed for Environ, was in fact a 
perfect copy of hessian: removed it together with its external 
interface. Replaced the only non-Environ call to external_ggradient
by a call to external_hessian, passed the pw_xdm test.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13537 c92efa57-630b-4861-b058-cf58834340f0
2017-05-30 12:53:59 +00:00
ferretti 4d143a1a98 small inconsistency in the printed HOMO-LUMO gap fixed.
Entered in qe-6.1 and shows when one spin channel has no electrons


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13532 c92efa57-630b-4861-b058-cf58834340f0
2017-05-26 10:43:57 +00:00
giannozz e20148bf55 Miscellaneous cleanup: removal of now, minor corrections. Everything should be
safe but please check.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13531 c92efa57-630b-4861-b058-cf58834340f0
2017-05-25 14:36:54 +00:00
ferretti 7b79b69b94 bug fixed: variable U_projection_type was muted by a non-init
use of npw. Removed, interface of ortho_swfc modified


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13529 c92efa57-630b-4861-b058-cf58834340f0
2017-05-25 09:13:02 +00:00
giannozz d4dd677ec9 Cleanup. IMPORTANT NOTICE: the "collected" format is now the default
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13528 c92efa57-630b-4861-b058-cf58834340f0
2017-05-24 20:40:21 +00:00
giannozz d843e377ff Added the three primitive vectors to wavefunction files. Together with Miller
indices, this allows to reconstruct k+G vectors without any information from
other files. Memory usage optimiation: the large arrays needed to collect data 
are allocated only on the processor(s) performing actual I/O.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13525 c92efa57-630b-4861-b058-cf58834340f0
2017-05-24 06:07:04 +00:00
giannozz af25f2593b Added k-point in wavefunction file: it is an important piece of information
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13524 c92efa57-630b-4861-b058-cf58834340f0
2017-05-22 17:41:01 +00:00
giannozz e1f0f47ed2 Minor cleanup
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13522 c92efa57-630b-4861-b058-cf58834340f0
2017-05-22 17:38:17 +00:00
giannozz d53d404221 Miller indices for k+G stored in the (collected) wavefunction file, so that
one has the (almost) full information on wavefunctions in a single file.
'gkvect.dat' files deleted from new format. 
NOTE: the new format is incompatible with both the old one and with previous
versions of the new one, and this is not yet the final version.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13520 c92efa57-630b-4861-b058-cf58834340f0
2017-05-18 19:23:33 +00:00
giannozz b4c76d02ac Charge density is written and read in reciprocal space for PW also. There are
still a few exotic cases in which the charge density is written and read in
real space, though, that will be dealt with in due time. In order to minimize
the amount of changes, the charge density is converted to real space, thus
wastin some FFTs. To be fixed when the old format is removed.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13517 c92efa57-630b-4861-b058-cf58834340f0
2017-05-16 15:00:18 +00:00
giannozz e43f68bd15 Namelist order is mandatory
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13513 c92efa57-630b-4861-b058-cf58834340f0
2017-05-16 07:14:01 +00:00
giannozz f9dfb35cf1 write_rho must create the output directory if not existent
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13510 c92efa57-630b-4861-b058-cf58834340f0
2017-05-12 14:35:15 +00:00
giannozz f9ab29818b Recent commits broke old xml format - thanks to Matthew Goldey
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13507 c92efa57-630b-4861-b058-cf58834340f0
2017-05-12 06:12:59 +00:00
giannozz ed09ac9a6a Directpry names should always have a '/' at the end
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13506 c92efa57-630b-4861-b058-cf58834340f0
2017-05-11 20:41:24 +00:00
giannozz 0dfbbe7f05 Merge of write_rho between CP and PW - still no real format change.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13505 c92efa57-630b-4861-b058-cf58834340f0
2017-05-10 20:33:14 +00:00
giannozz 99b1ddbee0 Merge of read_rho between CP and PW, but no change of format yet.
NOTE: directory names should always end with "/"


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13504 c92efa57-630b-4861-b058-cf58834340f0
2017-05-10 17:38:56 +00:00
giannozz 415527d8ef Beginning of cleanup for charge density I/O: PW-specific routines separated
from generic one. read/write_rho => read/write_scf for structure rho.
read/write_rho_only => read/write_only, moved to Modules/xml_io_base.f90.
Nothing substantial, but beware side effects


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13502 c92efa57-630b-4861-b058-cf58834340f0
2017-05-09 20:04:16 +00:00
giannozz 31f6186fec Glitches with new xml file after recent changes for CP compatibility.
IMPORTANT NOTE: in LSDA nbnd is the sum of up and down nbnd, as it should be,
so it must be divided by 2 in PW when it is read from file


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13499 c92efa57-630b-4861-b058-cf58834340f0
2017-05-09 07:16:58 +00:00
giannozz 44d31e4709 Module pwcom should not contain references to other modules
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13498 c92efa57-630b-4861-b058-cf58834340f0
2017-05-08 15:26:53 +00:00