Commit Graph

101 Commits

Author SHA1 Message Date
ccavazzoni 5caf0e28d8 - interface with LAMMPS was broken in 6.2
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@14007 c92efa57-630b-4861-b058-cf58834340f0
2017-11-25 13:42:37 +00:00
giannozz 63e02d8760 Option "-in file" for fermi_proj.x and fermi_velocity.x was not working in
serial execution. Added comment explaining that mp_startup reads the command 
line. Example fermisurfer_example/ was cited in the doc but was missing.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13986 c92efa57-630b-4861-b058-cf58834340f0
2017-11-10 15:05:24 +00:00
giannozz dd0f35c25d Misplaced routine closing MPI communicators could cause harmless but annoying
messages to be issued at the end of the run


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13834 c92efa57-630b-4861-b058-cf58834340f0
2017-09-08 16:31:17 +00:00
paulatto 487d4146d7 Added cleaning of orthpools (used in exx) with a subroutine that only releases the communicators if they had been initialized.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13766 c92efa57-630b-4861-b058-cf58834340f0
2017-08-24 14:55:40 +00:00
degironc 24ac62a598 cleanup of unused veariables
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13693 c92efa57-630b-4861-b058-cf58834340f0
2017-08-06 06:05:34 +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
degironc 1b33777cbd remove some timing printing.
intra_pool_comm (the parent_comm of intra_bgrp_comm) should be the first argument
of set_mpi_comm_4_XX routines.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13645 c92efa57-630b-4861-b058-cf58834340f0
2017-07-29 19:48:15 +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
degironc 3e20b43121 a problem with world_comm that was referenced in mp_global in
an obscure way solved.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13638 c92efa57-630b-4861-b058-cf58834340f0
2017-07-28 12:32:24 +00:00
degironc 641fa9223f further minor simplification.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13636 c92efa57-630b-4861-b058-cf58834340f0
2017-07-28 02:30:21 +00:00
degironc bcdae84e09 initialization of the distributed linear algebra parallelization level simplified.
mp_start_diag only needs the parent communicator !  
The other quantities needed to initialize correctly SCALAPACK blacs quantities 
are obtained from mpi calls involving MPI_COMM_WORLD.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13635 c92efa57-630b-4861-b058-cf58834340f0
2017-07-28 02:13:50 +00:00
ccavazzoni 2e82a042bd - adding the possibility to restore "old" band parallelization in CP
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13372 c92efa57-630b-4861-b058-cf58834340f0
2017-03-03 09:09:47 +00:00
giannozz fb026749de New band parallelization for EXX, contributed by Taylor Barnes et al.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13290 c92efa57-630b-4861-b058-cf58834340f0
2017-02-07 17:39:25 +00:00
paulatto 631d9d1baa New series of communicators, which are orthogonal to the pools (hence the name "orthopools"), each orthopool contain the CPUs with the same rank from all pools
Only used in EXX, but I put it here as it is quite general purpose



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13118 c92efa57-630b-4861-b058-cf58834340f0
2016-10-25 09:37:19 +00:00
ccavazzoni 6ab6d4765f - call to init_diag made more clear, hopefully..
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12267 c92efa57-630b-4861-b058-cf58834340f0
2016-03-29 21:26:11 +00:00
ccavazzoni ecbacec840 - generalization of mp_diag, removing dependencise from the communicator hierarchy,
it just needs to know how many group and a different id for each grop.
- On some MPI the previous band/diag parallelization was not working properly
- further chack are needed


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12237 c92efa57-630b-4861-b058-cf58834340f0
2016-03-23 06:14:26 +00:00
degironc 1e68dc9e4c linear algebra parallelization made independend of its parent communicator by
introducing ortho_parent_comm to be used when addressing the whole group.
linear algebra is now distributed (in PW) inside the pool group (in CPV is left unchanged... are there pools in CPV?). 
mp_global sets ortho_comm as a sub-communicator of intra_pool_comm (used to be intra_bgrp_comm). It can be reverted 
to previous choice by commenting/uncommenting one line

tested on PW/example02 co.rx.in case (both Gamma and K=(000)) with 
  -np 8 -nd 4 -nb 2
that is using 2 bgrp (procs 0123 and 4567) and diagonalizing on 4 procs (0246).
tested also on 
  -np 4 -nd 4 -nb 2
that is using 2 bgrp (procs 01 and 34) and diagonalizing on 4 procs (0123).

some bgrp parallelization added to a few routines. global variables (evc,..) are NOT distributed but some local ones
are and more could be done.




git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11863 c92efa57-630b-4861-b058-cf58834340f0
2015-11-23 00:50:43 +00:00
degironc 92912d8153 band group parallelization slightly modified to make it more flexible, and little
more efficient.

 subroutine init_index_over_band ( comm, nbnd ) that set ibnd_start and ibnd_end
variables requiring comm=inter_bgrp_comm is removed and replaced by
 subroutine set_bgrp_indices ( nbnd, ibnd_start, ibnd_end ) implementing the same
relationships between its arguments but:
 
 - forcing the use of inter_bgrp_comm from the same mp_bands module,

 - returning ibnd_start and ibnd_end as explicit outputs that are not anymore kept
in the module. In this way other quantities can be distributes if needed in any 
given routine without too many non-local effects.

 For compatibility with TDDFPT, that uses the bgrp parallelization and loads
ibnd_start/ibnd_end trhough mp_global module, these two variables are moved in 
a dedicated module mp_bands_TDDFPT included in Module/mp_bands.f90. This is done
to avoid too much invasive changes in a code i don't know well. In this way the 
needed changes are very localized and transparent, the code compiles correctly 
so I think it should work exactly as before. 
In my opinion the two variables should be moved somewhere inside TDDFPT.

 Band parallelization is extended to h_psi(lda,n,m,psi,hpsi) and s_psi routines 
(only when .not.exx_is_active because otherwise it is already used inside vexx)
for generic values of m (of course it gives a speedup only when m is not too small
compared to nbgrp but it works also if m < nbgrp ).

 Compatibility with task groups has not be explored but should not be conceptually
different from how it works in the exx case.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11835 c92efa57-630b-4861-b058-cf58834340f0
2015-11-07 00:06:40 +00:00
giannozz 03d8985312 "pot" parallelization level, no longer used, is removed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11688 c92efa57-630b-4861-b058-cf58834340f0
2015-08-20 17:29:18 +00:00
degironc 8d323fa10e set correctly the communicator for mp_start_pools to intra_pot_comm
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11272 c92efa57-630b-4861-b058-cf58834340f0
2014-11-17 17:15:53 +00:00
giannozz 266db1ed8f Safer cleanup of "ortho" communicators. Does not seem to clean communicators
used by scalapack, though


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10677 c92efa57-630b-4861-b058-cf58834340f0
2014-01-12 08:28:19 +00:00
giannozz f55fbe392a Cleanup of the parallel part: check if mpi is initialized moved from
mp.f90 to mp_world.f90, interface mp_comm_free used instead of direct
call to mpi_comm_free, deallocation of communicators. Should be harmless
but please check.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10649 c92efa57-630b-4861-b058-cf58834340f0
2013-12-28 09:29:14 +00:00
giannozz 3fcc01b467 Variables for task group (actually a single one) moved to where it belongs
(I think): mp_bands.f90 . Many changes but nothing dangerous. Note that 
codes not in svn may be broken by this change, but the fix is very simple


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10567 c92efa57-630b-4861-b058-cf58834340f0
2013-11-03 19:16:37 +00:00
giannozz 95600c8582 More cleanup of parallel modules: mp_global no longer contains references to
variables for the "world" MPI communicator. The latter are to be found in 
world_comm instead. mp_global should be used only to start and to end the
various parallelization levels. Many small but harmless changes: a few 
variables removed or moved to another module in most cases.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10558 c92efa57-630b-4861-b058-cf58834340f0
2013-10-27 09:09:10 +00:00
giannozz 44e7c93042 References to mp_global replaced by references to specific modules for
each parallelization level - should be done elsewhere, mp_global is just
a compatibility layer


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10513 c92efa57-630b-4861-b058-cf58834340f0
2013-10-07 08:10:00 +00:00
ccavazzoni 68d56dfcf2 - commit of Axel patches to remove dependencies form mpi_world_comm
and to setup blacs grid accordingly



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10480 c92efa57-630b-4861-b058-cf58834340f0
2013-09-26 15:47:31 +00:00
giannozz b76c962d0f Changes to MPI initialization suggested by Axel in order to make gluing with
QMMM easier


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10475 c92efa57-630b-4861-b058-cf58834340f0
2013-09-23 12:57:14 +00:00
giannozz db3a37a92a Clearer comment
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10453 c92efa57-630b-4861-b058-cf58834340f0
2013-09-16 08:20:10 +00:00
giannozz 957bf3fdff More useless calls (and now useless module) removed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9896 c92efa57-630b-4861-b058-cf58834340f0
2013-01-29 16:55:59 +00:00
giannozz 6eba93692f Oops ...
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9887 c92efa57-630b-4861-b058-cf58834340f0
2013-01-29 11:39:12 +00:00
giannozz c955629ae7 Cleanup of new initialization + restored missing in action ntask_group
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9885 c92efa57-630b-4861-b058-cf58834340f0
2013-01-29 10:31:17 +00:00
giannozz aca32a501a Module mp_global split into more modules, one per parallelization level.
Module mp_global is still there for compatibility and still contains the
routine mp_startup that performs the intialization, but shouldn't be any
longer used in new developments and should be slowly replaced by specific
modules. New module containing command-line options added. Command-line
options are read at the beginning of the run and broadcast to all processors
(there is no guarantee that command-line options cam be accessed by all mpi
 processes). Nothing should be broken by these changes but please verify if
all parallelization levels work (I have limited access to parallel machines
right now)

The reason for these changes, and for those that will come soon, is to make
image parallelization easier (in particular in NEB but also for other cases). 
Right now it is a pain, in part because the initialization is inadequate,
in part because it is never clear who reads/writes what from/to where.
It will take a few weeks before everything converges to a stable state.
Meanwhile, please be patient and fix/report problems.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9876 c92efa57-630b-4861-b058-cf58834340f0
2013-01-28 09:21:12 +00:00
giannozz 8b4316bdc1 Cleanup of unused variables and routines; some comments updated.
Note that this comit will break compilation of GWW


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9835 c92efa57-630b-4861-b058-cf58834340f0
2013-01-22 11:07:54 +00:00
giannozz 652f460dfa There is no reason to have command-line options so looooong. I have introduced
a few shorthands (-i, -ni, -nk, -nb, -nt, -nd) with obvious meaning and updated
the documentation. The old syntax will still work. Cleanup of routines catching
command-line options. More serious cleanup of the entire stuff is anyway needed


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9819 c92efa57-630b-4861-b058-cf58834340f0
2013-01-19 21:52:32 +00:00
giannozz 53a26ef521 Cleanup, removal of unused routines, comments added or corrected
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9810 c92efa57-630b-4861-b058-cf58834340f0
2013-01-19 15:02:11 +00:00
giannozz de90279f2a Initialization of parallel stuff slightly simplified. Routine mp_global_start
was doing something not really correct: initializing the all-processor group
(mpi_comm_world or whatever it is called) with an image. Now variables root,
world_comm, mpime, nproc are those for the world group and not for an image. 
This has no consequences at all if images are not used. It shouldn't have any
consequences for codes using images as well (neb, ph, gipaw), because those
variables are not used in practise. If it has, the correct way to fix it is to
remove inappropriate usage of those variables


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9804 c92efa57-630b-4861-b058-cf58834340f0
2013-01-18 17:59:12 +00:00
giannozz 9059e5b9fb No reason any longer to have "_new" at the end of "mp_global_start",
since there is just one such routine


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9793 c92efa57-630b-4861-b058-cf58834340f0
2013-01-17 20:43:55 +00:00
giannozz 0eb7f81280 mp_startup is a wrapper that calls mp_startup_new; mp_global_start removed.
To be verified, in particular phonon with images.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9495 c92efa57-630b-4861-b058-cf58834340f0
2012-10-08 16:31:09 +00:00
dceresoli 72a7216b3c Rstoring the PRIVATE.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9378 c92efa57-630b-4861-b058-cf58834340f0
2012-08-27 08:50:56 +00:00
dceresoli d11b54f801 write_para has more parameters now.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9373 c92efa57-630b-4861-b058-cf58834340f0
2012-08-24 13:41:29 +00:00
dalcorso 408d910acf Information on the newer parallelization levels saved on file by pw.x. ph.x
now stops if ntask_groups > 1. 


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9362 c92efa57-630b-4861-b058-cf58834340f0
2012-08-23 08:35:26 +00:00
ccavazzoni 8f45a57cd6 - new ortho row/col communicators to be used
for lambda/bec linar algebra computations


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9229 c92efa57-630b-4861-b058-cf58834340f0
2012-07-26 15:37:23 +00:00
ccavazzoni 79c88b83e2 - yet another communicator, between images and pools, to parallelize
over perturbations in linear response codes like recomb
  Contributed by Marco Govoni


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9034 c92efa57-630b-4861-b058-cf58834340f0
2012-05-25 06:45:54 +00:00
giannozz f2c634775c The -ndiag 1 or -northo 1 command-line option is no longer ignored by
ScaLAPACK. If you want the ScaLAPACK default (nproc/2), do not specify 
-ndiag or -northo . Untested!


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8885 c92efa57-630b-4861-b058-cf58834340f0
2012-04-13 10:55: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
marsamos a6f4ddfba8 add distribution band index in mp_global.f90
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8298 c92efa57-630b-4861-b058-cf58834340f0
2011-12-05 11:04:52 +00:00
marsamos 09f29d3ea0 forgot write(0,*) in mp_global.f90
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7598 c92efa57-630b-4861-b058-cf58834340f0
2011-03-23 12:43:56 +00:00
marsamos fee627a67e image dependency eliminated from init_ortho_group. I have testd on 8 proc.
More tests are welcome.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7595 c92efa57-630b-4861-b058-cf58834340f0
2011-03-23 09:57:54 +00:00
ccavazzoni df835710ea - more flexible groups creation
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7523 c92efa57-630b-4861-b058-cf58834340f0
2011-02-27 18:06:48 +00:00
giannozz 57eee32422 meta_ionode and meta_ionode_id were initialized but not correctly used in
startup
 CVS: ----------------------------------------------------------------------


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7449 c92efa57-630b-4861-b058-cf58834340f0
2011-01-27 11:55:30 +00:00