Skip to content

Latest commit

 

History

History
269 lines (205 loc) · 7.53 KB

File metadata and controls

269 lines (205 loc) · 7.53 KB

Atomic Simulation Environment (ASE) INSTALLATION

\doublespace

\maketitle

Requirements

Python 2.7, 3.4-3.7

Install Anaconda 3.7 version in your system.

$ wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
$ sh <filename.sh>

The new version of Python 3.8 might not be compatible to John Kitchin’s VASP. Install Python 3.7.3

$ conda install python=3.7.3 anaconda=custom

ASE

Install ASE using PIP

$ pip install --upgrade --user ase

Also, this new verson of ASE might not be compatible to John’s VASP. Install ASE 3.16.0. Get the ase.tar.gr file from the group memeber and upload it to the CRC.

Unpake tar-file.

tar -xf ase-3.16.0.tar.gr

Add ~/ase to PYTHONPATH environment variable and add ~/ase/bin to PATH (assuming ~/ase is where ASE folder is).

Environment variables

bashrc

Add PATH and PYTHONPATH for ASE in your bashrc.
Modify your bashrc via text editor such as vi or emacs.\ In your home directory, type this command. Here I use emacs.

emacs ~/.bashrc

This is an example of bashrc from Prateek. If you want to use this bashrc file, you have to replace user information with yours. Also it has some aliases for your convenience.

#Check http://crc.nd.edu/wiki for login problems
#Contact crcsupport@nd.edu if further problems

if [ -r /opt/crc/Modules/current/init/bash ]; then
        source /opt/crc/Modules/current/init/bash
fi

PS1="[\u@\h:\W]$ "

#Additional aliases

#Additional modules

module load texlive
module load vasp/5.3.5
module load emacs

#ASE
export PYTHONPATH=/afs/crc.nd.edu/user/j/jcrum/.local/lib/python3.7/site-packages/:$PYTHONPATH
export PATH=/afs/crc.nd.edu/user/j/jcrum/.local/lib/python3.7/site-packages/ase/tools:$PATH

# VASP
export VASP_PP_PATH=/afs/crc.nd.edu/user/w/wschnei1/Group/new_POTCARs/
export PYTHONPATH=/afs/crc.nd.edu/user/j/jcrum/vasp:$PYTHONPATH
export PATH=/afs/crc.nd.edu/user/j/jcrum/vasp/bin:$PATH

#Anaconda
export PATH=/afs/crc.nd.edu/user/j/jko1/anaconda3/bin:$PATH

VASP

downlaod vasp

You can download vasp thrugh Prateek’s github page. It is similar to John’s original vasp wrapper, but patched to work with the Notre Dame job submission engine. You should compare John’s version and this version to see how they are different.

$ git clone https://github.com/jtcrum/vasp.git

go to the vasp folder, then switch to SLURM-py3 branch.

$ git checkout SLURM-py3

You can see this message.

Branch SGE-py3 set up to track remote branch SGE-py3 from origin.
Switched to a new branch 'SGE-py3'

vasprc

Like bashrc, we need a configuration file for submitting a job to server.
In your home directory, type this to make the vasprc

emacs -nw ~/.vasprc

Then copy and paste this content.
Note that you need to change user name and email!

# adjust these for the your system

vasp.executable.serial = vasp
vasp.executable.parallel = vasp

user.name = jcrum
user.email = jcrum@nd.edu


mode = queue   # run|queue|None

multiprocessing.cores_per_process = None


# these are only needed if you run in a queue. Setting a few defaults here. SGE needs nprocs, q, pe.

scheduler = SGE
queue.shell= bash
queue.command = qsub
queue.options = -j y
queue.time = 168:00:00
queue.nodes = 1
queue.ppn = 1
queue.nprocs = 4
queue.mem = 2G
queue.jobname = None
queue.q = *long
queue.pe = smp
vdw_kernel.bindat = /afs/crc.nd.edu/x86_64_linux/vasp/5.3.5/ompi1.6.3/vdw_kernel.bindat
module=vasp/5.4.1[jcrum@crcfe01:vasp]$

Using the ASE VASP Calculator

Here I will show you how to use the built in Vasp calculator with ASE. There is a little bit of set up required.

Step 1:

Put the run_vasp.py somewhere in your work space. An example of run_vasp.py is:

#!usr/bin/env python3
## Import Libraries
import os
import subprocess
import sys
from ase.io import read,write

## Define Node, Parallelization Method and Number of Cores
q = '*@@schneider_q16copt'
pe = 'mpi-64'
nprocs =' 64'

## Construct qscript file
cwd = os.getcwd()
script = """#!/bin/bash
module load vasp
cd {cwd}
mpirun -np {nprocs} vasp_neb
#end """.format(**locals())

## Create qscript file
qscript=os.path.join(cwd,'qscript')
f = open(qscript,'w')
f.write(script)
f.close()


## Submit job
cmdlist = 'qsub -o {0} -j y -N {1} -q {2} -pe {3} {4} qscript'.format(cwd,cwd.split('/')[-1],q,pe,nprocs)

os.system(cmdlist)

In the run_vasp.py file you can change two variables depending on how you want to submit jobs.

q = ‘*@@schneider_q16copt’

change this to the queue you want to submit to

pe = ‘mpi-64 64’

change this to the parallel enviornment you want to use

Step 2:

Add the following lines to your .bashrc:

export VASP_SCRIPT=~/path/to/run_vasp.py
export VASP_PP_PATH=~/path/to/POTCARs

Step 3:

Here we have to modify the ase code a little bit. If you update ase these changes will go away. Luckily I have this reference sheet for you, so you can go back and fix it. Edit vasp Calculator Files

The location of these files will depend on how you installed ASE, but if you installed it the way the website recomends the files will be in:

~/.local/lib/python3.x/site-packages/ase
  • ase/calculators/vasp/create_input.py
    • line 1070: change ‘lda’ to ‘pbe’, the original line states:
      p.update({'pp': 'lda'})
              
  • ase/calculators/vasp/vasp.py
    • comment out lines 330 & 331, these lines state:
      self.update_atoms(atoms)
      self.read_results()
              

Scimax

Scimax is really helpful for us to use ASE as well as write some documents.
I put Dr. Kitchin’s (CMU) description of scimax. \begin{mdframed} Scimax is an Emacs starterkit designed for people interested in reproducible research and publishing. Scimax is just Emacs that has been configured extensively to make it act like we need it to for research documentation and publication. \end{mdframed} You can download scimax from Dr. Kitchin’s github

git clone https://github.com/jkitchin/scimax.git

Miscellaneous