parameters: (self, hostIP, cmd, port = 9091, port_end = 9999, envs = {})
docstring: Starts the PS scheduler
docstring_summary: Starts the PS scheduler
docstring_tokens: Starts the PS scheduler
function: def __init__(self, hostIP, cmd, port = 9091, port_end = 9999, envs = {}):
          """
          Starts the PS scheduler
          """
          self.cmd = cmd
          if cmd is None:
              return
          self.hostIP = hostIP
          sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          for port in range(port, port_end):
              try:
                  sock.bind(('', port))
                  self.port = port
                  sock.close()
                  break
              except socket.error:
                  continue
          env = os.environ.copy()
  
          env['DMLC_ROLE'] = 'scheduler'
          env['DMLC_PS_ROOT_URI'] = str(self.hostIP)
          env['DMLC_PS_ROOT_PORT'] = str(self.port)
          for k, v in envs.items():
              env[k] = str(v)
          self.thread = Thread(target = (lambda : subprocess.check_call(self.cmd, env=env, shell=True)), args = ())
          self.thread.setDaemon(True)
          self.thread.start()
function_tokens: def __init__ ( self , hostIP , cmd , port = 9091 , port_end = 9999 , envs = { } ) : self . cmd = cmd if cmd is None : return self . hostIP = hostIP sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) for port in range ( port , port_end ) : try : sock . bind ( ( '' , port ) ) self . port = port sock . close ( ) break except socket . error : continue env = os . environ . copy ( ) env [ 'DMLC_ROLE' ] = 'scheduler' env [ 'DMLC_PS_ROOT_URI' ] = str ( self . hostIP ) env [ 'DMLC_PS_ROOT_PORT' ] = str ( self . port ) for k , v in envs . items ( ) : env [ k ] = str ( v ) self . thread = Thread ( target = ( lambda : subprocess . check_call ( self . cmd , env = env , shell = True ) ) , args = ( ) ) self . thread . setDaemon ( True ) self . thread . start ( )