[CPMD-list] Vanderbilt PPs

Axel Kohlmeyer axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Thu Sep 12 12:54:58 CEST 2002


>>> "NM" == Natasa Mateljevic <natasa.mateljevic at yale.edu> writes:


NM> Hi,
NM> I am not sure if I am understanding you, do you mean that I have to 
NM> recompile the new version and then where do I put this FLAG in the 
NM> Makefile?So this problem has nothing to do with the Vanderbilt PPs, 
NM> because I thought that the problem was that I had to format those, since 
NM> they are unformatted.
NM> thanks,
NM> Natasa

hello natasa,

your problem is in fact two problems:
1.) you have misunderstood the concept of unformatted fortran i/o.
2.) you probably picked a set of pseudopotential files that does 
    not match your computer architecture. 

since this seems to become a FAQ, i will try to explain this in a more
general way so it can be copied into the q&a section of the
cpmd-webpage. 

1.)
Q:  what is formatted i/o?
A:
'formatted' fortran i/o means that you produce human readable
ascii-files. this is the normal output format.

'UNformatted' fortran i/o basically means that you write the contents
of your variables to a file by directly copying the memory contents into
the file (plus some information about the amount of data copied to the file).
as a result you get a file that is not directly readable, but your data
is stored in a very compact way.

this is NO WAY related to say formatting floppies or harddrives.

the downside of unformatted fortran i/o is that unformatted files are
not generally readable on all platforms since they depend on the 
size of the integers (32-bit or 64-bit) and the order in which the 
variables' contents are stored in memory, the byte-order. 

luckily most of the current (workstation) computers use 32-bit integers
and either little endian (x86, alpha) or big endian (ibm, hp, sun, sgi)
byte ordering. so you generally have to deal only with the byte
ordering. see 2.)

2.)
Q: I am trying to get CPMD to run using Vanderbilt PPs, and I cant get it to 
work no matter what I do. Here is the error I keep getting:
PGFIO-F-219/unformatted read/unit=22/attempt to read/write past end of 
record? 

A: vanderbilt pseudopotentials are stored in an unformatted (binary)
fortran file. since unformatted fortran files are generally not 
exchangeable between platforms (see 1.)) you have to either:

- pick the set of pseudopotential files suitable for your platform

- recreate the pseudopotential files for your platform

- recompile or modify your cpmd executable, so that reads (and writes)
  unformatted fortran files in the 'wrong' byte order. this is usually
  only a good idea if you have to run or distribute your jobs on
  machines with different byte ordering.
  for the pgi fortran compilers you can add the flag '-Mbyteswapio' to
  the definition of the FC variable in the makefile to achieve this effect.

i hope this helps. cheers,
  axel.


--

=======================================================================
Axel Kohlmeyer       e-mail: axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum                   http://www.theochem.ruhr-uni-bochum.de
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.



More information about the CPMD-list mailing list