Skip to content

Commit

Permalink
Merge branch 'master' of github.com:esemble/simpy
Browse files Browse the repository at this point in the history
  • Loading branch information
ensemble-learning committed Apr 5, 2018
2 parents 6c8e255 + f94e131 commit 65cfd93
Show file tree
Hide file tree
Showing 86 changed files with 1,427 additions and 15 deletions.
Binary file added examples/05_vasp_raman/doc/raman-cal.pdf
Binary file not shown.
Binary file added examples/05_vasp_raman/doc/raman-wiki.pdf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion lib/e_2_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import argparse
from mytype import System, Molecule, Atom
from pdb import Pdb
from output_conf import toReaxLammps, toGeo, toPdb, toMsd, toXyz, toMusic, toPoscar, toJdft, toCfg
from output_conf import toReaxLammps, toGeo, toPdb, toMsd, toXyz, toMusic, toPoscar, toJdft, toCfg, toTowheecoords

def usage():
print """python e_2_pdb [pbc|nopbc]
Expand Down Expand Up @@ -58,6 +58,7 @@ def withPbc(testfile="supper.pdb", args=''):
toPoscar(b,)
toCfg(b,)
toJdft(b,)
toTowheecoords(b)
if args:
if args.element:
toPdb(b, "out.pdb", 1)
Expand Down
17 changes: 17 additions & 0 deletions lib/output_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,3 +646,20 @@ def toCfg(system, outfile="out.cfg"):
o.write("%20.15f%20.15f%20.15f\n"%(xf, yf, zf))
o.close()

def toTowheecoords(system, outfile="towhee_coords"):
""" output to towhee_coords file format
"""
o = open(outfile, 'w')
for i in system.atoms:
line = ''
line += "%25.15f"%i.x[0]
line += "%25.15f"%i.x[1]
line += "%25.15f"%i.x[2]
if len(i.element) > 0:
line += "%10s"%i.element
else:
line += "%10s"%i.name
line += "\n"
o.write(line)
o.close()

5 changes: 4 additions & 1 deletion tools/linux/cmdall
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def exec_folders(dlist, cmd, args):
print "cmd processing in %s"%os.getcwd()
if args.arg:
folder = os.path.basename(os.getcwd())
run += " %s"%folder
print folder
run = run.replace("xx", folder)
if args.v:
print "cmd is %s"%run
os.system(run)
os.chdir("..")

Expand Down
54 changes: 45 additions & 9 deletions tools/stampede2/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,47 @@

run_jobs = []
wait_jobs = []
complete_or_err_jobs = []
block_jobs = []
total_jobs = ""

end_flag = 0
f = os.popen("showq -u")
for i in f:
if i.strip().startswith("ACTIVE JOBS"):
break
for i in f:
if i.strip().startswith("WAITING JOBS"):
break
if i.strip().startswith("Total Jobs"):
totoal_jobs = i
break
run_jobs.append(i)

for i in f:
if i.strip().startswith("COMPLETING/ERRORED JOBS"):
if i.strip().startswith("COMPLETING"):
break
if i.strip().startswith("BLOCKED JOBS"):
break
if i.strip().startswith("Total Jobs"):
totoal_jobs = i
end_flag = 1
total_jobs = i
break
wait_jobs.append(i)

#print run_jobs
#print wait_jobs
for i in f:
if i.strip().startswith("BLOCKED JOBS"):
break
if i.strip().startswith("Total Jobs"):
end_flag = 1
total_jobs = i
break
complete_or_err_jobs.append(i)

if not end_flag:
for i in f:
if i.strip().startswith("Total Jobs"):
total_jobs = i
break
block_jobs.append(i)

f.close()

if len(run_jobs) > 3:
Expand All @@ -47,8 +65,8 @@
for j in f:
if j.strip().startswith("WorkDir"):
tokens = j.strip().split()
workfolder = tokens[0].split("=")[1][21:]
workfolder = "~" + workfolder
workfolder = tokens[0].split("=")[1]
#workfolder = "~" + workfolder
break
print workfolder
f.close()
Expand All @@ -71,6 +89,24 @@
print workfolder
f.close()

if len(block_jobs) > 3:
print "-"*20,
print "Jobs blocking",
print "-"*20
for i in block_jobs[2:-1]:
tokens = i.strip().split()
jobid = tokens[0]
print jobid,
f = os.popen("scontrol show job %s"%jobid)
for j in f:
if j.strip().startswith("WorkDir"):
tokens = j.strip().split()
workfolder = tokens[0].split("=")[1][21:]
workfolder = "~" + workfolder
break
print workfolder
f.close()

print "-"*20,
print "Jobs summary",
print "-"*20
Expand Down
23 changes: 23 additions & 0 deletions tools/stampede2/tocheng-ion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python

import os
import sys
import argparse

def main():
parser = argparse.ArgumentParser()
parser.add_argument("fname", nargs="+", help="geo file name")
parser.add_argument("-o", default="/net/hulk/PMD/tcheng/download", help="convert the file to other formats (geo, xyz, gjf, lammps)")
args = parser.parse_args()
files = args.fname
folder = args.o
ip = "ion.wag.caltech.edu"
usr = "chengtao"
cmd = "scp -r "
cmd += " ".join(files)
cmd += " "+usr+"@"+ip+":"+folder
os.system(cmd)

if __name__ == "__main__":
main()

Loading

0 comments on commit 65cfd93

Please sign in to comment.