Example #1
0
#!/usr/bin/python

#This script rescales the desired POSCAR and then uploads its directory to gmice and starts a vasp run

import sys,os
#mine
import gmice_up,gmice_run

def usage():
    print "%s <local_dir> <remote_dir> <numprocs>"%sys.argv[0]
    exit(0)

if len(sys.argv)!=4:
    usage()

localdir = sys.argv[1].strip("/")+"/"
remotedir = sys.argv[2].strip("/")+"/"
numprocs = int(sys.argv[3])

#Copy to gmice
gmice_up.dir(localdir,remotedir)

#Run on gmice
gmice_run.vasp(remotedir+localdir,localdir[:15].strip("/"),numprocs)
os.system("mkdir %s"%stage2)
os.system("cp %sPOTCAR %s"%(stage1,stage2))

#For DOS calculations.
#os.system("cp %sINCAR_dos %sINCAR"%(local,stage2))
#os.system("cp %sKPOINTS_dos %sKPOINTS"%(local,stage2))

#For precision structure refinement. (useful for Enthalpy vs Pressure)
#=======
incar=open("%s/INCAR"%stage1,"r").readlines()
incarprecise=open("%s/INCAR"%stage2,"w")
for line in incar:
    #need to change encut ?
    if "PREC" in line:
        line="PREC    = HIGH"
    incarprecise.write(line)


#=======


os.system("cp %s/KPOINTS %s"%(stage1,stage2))

outcar2poscar.outcar2poscar(stage1,"%sPOSCAR"%stage2,-1)

#Upload 
gmice_up.dir(stage2,remotedir)

#Run!
gmice_run.vasp(remotedir+stage2,stage2[:15].strip("/"),8)
#Prepare the new simulation locally
os.system("mkdir %s" % stage2)
os.system("cp %sPOTCAR %s" % (stage1, stage2))

#For DOS calculations.
#os.system("cp %sINCAR_dos %sINCAR"%(local,stage2))
#os.system("cp %sKPOINTS_dos %sKPOINTS"%(local,stage2))

#For precision structure refinement. (useful for Enthalpy vs Pressure)
#=======
incar = open("%s/INCAR" % stage1, "r").readlines()
incarprecise = open("%s/INCAR" % stage2, "w")
for line in incar:
    #need to change encut ?
    if "PREC" in line:
        line = "PREC    = HIGH"
    incarprecise.write(line)

#=======

os.system("cp %s/KPOINTS %s" % (stage1, stage2))

outcar2poscar.outcar2poscar(stage1, "%sPOSCAR" % stage2, -1)

#Upload
gmice_up.dir(stage2, remotedir)

#Run!
gmice_run.vasp(remotedir + stage2, stage2[:15].strip("/"), 8)
#!/usr/bin/python

#This script rescales the desired POSCAR and then uploads its directory to gmice and starts a vasp run

import sys,os
#mine
import rescaleposcar,gmice_up,gmice_run

def usage():
    print "%s <scale> <local_dir> <remote_dir> <numprocs>"%sys.argv[0]
    exit(0)

if len(sys.argv)!=5:
    usage()

perc = float(sys.argv[1])
localdir = sys.argv[2].strip("/")+"/"
remotedir = sys.argv[3].strip("/")+"/"
numprocs = int(sys.argv[4])

#Rescale
rescaleposcar.rescaleposcar(localdir+"POSCAR",perc)

#Copy 2 gmice
gmice_up.dir(localdir,remotedir)

#Run on gmice
gmice_run.vasp(remotedir+localdir,localdir[:15].strip("/"),numprocs)