Computational Lab 2
VASP tutorial through calculation of Pt32
Click here to go back to Lab 2Directory set up
In your home directory create a directory titled "lab2".
Go to home directory with cd ~
.
Create a the lab2 directory with mkdir lab2
Copy over the directory which contains all prepared files for you to your lab2 directory.
cp -r /home/fri/lab_files_2022/lab2/pt32 ~/lab2/
Job set up and submission
You need 5 files (KIPPs) to run a VASP job: KPOINTS INCAR POSCAR POTCAR .sub . Here your .sub file is named "frilab.sub". These files are all provided. You can find them in the directory you just copied over.
Click here to read more about what each of the files are for.
KPOINTS: Don't change this file and try to ignore it. To understand what it does requires some knowledge of solid state physics. Trying to read about it may cost you more time you can afford so handle your curiosity with caution!
INCAR: It has a list of tags which indicates the calculations details. In this case, a maximum of 200 iterations are requested (NSW tag) to minimize (IBRION tag) a particle until the force on any atom is less than 0.005 eV/Ang (EDIFFG tag). You can ignore the other tags for now. The 'more file ' command allows you to look at a file's contents.
POSCAR: It has the initial coordinates of the atoms in your system. You can view the coordinates directly with vim or you can use a molecular viewer ag POSCAR
or xyz POSCAR
. A more detailed description of each line's significance can be found here
POTCAR: It has parameters for how to simulating each element. DO NOT EDIT THIS FILE YOURSELF! ONLY USE THE SCRIPT GIVEN TO YOU FOR MAKING AN CORRECT POTCAR! In this case, the only element is Pt. To see what elements are contained in it, use command grep PAW POTCAR
Go to your pt32 directory and edit the sub file and chage the jobname to something informative. For example, "Pt32".
Go to your job directory: cd ~/lab2/pt32/
Open frilab.sub with vim: vi frilab.sub
Look for the line "#$ -N JobName", change "JobName" to "Pt32"
sbatch slurm_fri.sub
There is more information about this file on our Queuing system page.
Wait for 10 seconds, then use
mj
to check the status of your job. Status
r
means that your job is running.
qw
means that job is in queue.
To see where you stand in the line, use squeue
to show jobs of all users. In most cases, jobs listed above yours will run before yours do if their job status is qw
.
eqw
means that there is an error in the job.
JobID being the first number shown in the line of the job entry, followed by job name
Email the error message to Ray, then delete your job with qdel jobid
Post submission analysis
If mj
shows no job for you, that means your jobs are finished or dead. Check if your job is converged.
If your job finished, check if it is converged with vef.pl
in your job directory.
vef.pl
will read your OUTCAR and output (step number, force, total energy, energy change from step 0). Look at the force of the last step, if it's smaller than your convergence criteria (EDIFFG parameter in your INCAR), your job is converged. The total energy of the last step (last line) can be used for later analysis.
xyz XDATCAR
. It's important to always check your XDATCAR. If the simulation runs but is unphysical, this is a quick way to spot it. If your job has converged, then the total energy, which is recorded in fe.dat created by vef.pl, can be used for analysis such as calculating cohesive energies.
If your job has not converged and fe.dat shows 199 steps (if your INCAR NSW=200), your job simply needs to run longer.
Wrap up your job with vfin.pl run#
where run# starts with run0. The second time you run vfin.pl, run# should be run1. The third time run3, etc.
vfin.pl run#
will archive everything from your previous run into run# so it's stored and compressed. It also updates your POSCAR with the new CONTCAR you got from the previous run.
If your job run for some steps but not 199, you can still continue with the same procedures above.
If vef.pl returns nothing, your job didn't run. Resubmit your job. If vef.pl still returns nothing, your job has an error. Email Ray the path to your job.
Utility of your results
Now that your calculation has finished, you can:
- You can visualized the relaxed/optimized structure with
ag CONTCAR
. -
You can calculate the cohesive energy of this particle, after you also get the energy of your reference. You'll do this when you run your Pt1 calculation.
An important property of nanoparticles is their cohesive energy, which is the total energy required to separate the atoms from one another. The energy you have calculated is close to, but not exactly the cohesive energy. To get the cohesive energy, we need the energy of a single isolated atom.