jkitchin / jasp

python enhancements of ase.calculators.vasp
Other
27 stars 13 forks source link

NEB not working for larger unit cells? #28

Closed jboes closed 9 years ago

jboes commented 9 years ago

Having some trouble running NEB calculations with larger Au slabs, here is the code for one such slab (37Au atoms):

from jasp import *
from ase.neb import NEB
from ase.constraints import FixAtoms

# Working directory
DFTwd = 'DFT/group=kieth/slab=adatom/miller=100/config=1'

# Add relaxed start point image
with jasp(DFTwd + '/NEB=initial') as calc:
    atoms0 = calc.get_atoms()
images = [atoms0]

# Add four intermediate images based on lammps estimated starting points
for im in [2, 4, 5, 7]:
    atoms = read('./mg-geometries/NEBinitialcoords/adatom_100/adatom_100_0{0}.POSCAR'.format(im))
    constraint = FixAtoms(mask=[atom.position[-1] < 3 for atom in atoms])
    atoms.set_constraint(constraint)

# Add relaxed end point image
with jasp(DFTwd + '/NEB=final') as calc:
    atoms1 = calc.get_atoms()
images += [atoms1]

# Attempt to run NEB calculation
with jasp(DFTwd + '/NEB=full',
          xc='LDA',
          gga='PS',
          kpts=(3, 3, 1),
          encut=300,
          ibrion=2,
          isif=2,
          nsw=90,
          spring=-5,
          atoms=images) as calc:
    try:
        images, energies = calc.get_neb()
    except(VaspQueued, VaspSubmitted):
        pass

Which results in the following error:

Error when trying to run NEB calculation:
Traceback (most recent call last):
  File "<stdin>", line 98, in <module>
  File "/home-research/jboes/boes-python/jasp/jasp/jasp_neb.py", line 202, in get_neb
    self.run() # this will raise VaspSubmitted
  File "/home-research/jboes/boes-python/jasp/jasp/jasp_extensions.py", line 536, in run
    raise Exception('something went wrong in qsub:\n\n{0}'.format(err))
Exception: something went wrong in qsub:

qsub: Job rejected by all possible destinations

I've attempted this using anywhere from 1 to 8 intermediate images and in all cases I get the same result.

jkitchin commented 9 years ago

Can you set debug=logging.DEBUG in your calc and post what happens. On Feb 9, 2015 9:33 AM, "Jacob Boes" notifications@github.com wrote:

Having some trouble running NEB calculations with larger Au slabs, here is the code for one such slab (37Au atoms):

from jasp import * from ase.neb import NEB from ase.constraints import FixAtoms

Working directory

DFTwd = 'DFT/group=kieth/slab=adatom/miller=100/config=1'

Add relaxed start point imagewith jasp(DFTwd + '/NEB=initial') as calc:

atoms0 = calc.get_atoms()

images = [atoms0]

Add four intermediate images based on lammps estimated starting pointsfor im in [2, 4, 5, 7]:

atoms = read('./mg-geometries/NEBinitialcoords/adatom_100/adatom_100_0{0}.POSCAR'.format(im))
constraint = FixAtoms(mask=[atom.position[-1] < 3 for atom in atoms])
atoms.set_constraint(constraint)

Add relaxed end point imagewith jasp(DFTwd + '/NEB=final') as calc:

atoms1 = calc.get_atoms()

images += [atoms1]

Attempt to run NEB calculationwith jasp(DFTwd + '/NEB=full',

      xc='LDA',
      gga='PS',
      kpts=(3, 3, 1),
      encut=300,
      ibrion=2,
      isif=2,
      nsw=90,
      spring=-5,
      atoms=images) as calc:
try:
    images, energies = calc.get_neb()
except(VaspQueued, VaspSubmitted):
    pass

Which results in the following error:

Error when trying to run NEB calculation: Traceback (most recent call last): File "", line 98, in File "/home-research/jboes/boes-python/jasp/jasp/jasp_neb.py", line 202, in get_neb self.run() # this will raise VaspSubmitted File "/home-research/jboes/boes-python/jasp/jasp/jasp_extensions.py", line 536, in run raise Exception('something went wrong in qsub:\n\n{0}'.format(err)) Exception: something went wrong in qsub:

qsub: Job rejected by all possible destinations

I've attempted this using anywhere from 1 to 8 intermediate images and in all cases I get the same result.

— Reply to this email directly or view it on GitHub https://github.com/jkitchin/jasp/issues/28.

jboes commented 9 years ago
DEBUG      function: Jasp lineno: 173  Jasp called in /home-research/jboes/research/computational-materials/DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=full
DEBUG      function: Jasp lineno: 174  kwargs = {'kpts': (3, 3, 1), 'spring': -5, 'encut': 300, 'isif': 2, 'ibrion': 2, 'gga': 'PS', 'xc': 'LDA', 'nsw': 90}
DEBUG      function: Jasp lineno: 177  Entering NEB setup
DEBUG      function: read_neb_calculator lineno: 317  Entering read_neb_calculator in /home-research/jboes/research/computational-materials/DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=full
DEBUG      function: neb_initialize lineno: 374  [79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79
 79 79 79 79 79 79 79 79 79 79 79 79]
DEBUG      function: neb_initialize lineno: 374  [79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79
 79 79 79 79 79 79 79 79 79 79 79 79]
DEBUG      function: neb_initialize lineno: 380  [79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79
 79 79 79 79 79 79 79 79 79 79 79 79]
DEBUG      function: neb_initialize lineno: 383  Calculator cwd = /home-research/jboes/research/computational-materials
DEBUG      function: neb_initialize lineno: 384  Calculator vaspdir = DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=initial
DEBUG      function: neb_initialize lineno: 401  [79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79
 79 79 79 79 79 79 79 79 79 79 79 79]
DEBUG      function: neb_initialize lineno: 403  /home-research/jboes/research/computational-materials
DEBUG      function: neb_initialize lineno: 404  DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=final
DEBUG      function: Jasp lineno: 372  saving initial parameters
DEBUG      function: Jasp lineno: 381  {'precfock': None, 'system': None, 'prec': 'Normal', 'teend': None, 'gga': 'PS', 'algo': None, 'metaggaprec': None, 'tebeg': None}
DEBUG      function: vasp_changed_bands lineno: 105  Checking if vasp changed nbands
DEBUG      function: get_neb lineno: 96   Calculation is required
DEBUG      function: get_neb lineno: 97   DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=full
DEBUG      function: get_neb lineno: 201  Running on 0 nodes
DEBUG      function: run lineno: 516  DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=full will be the jobname.
DEBUG      function: run lineno: 518  -l nodes=0:ppn=1
DEBUG      function: run lineno: 527  qsub -joe -N DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=full -l walltime=168:00:00 -l nodes=0:ppn=1 -l mem=2GB
DEBUG      function: run lineno: 531  
#!/bin/bash
cd /home-research/jboes/research/computational-materials  # this is the current working directory
cd DFT/group=kieth/slab=adatom/miller=100/config=1/NEB=full  # this is the vasp directory
runjasp.py     # this is the vasp command
#end
Traceback (most recent call last):
  File "<stdin>", line 42, in <module>
  File "/home-research/jboes/boes-python/jasp/jasp/jasp_neb.py", line 202, in get_neb
    self.run() # this will raise VaspSubmitted
  File "/home-research/jboes/boes-python/jasp/jasp/jasp_extensions.py", line 536, in run
    raise Exception('something went wrong in qsub:\n\n{0}'.format(err))
Exception: something went wrong in qsub:

qsub: Job rejected by all possible destinations
jboes commented 9 years ago

Just a foolish mistake. Code does not append the intermediate images to the images array, resulting in no nodes being defined as a result since IMAGES=0

https://github.com/jkitchin/jasp/blob/master/jasp/jasp_neb.py#L427

Thanks for your help Prateek!