Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

YadaMachine Class Reference
[YadaConfiguration - managing configurationsYadaScheduler - the data workhorse]

Inheritance diagram for YadaMachine:

Inheritance graph
[legend]
Collaboration diagram for YadaMachine:

Collaboration graph
[legend]
List of all members.

Detailed Description

YadaMachine - bundled information about a yada machine
Note:
Actually this class should be split into a YadaScheduler and a YadaMachine the latter of which only contains the configurational part of the current implementation. As things are we add this class to the YadaScheduler module and the YadaConfiguration module, a construction that might be a little wired.
Author:
Michael Daum
Id
YadaMachine.tcl,v 1.13 2004/10/15 17:24:37 micha Exp

Definition at line 25 of file YadaMachine.tcl.

Public Member Functions

 displayTitle ()
 fromDOM (domNode rootNode)
 getLoad ()
 getPersistanceFileName ()
 getTimePerJob ()
 hasSavedState ()
 isModified ()
 load ()
 queueJob (YadaJob job)
 resetModified ()
 save ()
 setModified ()
 startJob ()
 stopJob (YadaJob job)
 toDOM ()
 wait ()
 YadaMachine (TclList args)
 ~YadaMachine ()

Public Attributes

TclString access = "local"
TclNumber cpus = 1
TclRef name
TclList nodes = {127.0.0.1}

Protected Attributes

TclNumber _modified = 0

Private Member Functions

 _addTime (TclNumber time)
 _getNextNode ()
 _startJob ()

Private Attributes

TclString _jobQueue = ""
TclArray _jobsOnNode
TclNumber _noComputedJobs = 10
TclString _runQueue = ""
TclNumber _timePerJob = 60000
TclArray _timerOfJob


Constructor & Destructor Documentation

YadaMachine::YadaMachine TclList  args  ) 
 

constructor

Definition at line 91 of file YadaMachine.tcl.

YadaMachine::~YadaMachine  ) 
 

destructor

Definition at line 355 of file YadaMachine.tcl.


Member Function Documentation

YadaMachine::_addTime TclNumber  time  )  [private]
 

update machine statistics. This machine adds the given time to the internal timer statistics. Incremental averaging is computed like this:

  • $x1 $
  • $ x_1 * 1/2 + x_2/2 = (x_1 + x_2)/2 $
  • $ (x_1 * 1/2 + x_2/2) * 2/3 + x_3/3 = (x_1 + x_2 + x_3)/3 $
  • $ ((x_1 * 1/2 + x_2/2) * 2/3 + x_3/3) * 3/4 + x4/4 = (x_1 + x_2 + x_3 + x_4)/4 $
  • ...
    Parameters:
    time a temporal span
    Returns:
    the computed average time per job as calculated for this machine.
Definition at line 373 of file YadaMachine.tcl.

YadaMachine::_getNextNode  )  [private]
 

_getNextNode This returns the next best node on the cluster, that is the one with the least jobs running on it. Definition at line 178 of file YadaMachine.tcl.

YadaMachine::_startJob  )  [private]
 

_startJob remove the next YadaJob from the queue and run it Definition at line 231 of file YadaMachine.tcl.

YadaConfigItem::displayTitle  )  [inherited]
 

Displays title in main window (reflecting modification state of document).

Definition at line 128 of file YadaConfigItem.tcl.

YadaMachine::fromDOM domNode  rootNode  ) 
 

Initialize Object with DOM node (that has saved the object state)

Parameters:
rootNode root DOM-Node (Tag <yada>)

Reimplemented from YadaConfigItem.

Definition at line 128 of file YadaMachine.tcl.

YadaMachine::getLoad  ) 
 

getLoad

Definition at line 201 of file YadaMachine.tcl.

YadaMachine::getPersistanceFileName  )  [virtual]
 

Getting unique file name from registry.

Implements YadaConfigItem.

Definition at line 439 of file YadaMachine.tcl.

YadaMachine::getTimePerJob  ) 
 

getTimePerJob

Definition at line 390 of file YadaMachine.tcl.

References nodes.

YadaConfigItem::hasSavedState  )  [inherited]
 

Predicate returning 1, if file containing persistant state of YadaGrammar exists, otherwise 0 Definition at line 115 of file YadaConfigItem.tcl.

YadaConfigItem::isModified  )  [inherited]
 

Predicate returning 1, if configuration data has changed, 0 otherwise.

Definition at line 87 of file YadaConfigItem.tcl.

YadaConfigItem::load  )  [inherited]
 

Loads object state from unique file (depends on object name).

Definition at line 66 of file YadaConfigItem.tcl.

YadaMachine::queueJob YadaJob  job  ) 
 

queueJob

Definition at line 168 of file YadaMachine.tcl.

YadaConfigItem::resetModified  )  [inherited]
 

Removes modification mark.

Definition at line 105 of file YadaConfigItem.tcl.

YadaConfigItem::save  )  [inherited]
 

Serializes object state to unique file (depends on object name).

Definition at line 45 of file YadaConfigItem.tcl.

YadaConfigItem::setModified  )  [inherited]
 

Marks item as modified.

Definition at line 94 of file YadaConfigItem.tcl.

YadaMachine::startJob  ) 
 

startJob schedule jobs Definition at line 213 of file YadaMachine.tcl.

YadaMachine::stopJob YadaJob  job  ) 
 

stopJob

Definition at line 313 of file YadaMachine.tcl.

YadaMachine::toDOM  ) 
 

Serializes Object into a DOM-XML-Node

Returns:
root DOM node representing the Machine-Object (root tag <yada>)

Reimplemented from YadaConfigItem.

Definition at line 102 of file YadaMachine.tcl.

YadaMachine::wait  ) 
 

waits for a cpu to become free. Calling wait will guarantee that no more jobs are running than cpus are in the cluster. Execution will be suspendend waiting for the _runQueue to change. Definition at line 156 of file YadaMachine.tcl.


Member Data Documentation

TclString YadaMachine::_jobQueue = "" [private]
 

list of all YadaJob s queued up to be scheduled on all nodes

Definition at line 45 of file YadaMachine.tcl.

TclArray YadaMachine::_jobsOnNode [private]
 

hash mapping machine node names to the YadaJob s running on them

Definition at line 64 of file YadaMachine.tcl.

TclNumber YadaMachine::_noComputedJobs = 10 [private]
 

number of jobs run on this machine. This number is related to _timePerJob computing the average duration seen in _noComputedJobs. Definition at line 57 of file YadaMachine.tcl.

TclString YadaMachine::_runQueue = "" [private]
 

list of YadaJob s currently running on the nodes

Definition at line 48 of file YadaMachine.tcl.

TclNumber YadaMachine::_timePerJob = 60000 [private]
 

statistics about the average duration of one YadaJob. The machine updates this figure the more jobs have been seen. Definition at line 52 of file YadaMachine.tcl.

TclArray YadaMachine::_timerOfJob [private]
 

used for profiling jobs on this machine. This hash mapps YadaJob objects to a clock tick. Definition at line 61 of file YadaMachine.tcl.

TclString YadaMachine::access = "local"
 

acess manor for this machine. possible values are "local" or any way of getting a shell on the nodes, i.e.

 ssh -x %node 
Notice, that the string node is replaced with the actuall node name in YadaMachine::nodes to which a specific connection is to be established. Definition at line 41 of file YadaMachine.tcl.

TclNumber YadaMachine::cpus = 1
 

overall sum of cpus in all nodes

Definition at line 34 of file YadaMachine.tcl.

YadaMachine::nodes = {127.0.0.1}
 

list ip adresses host names making up this machine

callback whenever the -nodes attribute is set This a registers known nodes of a cluster by setting the number of running jobs in _jobsOnNode to 0. Formerly known nodes that aren't found in $nodes any more are removed from that array. Definition at line 400 of file YadaMachine.tcl.

Referenced by getTimePerJob().


The documentation for this class was generated from the following file:
YADA 2.0-alpha (20 Oct 2004)