| | 1 | == Pantasks Controller Interactions == |
| | 2 | |
| | 3 | (Up to the [wiki:IPP_Description IPP Description Page]) |
| | 4 | |
| | 5 | Pantasks interacts with a parallel job manager. The current version |
| | 6 | is 'pcontrol', but we would like to allow interactions with condor as |
| | 7 | well. This file documents the pantasks / controller interactions and |
| | 8 | the requirements for implementing a condor (or other) interface. |
| | 9 | |
| | 10 | === Some terminology === |
| | 11 | |
| | 12 | * controller : the abstract concept of the software or system which |
| | 13 | manages parallel jobs for pantasks. |
| | 14 | |
| | 15 | * pcontrol : the default (Ohana-native) controller implementation |
| | 16 | |
| | 17 | === Pantasks Controller Commands === |
| | 18 | |
| | 19 | The following commands are available within the pantasks shell to send |
| | 20 | commands to the controller. Within the pantasks shell, these are |
| | 21 | invoked with "controller (command) [options]". When running the |
| | 22 | pcontrol shell on its own, these commands are called directly. |
| | 23 | |
| | 24 | * check job (jobID) |
| | 25 | * check host (hostID) |
| | 26 | |
| | 27 | check on the status of a single job or host. the jobID or hostID is |
| | 28 | an integer value [1]. The return is a block of information giving the |
| | 29 | status and some other infomation. |
| | 30 | |
| | 31 | For 'host', the return is of the form: |
| | 32 | |
| | 33 | host (state) |
| | 34 | STATUS 1 |
| | 35 | |
| | 36 | where (state) is one of IDLE, BUSY, RESP, DONE, DOWN, OFF. |
| | 37 | |
| | 38 | For 'job', the return is of the form: |
| | 39 | |
| | 40 | STATUS (status) |
| | 41 | EXITST (Nexit) |
| | 42 | STDOUT (Nbytes) |
| | 43 | STDERR (Nbytes) |
| | 44 | DTIME (elapsed time) |
| | 45 | |
| | 46 | where: |
| | 47 | |
| | 48 | (status) is one of PENDING, BUSY, DONE, EXIT, CRASH |
| | 49 | (Nexit) is the exit status of the command (ie, as if it were run on |
| | 50 | the UNIX command line). |
| | 51 | (Nbytes) is the size of the standard out and standard error buffers |
| | 52 | from the job |
| | 53 | (elapsed time) is the number of seconds it took to run the command; |
| | 54 | this is only set on exit. |
| | 55 | |
| | 56 | * exit |
| | 57 | |
| | 58 | Tell the controller to exit. In pantasks, it is necessary to give this command in |
| | 59 | the form 'controller exit TRUE'. |
| | 60 | |
| | 61 | * host [options] : manipulate hosts managed by the controller. The |
| | 62 | following commands may be given: |
| | 63 | |
| | 64 | * host add (hostname) [-threads N] : add a new connection to the host |
| | 65 | (hostname). The optional -threads N argument specifies the default |
| | 66 | value for this machine for the @MAX_THREADS@ directive. A job sent |
| | 67 | to this machine with @MAX_THREADS@ in the command line will have |
| | 68 | that value replaced by "-threads N" for this machine, were N is the |
| | 69 | value specified in this host add command. |
| | 70 | |
| | 71 | * host on (hostname) : tell the controller to activate the specified |
| | 72 | host |
| | 73 | |
| | 74 | * host off (hostname) : tell the contoller to de-activate the |
| | 75 | specified host |
| | 76 | |
| | 77 | * host check (hostname) : check the status of the given host by |
| | 78 | hostname (returns 'host (hostname) is (status)' where (status) is |
| | 79 | one of the list given above for check host |
| | 80 | |
| | 81 | * host retry (hostname) : tell the controller to re-attempt a |
| | 82 | connection to the specified machine NOW (if the connection failed, |
| | 83 | pcontrol attempts to connect with an increasingly long timeout. If |
| | 84 | the timeout is long, but the user knows the machine is now alive, |
| | 85 | they may desire to force a connection attempt sooner rather than |
| | 86 | waiting for the timeout to complete). |
| | 87 | |
| | 88 | * host delete (hostname) : remove the named host from the list of |
| | 89 | managed hosts. |
| | 90 | |
| | 91 | Note that the controller manages connections to host machines by |
| | 92 | name. Multiple connections are not generally tied together -- as far |
| | 93 | as pantasks normally is aware, they are not related. Thus, if a given |
| | 94 | session has N connections to a given machine (host add was called N |
| | 95 | times), then manipulation of the state of the machine may require N |
| | 96 | calls of the same function. (Note that commands which change a |
| | 97 | machine state, such as 'on', 'off', 'delete' only affect machines in |
| | 98 | the appropriate state. eg, 'host on ipp050' is invalid if ipp050 is not |
| | 99 | currently off. |
| | 100 | |
| | 101 | * hoststack (stack) : list the hosts in the given 'stack'. A |
| | 102 | collection of hosts in a given state is called a 'stack' of hosts. |
| | 103 | This command lists all of the hosts in one of the stacks. Stack |
| | 104 | names are case-insensitive and may be one of the following: |
| | 105 | |
| | 106 | * IDLE : machines which are currently unoccupied with processing |
| | 107 | * BUSY : machines which are currently active |
| | 108 | * RESP : machines which are currently active and responding to |
| | 109 | another command |
| | 110 | * DONE : machines which have completed a job, but are not yet ready |
| | 111 | to accept a new job. |
| | 112 | * DOWN : machines which are currently unresponsive (pcontrol will |
| | 113 | try to reconnect after an interval) |
| | 114 | * OFF : machines which are currently off (pcontrol will not try to reconnect) |
| | 115 | |
| | 116 | The response to this command is a list of the machines (a series of |
| | 117 | lines each with ID NAME on a single line). |
| | 118 | |
| | 119 | * jobstack (stack) : list the jobs in the given 'stack'. Like the |
| | 120 | hosts, a collection of jobs in a given state is called a 'stack' of |
| | 121 | jobs. This command lists all of the jobs in one of the stacks. |
| | 122 | Stack names are case-insensitive and may be one of the following |
| | 123 | |
| | 124 | * PENDING : job is waiting for a host |
| | 125 | * BUSY : job is running on a host |
| | 126 | * RESP : job is running on a host, and responding to another command |
| | 127 | * DONE : job has finished, but its completion state has not yet |
| | 128 | been assessed |
| | 129 | * EXIT : job finished with a valid exit status (ie, no abort or segfault) |
| | 130 | * CRASH : job aborted or segfaulted |
| | 131 | * KILL : kill has been requested for the job |
| | 132 | |
| | 133 | * machines : list the status of the hosts by unique machine name. |
| | 134 | This command is one of the few which work with the multiple |
| | 135 | connections to a single named machine as the same connection. The |
| | 136 | command lists the number of connections to the give machine, the |
| | 137 | number of jobs currently running on that host, and the number of |
| | 138 | jobs running on another host which requested the given host. |
| | 139 | |
| | 140 | * parameters : set several pcontrol internal parameters. this |
| | 141 | function lets the user interact with the pcontrol shell and set some |
| | 142 | internal state variables. The 3 currently allowed options are: |
| | 143 | |
| | 144 | * parameters connect_time (time) : set the maximum time a pclient is |
| | 145 | kept alive before pcontrol attempts to reset the connection (time |
| | 146 | in seconds?) |
| | 147 | * parameters wanthost_wait (time) : set the amount of time pcontrol |
| | 148 | will wait before sending a job to a host other than the desired |
| | 149 | host (time in seconds) |
| | 150 | * parameters unwanted_host_jobs (Njobs) : set the number of jobs |
| | 151 | allowed to run which desire a specific host. this parameters |
| | 152 | prevents pcontrol from overloading some specific machine due to |
| | 153 | I/O operations when the process operation is elsewhere. |
| | 154 | |
| | 155 | * output : print the bufers which carry the controller output. when |
| | 156 | pcontrol starts up, the output can be redirected to a file. if it |
| | 157 | is not redirected, it is stored by pantasks. the buffer is not |
| | 158 | normally dumped in a regular fashion, and can fill the pantasks |
| | 159 | memory usage. this command dumps the output to pantasks, and can |
| | 160 | also flush the buffer (if the "flush" option is given). |
| | 161 | |
| | 162 | * run : set the run level for the controller. the command is of the |
| | 163 | form "run (level)". pcontrol may be in one of 4 run levels: |
| | 164 | * all : all normal pcontrol ops (this is aslo set with no optional |
| | 165 | argument to the run command). |
| | 166 | * reap : keep the machines running (maintain comms and turn on/off |
| | 167 | as needed) and harvest results from jobs, but do not spawn |
| | 168 | new jobs. |
| | 169 | * hosts : manage the machines, but do not manage jobs (spawn or |
| | 170 | harvest). |
| | 171 | * none : stop all pcontrol processing |
| | 172 | |
| | 173 | * status : report the current status of the controller: list all |
| | 174 | known jobs and all known hosts, giving their status. |
| | 175 | |
| | 176 | * stop : stop all pcontrol processing (equivalent to "run none") |
| | 177 | |
| | 178 | * verbose : turn on verbose mode for pcontrol (output to pcontrol.log |
| | 179 | or use "controller output"). |
| | 180 | |
| | 181 | * version : print version info for pcontrol |
| | 182 | |
| | 183 | * pulse : in non-threaded pcontrol mode (deprecated), set the |
| | 184 | readline timeout. |
| | 185 | |
| | 186 | |
| | 187 | [1] : note that the command 'controller status' includes the job and |
| | 188 | host ID values in the form X.X.X.X where X is a hexidecimal number. |
| | 189 | Unfortunately, pcontrol does not understand this format for the IDs |
| | 190 | for the 'check' command. |