Git Product home page Git Product logo

Comments (5)

jkitchin avatar jkitchin commented on August 19, 2024

It looks a little trick to get vasp to run in parallel outside of the queue. Here are a few ways you could try it.

  1. You could try this with the runvasp.py script you listed above:
    VASPRC['mode'] = 'run'
    VASPRC['vasp.executable.serial'] = 'runvasp.py'

Another approach is:
2. You can set an environment variable for PBS_NODEFILE that points to a file containing 4 lines.
and VASPRC['mode'] = 'run'

  1. in vasp.py, comment out the line "import runner"
    Then set the environment variable ASE_VASP_COMMAND to runvasp.py as you outlined above.

  2. Make a new python module and import it to monkey patch the calculate function. This is what runner.py does.

from monkeypatch import monkeypatch_class
@monkeypatch_class(vasp.Vasp)
def calculate(self, atoms=None, properties=['energy'],
              system_changes=None):
    # insert code that runs your code here.

from vasp.

MAHines avatar MAHines commented on August 19, 2024

Thanks! The solution is indeed easy, and your reply got me off on the right track. The first step is to define the runvasp.py script in my original message. The second step is to use the runvasp.py script as the serial executable. (Duh. Sort of obvious.) For future Mac users, this is easily done by changing one line in the distributed vasprc.py:

vs = '/Users/mah/anaconda/envs/aseNew/bin/runvasp.py'

The calculator now runs the serial program that runs the parallel process.

To avoid having to add the "Vasp.vasprc(mode='run')" line to each script, the default 'mode' setting should be changed in vasprc.py as follows:

VASPRC = {'vasp.executable.serial': vs,
          'vasp.executable.parallel': vp,
          'mode': 'run',  # other value is 'queue'
          'queue.command': 'qsub',
          …

Melissa

from vasp.

MAHines avatar MAHines commented on August 19, 2024

Following up on this thread, I think there may be a small naming issue. Suppose you want to switch between different versions of VASP (e.g., std and gam). One logical way to do this would be to change the entry in VASPRC as follows:

Vasp.vasprc(vasp.executable.serial="/Users/mah/anaconda/envs/aseNew/bin/runvasp_gam.py")

Unfortunately, this leads to the following error:

File "Molecular_XPS_Shifts.py", line 54
    Vasp.vasprc(vasp.executable.serial="/Users/mah/anaconda/envs/aseNew/bin/runvasp_gam.py")
SyntaxError: keyword can't be an expression

The issue are the two periods in 'vasp.executable.serial' as described here:

http://stackoverflow.com/questions/17810927/syntaxerror-keyword-cant-be-an-expression-while-creating-a-dictionary

One fix would be to rename the keys to 'vasp_executable_serial' and 'vasp_executable_parallel'.

from vasp.

jkitchin avatar jkitchin commented on August 19, 2024

VASPRC is a dictionary.

so you should do something like this:
from vasp.vasprc import VASPRC
VASPRC["vasp.executable.serial"]="/Users/mah/anaconda/envs/aseNew/bin/runvasp_gam.py"

vasp.vasprc is not callable like you are trying to do.

from vasp.

MAHines avatar MAHines commented on August 19, 2024

Thank you for your reply. I know VASPRC is a dictionary. In your reply to zezhong-zhang from a few days ago, you suggested calling Vasp.vasprc directly:

from vasp import Vasp
Vasp.vasprc(mode='run')

This is a minor issue, and your suggestion above also works.

from vasp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.