Skip to content

Commit

Permalink
Add documentation related to CABLE local checkout and benchcab clean
Browse files Browse the repository at this point in the history
  • Loading branch information
abhaasgoyal committed Mar 5, 2024
1 parent a9f9638 commit 573adc9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
10 changes: 8 additions & 2 deletions benchcab/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,18 @@ def generate_parser(app: Benchcab) -> argparse.ArgumentParser:
help="Cleanup files created by running benchcab.",
description="""Removes src/ and runs/ directories, along with log files in the
project root directory. The user has to specify which stage of files to remove
via \{all, realisations, submissions\} subcommand""",
via \{all, realisations, submissions\} subcommand.""",
add_help=False,
)

parser_clean.add_argument(
"clean_option", choices=["all", "realisations", "submissions"]
"clean_option",
choices=["all", "realisations", "submissions"],
help="""Can be one of three options:
submissions: deletes src/ and revision log files
realisations: deletes runs/ and benchmark submission files
all: deletes in both stages of submissions and realisations""",
)

parser_clean.set_defaults(func=app.clean)
Expand Down
15 changes: 15 additions & 0 deletions docs/user_guide/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,21 @@ realisations:

: **Default:** URL of the [CABLE GitHub repository][cable-github], _optional key_. :octicons-dash-24: Specify the GitHub repository url to clone from when checking out the branch.

#### [`local`](#+repo.local){ #+repo.local}

Contains settings to specify CABLE checkouts on a local repository.

```yaml
realisations:
- repo:
local:
path: /scratch/tm70/ab1234/CABLE
```

[`path`](#+repo.local.path){ #+repo.local.path}

: **Default:** _required key, no default_. :octicons-dash-24: Specify the local checkout path of CABLE branch.

### [name](#name)

: **Default:** base name of [branch_path](#+repo.svn.branch_path) if an SVN repository is given, for Git repositories the default is the branch name, _optional key_. :octicons-dash-24: An alias name used internally by `benchcab` for the branch. The `name` key also specifies the directory name of the source code when retrieving from SVN or GitHub.
Expand Down
6 changes: 6 additions & 0 deletions docs/user_guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ The tool will follow the steps:
3. Setup and launch a PBS job to run the flux site simulations in parallel. When `benchcab` launches the PBS job, it will print out the job ID to the terminal. You can check the status of the job with `qstat`. `benchcab` will not warn you when the simulations are over.
4. Setup and run an ensemble of offline spatial runs using the [`payu`][payu-github] framework.

!!! info
In case the code branches are already checked out before running Step (1) - `benchcab` will fail. This could happen on re-runs of `benchcab`. In that case, run `benchcab clean realisations` before the `checkout` step.

!!! warning
It is dangerous to delete `src/` via `rm -rf`, since `src/` may contain symlinks to local directories that could also be affected. Use `benchcab clean realisations` instead, which would also delete unecessary log files like `rev_number-*.log`.

!!! tip "Expected output"

You can see [an example of the expected output](expected_output.md) printed out to the screen by `benchcab run` to check if the tool has worked as expected.
Expand Down

0 comments on commit 573adc9

Please sign in to comment.