Skip to content

Commit

Permalink
expose max status checks and wait between tries
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhall88 committed Jun 15, 2022
1 parent b74cabf commit 3198c66
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ This document tracks changes to the `master` branch of the profile.

## [Unreleased]

### Added
- Exposed `max_status_check` and `wait_between_tries` for status checker [[#48][48]]

### Changed
- Cluster cancel is now a script instead of the `bkill` command in order to handle the log file paths that come with the job ID [[#55][55]]

Expand Down Expand Up @@ -94,6 +97,7 @@ This document tracks changes to the `master` branch of the profile.
[36]: https://github.com/Snakemake-Profiles/lsf/issues/36
[39]: https://github.com/Snakemake-Profiles/lsf/issues/39
[45]: https://github.com/Snakemake-Profiles/lsf/issues/45
[48]: https://github.com/Snakemake-Profiles/lsf/issues/48
[55]: https://github.com/Snakemake-Profiles/lsf/issues/55
[0.1.0]: https://github.com/Snakemake-Profiles/lsf/releases/tag/0.1.0
[0.1.1]: https://github.com/Snakemake-Profiles/lsf/releases/tag/0.1.1
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,18 @@ From the `snakemake --help` menu
default is 10, fractions allowed.
```

#### `max_status_checks`

**Default**: `1`

How many times to check the status of a job.

#### `wait_between_tries`

**Default**: `0.001`

How many seconds to wait until checking the status of a job again (if `max_status_checks` is greater than 1).

#### `profile_name`

**Default**: `lsf`
Expand Down
2 changes: 2 additions & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
"default_project": "",
"max_status_checks_per_second": 10,
"max_jobs_per_second": 10,
"max_status_checks": 1,
"wait_between_tries": 0.001,
"profile_name": "lsf"
}
8 changes: 8 additions & 0 deletions {{cookiecutter.profile_name}}/CookieCutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ def get_zombi_behaviour() -> str:
@staticmethod
def get_latency_wait() -> float:
return float("{{cookiecutter.latency_wait}}")

@staticmethod
def get_wait_between_tries() -> float:
return float("{{cookiecutter.wait_between_tries}}")

@staticmethod
def get_max_status_checks() -> int:
return int("{{cookiecutter.max_status_checks}}")
7 changes: 6 additions & 1 deletion {{cookiecutter.profile_name}}/lsf_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ def get_status(self) -> str:
)

lsf_status_checker = StatusChecker(
jobid, outlog, kill_unknown=kill_unknown, kill_zombie=kill_zombie
jobid,
outlog,
kill_unknown=kill_unknown,
kill_zombie=kill_zombie,
wait_between_tries=CookieCutter.get_wait_between_tries(),
max_status_checks=CookieCutter.get_max_status_checks(),
)
print(lsf_status_checker.get_status())

0 comments on commit 3198c66

Please sign in to comment.