Package schrodinger :: Package job :: Module jobcontrol :: Class Host
[hide private]
[frames] | no frames]

Class Host

object --+
         |
        Host


A class to encapsulate host info from the schrodinger.hosts file.

Use the module level functions get_host or get_hosts to create Host
instances.

Attributes:

    name -        Label for the Host.
    _host -       Host machine name (or machine that submits jobs to the
                  queue).  Use setHost() and getHost() to access.
                  Defaults to 'name'.
    user -        Username by which to run jobs.
    processors -  Number of processors for the host/cluster.
    tmpdir -      Temporary/scratch directory to use for jobs.  List
    schrodinger - $SCHRODINGER installation to use for jobs.
    env -         Variables to set in the job environment.  List.
    gpgpu -       GPGPU entries.  List.
    queue -       Queue entries only.  Queue type (e.g., SGE, PBS).
    qargs -       Queue entries only.  Optional arguments passed to the
                  queue submission command.
    _is_queue -   Boolean indicating whether the Host is a queue entry.
                  Access via isQueue().
    _lines -      List of lines that form a string representation
                  of the host entry. Access via _hostLines();

Instance Methods [hide private]
 
__init__(self, name)
Create a named Host object.
 
to_hostentry(self)
Return a string representation of the Host object suitable for including in a hosts file.
 
getHost(self)
Return the name of the host, which defaults to 'name' if a separate 'host' attribute wasn't specified.
 
setHost(self, host)
Store host as _host to allow us to use a property for the 'host' attr.
 
isQueue(self)
Check to see whether the host represents a batch queue.
 
__str__(self)
Return the informal string representation of the Host -- a comma-separated list of "Key: value" attribute pairs.
 
_hostLines(self)
Return an array of lines that if joined with newlines would create a schrodinger.hosts entry.
 
__repr__(self)
Return the formal string representation of the Host.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  host
Return the name of the host, which defaults to 'name' if a separate 'host' attribute wasn't specified.

Inherited from object: __class__

Method Details [hide private]

__init__(self, name)
(Constructor)

 

Create a named Host object. The various host attributes must be set after object instatiation.

Only host-entry fields can be public attributes of a Host object. Attributes introduced to capture other information about the entry must be private (named with a leading underscore.)

Overrides: object.__init__

isQueue(self)

 

Check to see whether the host represents a batch queue. Returns True if the host is a traditional queue or a grid host.

__str__(self)
(Informal representation operator)

 

Return the informal string representation of the Host -- a comma-separated list of "Key: value" attribute pairs.

Overrides: object.__str__

__repr__(self)
(Representation operator)

 

Return the formal string representation of the Host.

Overrides: object.__repr__

Property Details [hide private]

host

Return the name of the host, which defaults to 'name' if a separate 'host' attribute wasn't specified.

Get Method:
getHost(self) - Return the name of the host, which defaults to 'name' if a separate 'host' attribute wasn't specified.
Set Method:
setHost(self, host) - Store host as _host to allow us to use a property for the 'host' attr.