def makefolder(self): #print self.path copyfromtemplate(self.foldername) root=XmlParser("{}/exciton.xml".format(self.foldername)) exciton=root.find("exciton") exciton.find("tasks").text="input" XmlWriter(root,"{}/exciton.xml".format(self.foldername)) with cd(self.foldername): sp.call("xtp_tools -e exciton -o exciton.xml > exciton.log",shell=True) self.modcomfile("system.com") exciton.find("tasks").text="dft,parse,gwbse" XmlWriter(root,"{}/exciton.xml".format(self.foldername))
def makefolder(self): #print self.path copyfromtemplate(self.foldername) root = XmlParser("{}/exciton.xml".format(self.foldername)) exciton = root.find("exciton") gwbseengine = exciton.find("gwbse_engine") gwbseengine.find("tasks").text = "input" XmlWriter(root, "{}/exciton.xml".format(self.foldername)) with cd(self.foldername): sp.call("xtp_tools -e exciton -o exciton.xml > exciton.log", shell=True) self.modcomfile("system.com") gwbseengine.find("tasks").text = "dft,parse,gwbse" XmlWriter(root, "{}/exciton.xml".format(self.foldername))
help="Exclude certain jobs from action,give the numbers of the jobs") parser.add_argument( "--include", type=int, nargs="+", default=False, help="Limit action to only the jobs, give the numbers of the jobs") args = parser.parse_args() if args.exclude != False and args.include != False: print "ERROR: Excluding and Including at the same time does not work. Choose different options!" sys.exit() root = XmlParser(args.options) queue = root.find("queue").text procs = int(root.find("procs").text) tag = root.find("tag").text jobfile = root.find("jobfile").text calculator = root.find("calculator").text optionfile = root.find("optfile").text sql = root.find("sqlfile").text threads = int(root.find("threads").text) cache = int(root.find("cache").text) rsync = (root.find("rsync").text) numberofjobs = int(root.find("clusterjobs").text) workdir = root.find("workdir").text modules = root.find("modules").text source = root.find("source").text if (root.find("xml_optionstring") != None):
const=1, default=0, help="Run jobs") parser.add_argument("--read", action='store_const', const=1, default=0, help="Readout outputfiles") args = parser.parse_args() BohrtoAngstroem = 0.5291772109 b2a3 = BohrtoAngstroem**3 root = XmlParser(args.options) h = float(root.find("fieldstrength").text) tags = (root.find("tags").text).split() if h < 10E-5: print "Aborting. Field strength is too small" sys.exit() def copyfromtemplate(path): base = os.path.realpath('.') #print base template = os.path.join(base, "TEMPLATE") #print template try: shutil.copytree(template, path)
parser.add_argument("--setup",action='store_const', const=1, default=0,help="Setup") parser.add_argument("--merge",action='store_const', const=1, default=0,help="Merge jobfiles") parser.add_argument("--info",action='store_const', const=1, default=0,help="Display info about each jobfile") parser.add_argument("--reset",type=str, nargs="+",default=False,help="Reset FAILED and or ASSIGNED to AVAILABLE") parser.add_argument("--exclude",type=int, nargs="+", default=False,help="Exclude certain jobs from action,give the numbers of the jobs") parser.add_argument("--include",type=int, nargs="+", default=False,help="Limit action to only the jobs, give the numbers of the jobs") args=parser.parse_args() if args.exclude!=False and args.include!=False: print "ERROR: Excluding and Including at the same time does not work. Choose different options!" sys.exit() root=XmlParser(args.options) queue=root.find("queue").text procs=int(root.find("procs").text) tag=root.find("tag").text jobfile=root.find("jobfile").text calculator=root.find("calculator").text optionfile=root.find("optfile").text sql=root.find("sqlfile").text threads=int(root.find("threads").text) cache=int(root.find("cache").text) rsync=(root.find("rsync").text) numberofjobs=int(root.find("clusterjobs").text) workdir=root.find("workdir").text if rsync=="true" or rsync=="1" or rsync=="True": rsync=True elif rsync=="false" or rsync=="0" or rsync=="False":
parser=MyParser(description="Enviroment to do numerical polarisation calculations with gwbse and gaussian") parser.add_argument("--template","-t",type=str,required=True,help="Folder, from which to take votca-optionfiles from") parser.add_argument("--options","-o",type=str,required=True,help="optionfile") parser.add_argument("--setup", action='store_const', const=1, default=0,help="Setup folders") parser.add_argument("--run", action='store_const', const=1, default=0,help="Run jobs") parser.add_argument("--read", action='store_const', const=1, default=0,help="Readout outputfiles") args=parser.parse_args() BohrtoAngstroem=0.5291772109 b2a3=BohrtoAngstroem**3 root=XmlParser(args.options) h=float(root.find("fieldstrength").text) tags=(root.find("tags").text).split() if h< 10E-5: print "Aborting. Field strength is too small" sys.exit() def copyfromtemplate(path): base=os.path.realpath('.') #print base template=os.path.join(base, "TEMPLATE") #print template