ABINIT/m_wffile [ Modules ]

This module provides the definition of the wffile_type used to WF file data.
As the type contains MPI-dependent fields, it has to be declared in a MPI-managed directory.

COPYRIGHT

Copyright (C) 2009-2018 ABINIT group (MT,MB,MVer,ZL,MD)
This file is distributed under the terms of the
GNU General Public License, see ~abinit/COPYING
or http://www.gnu.org/copyleft/gpl.txt .
For the initials of contributors, see ~abinit/doc/developers/contributors.txt.

PARENTS

CHILDREN

NOTES

wffile_type : a handler for dealing with the IO of a wavefunction file

m_wffile/rwRecordMarker [ Functions ]

Read/Write a record marker in a FORTRAN file at a given file pointer position.
This is needed to access data in a FORTRAN file with MPI/IO.

INPUTS

option=1 for reading by current proc
2 for writing by current proc
3 for reading by all procs
4 for writing by all procs
posit= position of the MPI/IO file pointer
wff=<type(wffile_type)>=structured info for reading/writing
Use here only:
wff%fhwff= handle of the MPI/IO file
wff%nbOct_recMarker= length of Fortran record markers

OUTPUT

ierr= error code

SIDE EFFECTS

posit= position of the MPI/IO file pointer
updated after the reading (with the length of the record)
recordmarker= content of the record marker

m_wffile/wffile_type [ Types ]

This structure datatype is a handler for dealing with the IO of a
wavefunction file.
It contains, among other things, the method of access to the file
(standard F90 read/write, or NetCDF call, or MPI IO), the unit number
if applicable, the filename, the information on the
parallelism, etc ...

m_wffile/WffReadWrite_mpio [ Functions ]

This procedure read or write cg in the file _WFK using MPI_IO
when cg are dispatched amoung commcart communicator

INPUTS

wff=struct info for wavefunction
nband_disk=number of bands on disk files to be write
icg=shift to be given to the location of the cg array
mcg=second dimention of cg
mpi_enreg=information about parallelisation
depl_mpi_to_seq=for each proc, index of cg in sequential mode
npwso=npw*nspinor number of plane waves treated by this node.
npwsotot=npwtot*nspinor Total number of planewaves Used to calculate the size of data to be written.
rdwr=1 if reading, 2 if writing

cg is written like the following:
BeginMarker cg ( iband = 1 ) EndMarker
BeginMarker cg ( iband = 2 ) EndMarker
...
BeginMarker cg( iband = nband_disk ) EndMarker
BeginMarker and EndMarker give the value of the total length of cg for one band
For MPI-IO library the performance is improved by the use a "view" of the file for each proc.

m_wffile/WffWriteNpwRec [ Functions ]

wff= structured info about the wavefunction file
nband_disk=number of bands
npw=number of plane waves
nspinor=number of spinorial components of the wavefunctions
opt_paral=(optional argument, default=1, only used for MPI-IO)
1: all procs in the communicator write the data
2: only master in the communicator writes the data

m_wffile/xdefineOff [ Functions ]

formeig option (format of the eigenvalues and occupations) :
0 => ground-state format (initialisation of eigenvectors with
random numbers, vector of eigenvalues, occupations are present)
1 => respfn format (initialisation of eigenvectors with 0 s,
hermitian matrix of eigenvalues)
nkpt = number of k points
nspinor = total number of spinorial components of the wavefunctions
nsppol = number of channels for spin-polarization (1 or 2)
nband(nkpt*nsppol) = number of bands at each k point, for each polarization
npwarr(nkpt) = number of planewaves at each k point
mpi_enreg <type(MPI_type)> = information about MPI parallelization