Changeset 579 for trunk/python/Rappture/queue.py
- Timestamp:
- Feb 20, 2007, 10:40:55 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/Rappture/queue.py
r539 r579 152 152 self._queue_vars['jobName'] = jobName 153 153 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'] = transferFiles160 161 154 def __convertWalltime__(self): 162 155 pass … … 224 217 self.execArgs(execArgs) 225 218 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 : 229 220 self.queue(nanoHUBQ) 230 221 … … 292 283 (mpiCommand, self.nodes(), self.executable(), self.execArgs())) 293 284 294 return"""#PBS -S /bin/bash285 script = """#PBS -S /bin/bash 295 286 #PBS -l nodes=%s:ppn=%s 296 287 #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 += """ 298 292 #PBS -o %s 299 293 #PBS -e %s … … 308 302 309 303 touch %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 319 307 320 308 def cmd(self,cmd=''): … … 326 314 327 315 def getCurrentStatus(self): 316 pbsServer = '' 317 nanoHUBQ = '' 328 318 retVal = self._pbs_msgs['DEFAULT'] 329 319 if self._jobId: 330 320 nanoHUBQ = self.queue() 331 if nanoHUBQ != "":321 if (nanoHUBQ != "") and (nanoHUBQ is not None): 332 322 atLocation = nanoHUBQ.find('@') 333 323 if atLocation > -1: 334 324 pbsServer = nanoHUBQ[atLocation+1:] 335 325 326 cmd = '' 336 327 if pbsServer == '': 337 328 cmd = "qstat -a | grep \'^ *%s\'" % (self._jobId) … … 394 385 395 386 class condor (queue): 387 # this class is not working! 396 388 397 389 USE_MPI = 1 … … 405 397 execArgs='', 406 398 walltime='00:01:00', 407 transferFiles=[],408 399 flags=0 ): 409 400 … … 433 424 self.errFile("err.$(cluster).$(process)") 434 425 self.logFile("log.$(cluster)") 435 self.transferFiles(transferFiles)436 426 437 427 def __fillStatusDict__(self): … … 591 581 592 582 if len(self._processList) == 0: 593 self.addProcess( inputFiles=self.transferFiles())583 self.addProcess() 594 584 595 585 submitFileData = self.__makeCondorScript__() + "\n".join(self._processList) … … 644 634 resultsDir = createDir('4321') 645 635 executable = './hello.sh' 646 txFileList = ['hello']647 636 shutil.copy('hello/hello.sh',resultsDir) 648 637 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) 650 639 myCondorObj.submit() 651 640 myCondorObj.status()
Note: See TracChangeset
for help on using the changeset viewer.