[Pw_forum] fix ions during relaxation / compile as a library?

Axel Kohlmeyer akohlmey at gmail.com
Fri Apr 5 13:47:44 CEST 2013


On Fri, Apr 5, 2013 at 1:09 PM, Denis Davydov <davydden at gmail.com> wrote:
> Dear Prof. Giannozzi, Dr. Paulatto
>
> thanks for your replies.
>

[...]

> my intention is to understand if it can be (from MPI point of view)
> sequentially combined with another parallel code (e.g. Lammps MD code).
> That is why I mentioned those C++ lines of MPI usage which
> take part of the given current communicator and (hypothetically)
> use them to create an instance of QE object.
>
> I know that QE is written in Fortran, but i read somewhere that
> at the very top level (say the main file) it's wrapped in C/C++,
> however, i can't find a confirmation to this in the sources.

it should not be that much of a stretch to do one by yourself. what
you'd need to do are roughly the following things:

- define a "world" module variable in the mp module that is
initialized by default to MPI_COMM_WORLD
- look for all places that use MPI_COMM_WORLD (or mpi_comm_world) and
replace it with that variable
- write a fortran 77 style mp_library_init function that is callable
from a C wrapper so it can initialize your "world" variable in the mp
module to the custom communicator that you have split off the world
communicator
- in the c wrapper you split the communicator and then translate it
into a fortran communicator using MPI_Comm_c2f()

at this point, you should be mostly set and only need to write a
suitable replacement for pwscf.f90
as you can see, it does things in a very similar matter than LAMMPS.

if you need more help with this, i am happy to collaborate. it would
probably only take me a few hours on a rainy sunday afternoon to get a
working prototype done. i've done similar things before and know a
little bit of both codes. ;-)

axel.



PROGRAM pwscf
  !----------------------------------------------------------------------------
  !
  ! ... Main program calling one instance of Plane Wave
Self-Consistent Field code
  !
  USE environment,       ONLY : environment_start, environment_end
  USE io_global,         ONLY : ionode, ionode_id, stdout
  USE mp_global,         ONLY : mp_startup
  USE read_input,        ONLY : read_input_file
  USE command_line_options, ONLY: input_file_
  !
  IMPLICIT NONE
  LOGICAL :: conv
  !
  !
  CALL mp_startup ( )
  CALL environment_start ( 'PWSCF' )
  !
  CALL read_input_file ('PW', input_file_ )
  !
  ! ... Perform actual calculation
  !
  CALL run_pwscf  ( conv )
  !
  CALL stop_run( conv )
  !
  STOP
  !
END PROGRAM pwscf





>
>
> Kind regards,
> Denis
>
>
>
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum



--
Dr. Axel Kohlmeyer  akohlmey at gmail.com  http://goo.gl/1wk0
International Centre for Theoretical Physics, Trieste. Italy.



More information about the users mailing list