Changeset 535


Ignore:
Timestamp:
Oct 10, 2006 6:25:19 AM (18 years ago)
Author:
dkearney
Message:

added tools and queue to init script for
python rappture, updated python rappture's
queue module to look for an environment
variable for setting the queue name

Location:
trunk/python/Rappture
Files:
2 edited

Legend:

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

    r43 r535  
    44from number import number
    55from result import result
     6import queue as queue
     7import tools as tools
  • trunk/python/Rappture/queue.py

    r529 r535  
    216216        self.executable(executable)
    217217        self.execArgs(execArgs)
    218         self.queue("@vma118.punch.purdue.edu")
     218        nanoHUBQ = os.getenv("NANOHUB_PBS_QUEUE")
     219        if nanoHUBQ is None :
     220            self.queue("@vma118.punch.purdue.edu")
     221        else:
     222            self.queue(nanoHUBQ)
    219223
    220224    def __initPbsScriptVars__(self):
     
    317321        retVal = self._pbs_msgs['DEFAULT']
    318322        if self._jobId:
    319             cmdOutput = getCommandOutput("qstat -a | grep \'^ *%s\'" % (self._jobId))
     323            nanoHUBQ = self.queue()
     324            if nanoHUBQ != "":
     325                atLocation = nanoHUBQ.find('@')
     326                if atLocation > -1:
     327                    pbsServer = nanoHUBQ[atLocation+1:]
     328
     329            if pbsServer == '':
     330                cmd = "qstat -a | grep \'^ *%s\'" % (self._jobId)
     331            else:
     332                cmd = "qstat @%s -a | grep \'^ *%s\'" % (pbsServer,self._jobId)
     333            cmdOutput = getCommandOutput(cmd)
     334
    320335            # parse a string that should look like this:
    321336            # 32049.hamlet.rc kearneyd ncn      run.21557.   6104   8   8    --  24:00 R 00:00
Note: See TracChangeset for help on using the changeset viewer.