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

YadaJob.tcl

00001 # Copyright (C) 1997-2004 The CDG Team <cdg@nats.informatik.uni-hamburg.de> 00002 # 00003 # This file is free software; as a special exception the author gives 00004 # unlimited permission to copy and/or distribute it, with or without 00005 # modifications, as long as this notice is preserved. 00006 # 00007 # This program is distributed in the hope that it will be useful, but 00008 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 00009 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00010 00011 ## ---------------------------------------------------------------------------- 00012 ## YadaJob - bundled information about a yada job. 00013 ## A YadaJob is being created with the help of a YadaExperiment and organizes the 00014 ## computation of a wordgraph on a YadaMachine. 00015 ## \ingroup YadaScheduler 00016 ## 00017 ## \author Michael Daum 00018 ## 00019 ## $Id: YadaJob.tcl,v 1.7 2004/02/25 14:42:08 micha Exp $ 00020 ## ---------------------------------------------------------------------------- 00021 class YadaJob { 00022 00023 ## the name of the YadaExperiment for which we created the job. 00024 public variable experiment "" 00025 00026 ## the wordgraph which we are going to start YadaJob::experiment on 00027 public variable wordgraphName "" 00028 00029 ## the YadaRunnableDocument that is responsible for this job. 00030 ## especialy all messages that want to be printed are displayed on this 00031 ## document. 00032 public variable runner "" 00033 00034 ## consumber callback. 00035 ## After the job has finished we call this tcl command 00036 ## \code $consumerCommand $thisJon \endcode 00037 ## to process the results. \see Process::consumerCommand 00038 public variable consumerCommand "" 00039 00040 ## the CdgProcess that is connected to a running job. 00041 public variable process "" 00042 00043 ## the YadaMachine on which we run this job. 00044 public variable machine "" 00045 00046 ## the actual node of the machine that this job runs on. 00047 public variable node "" 00048 00049 ## state of the job. 00050 ## A YadaJob passes a series of states from creation time of this 00051 ## object til its destruction. Possible values are: 00052 ## - created 00053 ## - dequeuing 00054 ## - running 00055 ## - consuming 00056 ## - stopping 00057 private variable _state "created" 00058 00059 ## list of passed states. \see _state 00060 private variable _passedStates "" 00061 00062 # methods ------------------------------------------------------------------ 00063 public method setState {state}; ## \type TclString 00064 public method getState {} 00065 public method getPassedStates {} 00066 public method hasPassedState {state}; ## \type TclString 00067 00068 constructor {args} {}; ## \type TclList 00069 destructor {} 00070 }; 00071 00072 ## ---------------------------------------------------------------------------- 00073 ## constructor 00074 ## ---------------------------------------------------------------------------- 00075 body YadaJob::constructor {args} { 00076 00077 eval configure $args 00078 } 00079 00080 ## ---------------------------------------------------------------------------- 00081 ## destructor 00082 ## ---------------------------------------------------------------------------- 00083 body YadaJob::destructor {} { 00084 if {$process != ""} { 00085 catch {itcl::delete object $process} 00086 } 00087 } 00088 00089 ## ---------------------------------------------------------------------------- 00090 ## setStatus 00091 ## ---------------------------------------------------------------------------- 00092 body YadaJob::setState {state} { 00093 lappend _passedStates $_state 00094 set _state $state 00095 if {0} { 00096 if {$process != ""} { 00097 set printCommand [$process cget -printCommand] 00098 if {$printCommand != ""} { 00099 $printCommand "INFO: $wordgraphName - $_state\n" 00100 } 00101 } 00102 } 00103 } 00104 00105 ## ---------------------------------------------------------------------------- 00106 ## getState 00107 ## ---------------------------------------------------------------------------- 00108 body YadaJob::getState {} { 00109 return $_state 00110 } 00111 00112 ## ---------------------------------------------------------------------------- 00113 ## getPassedStates 00114 ## ---------------------------------------------------------------------------- 00115 body YadaJob::getPassedStates {} { 00116 return $_passedStates 00117 } 00118 00119 ## ---------------------------------------------------------------------------- 00120 ## hasPassedState 00121 ## ---------------------------------------------------------------------------- 00122 body YadaJob::hasPassedState {state} { 00123 return [expr [lsearch $_passedStates $state] >= 0] 00124 }

YADA 2.0-alpha (20 Oct 2004)