예제 #1
0
 def run(self):
     if not self.outputFilename == "" :
         self.workfiles.append([self.outputFilename,"log",True])
     if self.sequential:
         self.maxjobs=1;
     self.fixparameters[vconf.par.NPAR]=vconf.getnpar(self.ppn*self.nodes)
     if self.fixparameters[vconf.par.NPAR] > self.maxnpar:
         self.fixparameters[vconf.par.NPAR] = self.maxnpar
     self.fixparameters[vconf.par.LPLANE]=".TRUE."
     if self.testrun:
         self.sleepduration=10
     i = 0
     iend = self.calcruns(1)
     self.setTempdirstart(iend)
     self.calculations= iend*self.runs
     print "Datenpunkte: "+"%.0d"%round(iend)
     while i < iend:
         for link in self.linkfilestodir:
             if os.path.isfile(link):
                 linkname = self.gettemppath(i)+os.path.basename(link)
                 if os.path.lexists(linkname):
                     os.remove(linkname)
                 os.symlink(link,linkname)
         self.detailedruns[i]=self.runs
         self.copyinput(i)
         conf = vconf.vaspconfig(self.gettemppath(i))
         conf.highestFileVersion = False
         paras = self.getparas(i,conf)
        # if not self.oldFilesPath:
         if self.oldFilesPath == "" or (not self.oldFilesPath == "" and self.changeoldFiles):
             for key,val in paras.iteritems():
                 self.fixparameters[key]=val
         if not vconf.par.Potpath in self.fixparameters:
             self.fixparameters[vconf.par.Potpath] =self.potcarpath
         if not vconf.par.Pottype in self.fixparameters:
             self.fixparameters[vconf.par.Pottype] =self.potcartype
         conf.setparameter(self.fixparameters)
         for prozess in self.preexec:
             prozess = [self.replaceDirectory(i,s) for s in prozess]
             time.sleep(1)
             sub.Popen(prozess)
             time.sleep(1)
         self.jobs[i] = self.startjob(i)
         while len(self.jobs) >= self.maxjobs:
             time.sleep(self.sleepduration)
             self.managefinishedjobs()
         i+=1
     while len(self.jobs)>0:
         time.sleep(self.sleepduration)
         self.managefinishedjobs()
     print "Fertig"
예제 #2
0
def makescript(path,filename,nodes,ppn,queue,name,email,outpath,memorymultiplikator=1,hours=1,parameters=""):
    temp = """\
#!/bin/bash
#
#PBS -l nodes=%d:ppn=%d%s
#PBS -l mem=%dmb
#PBS -l walltime=%d:00:00
#PBS -q %s
#PBS -j oe
#PBS -N %s
#PBS -M %s
#PBS -o %s
#
cd %s
%s
"""
    return temp %(nodes,ppn,parameters,nodes*vconf.getnpar(ppn)*2048*memorymultiplikator,hours,queue,name,email,outpath,path,filename)