Returns true if this is a distributed job.
(config)
| 263 | |
| 264 | |
| 265 | def _is_distributed(config): |
| 266 | """Returns true if this is a distributed job.""" |
| 267 | if not config.cluster_spec: |
| 268 | return False |
| 269 | |
| 270 | # This is considered a distributed job if there is more than one task |
| 271 | # in the cluster spec. |
| 272 | task_count = 0 |
| 273 | for job in config.cluster_spec.jobs: |
| 274 | for _ in config.cluster_spec.job_tasks(job): |
| 275 | task_count += 1 |
| 276 | |
| 277 | return task_count > 1 |
| 278 | |
| 279 | |
| 280 | def _get_default_schedule(config): |
no test coverage detected