Update the status of the job lists. This method moves finished jobs to one of two lists: - self.completed: jobs which completed successfully - self.dead: jobs which finished but died. It also copies those jobs to corresponding _report lists. These lists
(self)
| 209 | return self.status() |
| 210 | |
| 211 | def _update_status(self): |
| 212 | """Update the status of the job lists. |
| 213 | |
| 214 | This method moves finished jobs to one of two lists: |
| 215 | - self.completed: jobs which completed successfully |
| 216 | - self.dead: jobs which finished but died. |
| 217 | |
| 218 | It also copies those jobs to corresponding _report lists. These lists |
| 219 | are used to report jobs completed/dead since the last update, and are |
| 220 | then cleared by the reporting function after each call.""" |
| 221 | |
| 222 | # Status codes |
| 223 | srun, scomp, sdead = self._s_running, self._s_completed, self._s_dead |
| 224 | # State lists, use the actual lists b/c the public names are properties |
| 225 | # that call this very function on access |
| 226 | running, completed, dead = self._running, self._completed, self._dead |
| 227 | |
| 228 | # Now, update all state lists |
| 229 | for num, job in enumerate(running): |
| 230 | stat = job.stat_code |
| 231 | if stat == srun: |
| 232 | continue |
| 233 | elif stat == scomp: |
| 234 | completed.append(job) |
| 235 | self._comp_report.append(job) |
| 236 | running[num] = False |
| 237 | elif stat == sdead: |
| 238 | dead.append(job) |
| 239 | self._dead_report.append(job) |
| 240 | running[num] = False |
| 241 | # Remove dead/completed jobs from running list |
| 242 | running[:] = filter(None, running) |
| 243 | |
| 244 | def _group_report(self,group,name): |
| 245 | """Report summary for a given job group. |