Ignore:
Timestamp:
Feb 20, 2007, 10:40:55 AM (18 years ago)
Author:
dkearney
Message:

adjusted the default queue for pbs. also initialized some variables. these changes allow pbs to automatically choose which queue to send jobs to.
condor seems not to work, not sure why.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/Rappture/queue.py

    r539 r579  
    152152            self._queue_vars['jobName'] = jobName
    153153
    154     def transferFiles(self,transferFiles=[]):
    155         transferFiles = list(transferFiles)
    156         if (len(transferFiles) == 0)  or (jobName == []):
    157             return self._queue_vars['transferFiles']
    158         else:
    159             self._queue_vars['transferFiles'] = transferFiles
    160 
    161154    def __convertWalltime__(self):
    162155        pass
     
    224217        self.execArgs(execArgs)
    225218        nanoHUBQ = os.getenv("NANOHUB_PBS_QUEUE")
    226         if nanoHUBQ is None :
    227             self.queue("@vma118.punch.purdue.edu")
    228         else:
     219        if nanoHUBQ is not None :
    229220            self.queue(nanoHUBQ)
    230221
     
    292283                (mpiCommand, self.nodes(), self.executable(), self.execArgs()))
    293284
    294         return """#PBS -S /bin/bash
     285        script = """#PBS -S /bin/bash
    295286#PBS -l nodes=%s:ppn=%s
    296287#PBS -l walltime=%s
    297 #PBS -q %s
     288""" % (self.nodes(),self.ppn(),self.walltime())
     289        if self.queue() :
     290            script += "#PBS -q %s" % (self.queue())
     291        script += """
    298292#PBS -o %s
    299293#PBS -e %s
     
    308302
    309303touch %s
    310 """ % ( self.nodes(),
    311         self.ppn(),
    312         self.walltime(),
    313         self.queue(),
    314         self.outFile(),
    315         self.errFile(),
    316         self.jobName(),
    317         self.cmd(),
    318         self.errFile()   )
     304""" % (self.outFile(),self.errFile(),self.jobName(),self.cmd(),self.errFile())
     305
     306        return script
    319307
    320308    def cmd(self,cmd=''):
     
    326314
    327315    def getCurrentStatus(self):
     316        pbsServer = ''
     317        nanoHUBQ = ''
    328318        retVal = self._pbs_msgs['DEFAULT']
    329319        if self._jobId:
    330320            nanoHUBQ = self.queue()
    331             if nanoHUBQ != "":
     321            if (nanoHUBQ != "") and (nanoHUBQ is not None):
    332322                atLocation = nanoHUBQ.find('@')
    333323                if atLocation > -1:
    334324                    pbsServer = nanoHUBQ[atLocation+1:]
    335325
     326            cmd = ''
    336327            if pbsServer == '':
    337328                cmd = "qstat -a | grep \'^ *%s\'" % (self._jobId)
     
    394385
    395386class condor (queue):
     387    # this class is not working!
    396388
    397389    USE_MPI = 1
     
    405397                    execArgs='',
    406398                    walltime='00:01:00',
    407                     transferFiles=[],
    408399                    flags=0             ):
    409400
     
    433424        self.errFile("err.$(cluster).$(process)")
    434425        self.logFile("log.$(cluster)")
    435         self.transferFiles(transferFiles)
    436426
    437427    def __fillStatusDict__(self):
     
    591581
    592582        if len(self._processList) == 0:
    593             self.addProcess(inputFiles=self.transferFiles())
     583            self.addProcess()
    594584
    595585        submitFileData = self.__makeCondorScript__() + "\n".join(self._processList)
     
    644634    resultsDir = createDir('4321')
    645635    executable = './hello.sh'
    646     txFileList = ['hello']
    647636    shutil.copy('hello/hello.sh',resultsDir)
    648637    shutil.copy('hello/hello',resultsDir)
    649     myCondorObj = condor(jobName,resultsDir,2,executable,ppn=1,walltime=walltime,transferFiles=txFileList,flags=condor.USE_MPI)
     638    myCondorObj = condor(jobName,resultsDir,2,executable,walltime=walltime,flags=condor.USE_MPI)
    650639    myCondorObj.submit()
    651640    myCondorObj.status()
Note: See TracChangeset for help on using the changeset viewer.