Commit Graph

28 Commits

Author SHA1 Message Date
fabrizio22 244657bc6e Ford-modules part 10 2021-03-17 13:17:20 +01:00
Pietro 542ccadb18 Protect access to gl and igtongl 2019-02-22 11:53:54 +00:00
Oliviero Andreussi 0fefce2757 fixed a bug in new ggens soubroutine
intel compiler was givin segfault for pointers passed as intent(out)
2018-05-11 10:54:13 -05:00
giannozz e31aa94fe1 Merge branch 'opt-init-rebase' into 'master'
Optimize initialization

See merge request QEF/q-e!6
2018-01-28 11:04:28 +00:00
Stefano de Gironcoli 4c0f7a2baf fft_set_nl and fft_set_nlm unified in a single routine. mill is optional output. 2018-01-24 07:31:29 +01:00
Ye Luo 0028de1a05 Save memory in ggen. 2018-01-18 15:06:33 -06:00
Paolo Giannozzi f950a749d8 Finally removed last remains of "custom" grid. The same two routines are used
to initialize G-vectors for all grids: one (ggen) to generate a new set of
G-vectors, one (ggens) to generate a subset of G-vectors with the same
ordering as in the original set.
2018-01-05 22:26:39 +01:00
Paolo Giannozzi 4ea5c0bda1 ggen no longer uses variables from module gvect: all g-vector related variables
are passed as arguments. Note that ngm is likely redundant since it is inside
the fft descriptor. Nothing should change apart from the call to ggen
2018-01-05 19:06:07 +01:00
Paolo Giannozzi 87890fb1c4 More "decustomization" of G-vectors: routine ggenx replaced by ggens 2018-01-05 10:23:42 +01:00
Paolo Giannozzi 4f67392dd5 Second step in G-vector generation reordering: subroutine "ggen" split into
two subroutines: "ggen" takes care of G-vectors for the FFT grid only,
"ggens" takes care of the subgrid only, with exactly the same ordering.
Seems to work, please verify
2018-01-04 11:42:42 +01:00
Paolo Giannozzi 54a1567bfa First attempt to unify the various ggen*: FFT descriptors are taken out from
modules and put in the call of ggen; case with no global sorting simplified
2018-01-03 19:23:22 +01:00
Carlo Cavazzoni 0488d218df - fix compilation of FFTXlib/test.f90
- replace ugly code lines with a pure funciton
2018-01-01 10:17:34 +01:00
Paolo Giannozzi aa3f5b1a19 More decustomizatio of custom FFT's: the FFT descriptor dfftt, together with
all unused or uselss variables, taken out of the exx_fft structure. Should
have no side effects but beware! especially for TDDFPT
2017-12-30 19:06:17 +01:00
Paolo Giannozzi 47b40a5065 Cleanup: removal of commented and no longer useful code 2017-12-27 20:52:38 +01:00
Carlo Cavazzoni 63f85f4e6f arrays: nl, nls, nlm, nlsm removed from recvec module, added to fft type 2017-12-24 00:31:22 +01:00
giannozz 7d6ef95ee1 __USE_3D_FFT wasn't working for hybrid functionals (it wasn't properly set
in the "custom" FFTs that are used in the calculation of V_x\psi). Cleanup: 
information on whether 3D FFTs are to be used is contained in variable
dfft*%lpara, set in initialization. In my opinion we could set lpara=.false.
always if the FFT is done on a single processor, get rid of __USE_3D_FFT.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13706 c92efa57-630b-4861-b058-cf58834340f0
2017-08-08 08:46:11 +00:00
giannozz 7dbaeca6b4 __USE_3D_FFT should work again (no warranty, please check)
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13700 c92efa57-630b-4861-b058-cf58834340f0
2017-08-07 13:06:37 +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
ccavazzoni 780f46c67f - separation of fft data type instances and scatter functions in different modules
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11813 c92efa57-630b-4861-b058-cf58834340f0
2015-10-29 09:08:16 +00:00
giannozz 857f524175 Bug in exx.f90 (courtesy of Simone Ziraldo): bad array copy if nopool=1,
plus minor things here and there 


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10335 c92efa57-630b-4861-b058-cf58834340f0
2013-06-25 13:30:44 +00:00
dalcorso 76af544935 Small corrections, mainly misleading routine names in error messages.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9377 c92efa57-630b-4861-b058-cf58834340f0
2012-08-25 14:16:17 +00:00
ccavazzoni e9c0710441 - remove conditional compilation pragmas
- add optional parameters to make ggen working with both local and global sorting.
  In particular:
  if no_global_sort is present (and it is true) G vectors are sorted only locally and not globally.
  In this case no global array should be allocated and sorted (saving memory
  and a lot of computational time for large systems).



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9302 c92efa57-630b-4861-b058-cf58834340f0
2012-08-15 14:29:43 +00:00
giannozz 4de42518ea No reason to have both __PARA and __MPI preprocessing options: they have the same meaning. __MPI is more explicit, so I am keeping it
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8572 c92efa57-630b-4861-b058-cf58834340f0
2012-02-02 22:12:26 +00:00
ccavazzoni 0322cf3811 - minor changes
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8317 c92efa57-630b-4861-b058-cf58834340f0
2011-12-11 08:19:19 +00:00
ccavazzoni 7b3f702464 - small fix
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8313 c92efa57-630b-4861-b058-cf58834340f0
2011-12-08 12:59:51 +00:00
ccavazzoni a777ee0a01 - adding preprocessing switch __LOWMEM to compile the code
using mamory saving features (for low memory machines).
  Sometime low memory stuff conflicts with other features,
  like wf_collect and, for the time being, I prefer
  to exclude them at compile time.
  


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8312 c92efa57-630b-4861-b058-cf58834340f0
2011-12-08 10:48:18 +00:00
giannozz ba577580bd G-vectors are generated using the same range of Miller indices used to
calculate the number of G-vectors and the dimension of G-vector arrays.
This should prevent mysterious errors in vc-relax. Harmless if the grid
dimensions are sufficiently large to accommodate all G-vectors; not sure
if they are not...beware unintended side effects


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7629 c92efa57-630b-4861-b058-cf58834340f0
2011-03-28 16:47:36 +00:00
giannozz 59617dd793 Almost final merge of G-vector generation between PW and CP:
- Grid dimensions for both dense and smooth grids are in Modules/griddim.f90
- Variables describing  G vectors and their mapping onto FFT grids (both
  dense and smooth) are in Modules/recvec.f90
- FFT descriptors are defined in Modules/fft_types.f90
- Variables describing G-vector distribution across processors are
  contained in Modules/stick_base.f90
- Distribution across processors of G vectors in sticks and planes
  is performed in Modules/stick_set.f90, routine pstickset, which
  also initializes FFT descriptors
- G vectors and their mapping onto FFT grids are calculated in
  Modules/recvec_subs.f90 (routine ggen: a modified version of PW one,
  replacing the CP one ggencp)
Testing is very limited but given the kind of modifications there should
be no major problem, I hope.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7384 c92efa57-630b-4861-b058-cf58834340f0
2011-01-05 16:04:54 +00:00