Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ensemble-learning committed Nov 3, 2014
1 parent 0c95287 commit b41e0b2
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/cons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Atom number - Atom name map
ELEMENT = {1:"H", 3:"Li", 6:"C", 7:"N", 8:"O", 9:"F", 12: "Mg", 13: "Al", 14:"Si",
15:"P", 16:"S", 17:"Cl", 20:"Ca", 22:"Ti", 31:"Ga", 32:"Ge"}
15:"P", 16:"S", 17:"Cl", 20:"Ca", 22:"Ti", 28:"Ni", 31:"Ga", 32:"Ge"}
# Atom name - Atom number map
ELEMENT2ATN = {"H":1, "Li":3, "C":6, "N":7, "O":8, 9:"F", "Na":11, 12: "Mg", "Al":13, "Si":14,
"P":15, "S":16, "Cl":17, "Ca":20, "Ti":22, "V":23,"Ni":28, "Pt":78, 32:"Ge", "MO":42, "Mo":42,
Expand Down
3 changes: 2 additions & 1 deletion tools/Lammps/lammps_eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
for j in lines:
o.write(j)
o.close()
shutil.copy("../min.rst", ".")
if os.path.exists("../min.rst"):
shutil.copy("../min.rst", ".")
shutil.copy("../ffield", ".")
os.chdir("..")
9 changes: 5 additions & 4 deletions tools/Lammps/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#pair_style reax/c control
#pair_style reax/c NULL lgvdw yes
pair_style %reax_potential%
pair_style %reax_potential% safezone 1.8 mincap 180
#----Neighbor Section----#
Expand Down Expand Up @@ -108,22 +108,23 @@
#--------Output info--------
thermo 400
thermo_style custom step etotal ke pe temp press vol v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq cella cellb cellc cellalpha cellbeta cellgamma
thermo_style custom step etotal ke pe temp press vol v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq cella cellb cellc cellalpha cellbeta cellgamma pxx pyy pzz
thermo_modify line multi
dump 100 all custom 400 dump.lammpstrj id type x y z vx vy vz
dump_modify 100 sort id
dump 101 all cfg 400 dump.*.cfg mass type xs ys zs vx vy vz fx fy fz
dump_modify 101 element %elements%
dump_modify 101 element %elements% sort id
#--------Analysis-----------
fix 200 all reax/c/bonds 400 bonds.reax
#fix 200 all reax/c/bonds 400 bonds.reax
#fix 201 all reax/c/species 1 1 400 species.out
#--------Simulation--------
velocity all create 300.0 4928459 rot yes dist gaussian
restart 40000 restart_*.rst
fix 401 all nvt temp 300 300 50
timestep 0.25
run 80000
Expand Down
85 changes: 85 additions & 0 deletions tools/pbs/exLammps
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env python

"""
Generate pbs script for LAMMPS calculation on HPC.
exLAMMPS ncpu
"""

import sys
import os
import shutil

INP = """#!/bin/bash
#PBS -A ONRDC33663C5T
#PBS -V
#PBS -j oe
#PBS -N LAMMPS
#PBS -q challenge
#PBS -l select=%nnode%:ncpus=32:mpiprocs=32
#PBS -l walltime=168:00:00
export LAMMPSLOC=/u/taocheng/SOFT/lammps-1Feb14/src
export exe=$LAMMPSLOC/lmp_pgi
echo "The LAMMPS executable is: " $exe
export DATADIR=$PBS_O_WORKDIR
export NPROCS=`wc -l $PBS_NODEFILE | cut -f1 -d " "`
export JOBID=`echo $PBS_JOBID | awk -F'.' '{print $1}'`
export OUTPUTDIR=$WORKDIR/LAMMPS/$JOBID
echo "The LAMMPS output will temporarily be written to :" $OUTPUTDIR
echo "LAMMPS Job: " $JOBID "is starting with " $NPROCS "cores on:"
cat $PBS_NODEFILE
echo
# Create Directories
#
mkdir -p $OUTPUTDIR
# export job info
#
echo $PBS_JOBID > $DATADIR/jobinfo
cat $PBS_NODEFILE >> $DATADIR/jobinfo
echo $OUTPUTDIR >> $DATADIR/jobinfo
# Copy executable and any required input files to your work directory
#
cp $DATADIR/* $OUTPUTDIR
cd $OUTPUTDIR
#
# Run LAMMPS
#
date
aprun -n %ncpu% $exe -in lammps_input > log
echo
date
echo "LAMMPS has finished."
echo "The LAMMPS output is being copied back to: " $PBS_O_WORKDIR
cd ..
tar -cvzf $JOBID.tar.gz $JOBID
cp -r $JOBID.tar.gz $PBS_O_WORKDIR
rm $JOBID.tar.gz
exit 0
"""

def main():
if len(sys.argv) == 1:
ncpu = 32
else:
ncpu = int(sys.argv[1])
nnode = ncpu/32

o = open("runLAMMPS.in", "w")
lines = INP
lines = lines.replace("%nnode%", "%d"%nnode)
lines = lines.replace("%ncpu%", "%d"%ncpu)
o.write(lines)
o.close()
os.system("chmod +x runLAMMPS.in")

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion tools/vasp/get_potcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

POT = {"N":"N", "O":"O", "H":"H", "C":"C", "Li":"Li", "S":"S", "Ti":"Ti", "P":"P",
"Ca":"Ca_pv", "Al":"Al", "Cu":"Cu", "Na":"Na", "Cl":"Cl", "Cr":"Cr", "Ga":"Ga",
"Br":"Br", "D": "H", "Si": "Si", "Ni": "Ni"}
"Br":"Br", "D": "H", "Si": "Si", "Ni": "Ni", "Pt":"Pt"}
POT_DATA_BASE = "/project/source/VASP/vasp.5.2/potcar/potpaw_PBE"

o = open("POTCAR", "w")
Expand Down

0 comments on commit b41e0b2

Please sign in to comment.