Ejemplo n.º 1
0
    def qsub(self, argList, stdinList):
        jobID = False
        exitCode = 0

        qsubCommand = "%s %s" % (self.__qsub, args_to_string(argList))

        self.__log.debug("qsub -> %s" % qsubCommand)

        qsubProcess = simpleCommand('qsub', qsubCommand, env=self.__env)
        qsubProcess.start()

        while qsubProcess.stdin == None:
            time.sleep(.2)

        try:
            for line in stdinList:
                self.__log.debug("qsub stdin: %s" % line)
                print >> qsubProcess.stdin, line
            qsubProcess.stdin.close()
        except IOError, i:
            # If torque's qsub is given invalid params, it fails & returns immediately
            # Check for such errors here
            # Wait for command execution to finish
            qsubProcess.wait()
            qsubProcess.join()
            output = qsubProcess.output()
            if output != []:
                self.__log.critical("qsub Failure : %s " % output[0].strip())
                self.__log.critical("qsub Command : %s" % qsubCommand)
            return None, qsubProcess.exit_code()
Ejemplo n.º 2
0
  def qsub(self, argList, stdinList):
    jobID = False
    exitCode = 0

    qsubCommand = "%s %s" % (self.__qsub, args_to_string(argList))
    
    self.__log.debug("qsub -> %s" % qsubCommand)
    
    qsubProcess = simpleCommand('qsub', qsubCommand, env=self.__env)
    qsubProcess.start()
    
    while qsubProcess.stdin == None:
      time.sleep(.2)

    try:
      for line in stdinList:
        self.__log.debug("qsub stdin: %s" % line)
        print >>qsubProcess.stdin, line
      qsubProcess.stdin.close()
    except IOError, i:
      # If torque's qsub is given invalid params, it fails & returns immediately
      # Check for such errors here
      # Wait for command execution to finish
      qsubProcess.wait()
      qsubProcess.join()
      output = qsubProcess.output()
      if output!=[]:
        self.__log.critical("qsub Failure : %s " % output[0].strip())
        self.__log.critical("qsub Command : %s" % qsubCommand)
      return None, qsubProcess.exit_code()
Ejemplo n.º 3
0
        def gen_stdin_list():
            # Here we are basically generating the standard input for qsub.
            #  Specifically a script to exec ringmaster.
            stdinList.append("#!/bin/sh")

            ringBin = os.path.join(self._cfg["hod"]["base-dir"], "bin", "ringmaster")
            ringArgs = [ringBin]
            ringArgs.extend(self._cfg.get_args(exclude=("hod")))

            ringMasterCommand = args_to_string(ringArgs)

            self._log.debug("ringmaster cmd: %s" % ringMasterCommand)

            stdinList.append(ringMasterCommand)
Ejemplo n.º 4
0
 def gen_stdin_list():
   # Here we are basically generating the standard input for qsub.
   #  Specifically a script to exec ringmaster.
   stdinList.append('#!/bin/sh')
   
   ringBin = os.path.join(self._cfg['hod']['base-dir'], 'bin', 
                          'ringmaster')
   ringArgs = [ringBin,]
   ringArgs.extend(self._cfg.get_args(exclude=('hod')))
   
   ringMasterCommand = args_to_string(ringArgs)
   
   self._log.debug("ringmaster cmd: %s" % ringMasterCommand)
   
   stdinList.append(ringMasterCommand)
Ejemplo n.º 5
0
        def gen_stdin_list():
            # Here we are basically generating the standard input for qsub.
            #  Specifically a script to exec ringmaster.
            stdinList.append('#!/bin/sh')

            ringBin = os.path.join(self._cfg['hod']['base-dir'], 'bin',
                                   'ringmaster')
            ringArgs = [
                ringBin,
            ]
            ringArgs.extend(self._cfg.get_args(exclude=('hod')))

            ringMasterCommand = args_to_string(ringArgs)

            self._log.debug("ringmaster cmd: %s" % ringMasterCommand)

            stdinList.append(ringMasterCommand)
Ejemplo n.º 6
0
  def pbsdsh(self, arguments):
    status = None
    
    pbsdshCommand = "%s %s" % (self.__pbsdsh, args_to_string(arguments))
    
    self.__log.debug("pbsdsh command: %s" % pbsdshCommand)
    
    pbsdsh = simpleCommand('pbsdsh', pbsdshCommand, env=self.__env)
    pbsdsh.start()   

    for i in range(0, 30):
      status = pbsdsh.exit_code()
      if status:
        self.__log.error("pbsdsh failed: %s" % pbsdsh.exit_status_string())
        break  
    
    if not status: status = 0
      
    return status  
Ejemplo n.º 7
0
    def pbsdsh(self, arguments):
        status = None

        pbsdshCommand = "%s %s" % (self.__pbsdsh, args_to_string(arguments))

        self.__log.debug("pbsdsh command: %s" % pbsdshCommand)

        pbsdsh = simpleCommand('pbsdsh', pbsdshCommand, env=self.__env)
        pbsdsh.start()

        for i in range(0, 30):
            status = pbsdsh.exit_code()
            if status:
                self.__log.error("pbsdsh failed: %s" %
                                 pbsdsh.exit_status_string())
                break

        if not status: status = 0

        return status