Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
[PROFILER] dont crash if an env var isnt found (#180)
Browse files Browse the repository at this point in the history
* check env vars safely

* changelog
  • Loading branch information
cathalobrien authored Dec 4, 2024
1 parent 65e9267 commit 5c4ac3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Keep it human-readable, your future self will thank you!
## [Unreleased](https://github.com/ecmwf/anemoi-training/compare/0.3.1...HEAD)
### Fixed
- Not update NaN-weight-mask for loss function when using remapper and no imputer [#178](https://github.com/ecmwf/anemoi-training/pull/178)
- Dont crash when using the profiler if certain env vars arent set [#180](https://github.com/ecmwf/anemoi-training/pull/180)

### Added
- Added a check for the variable sorting on pre-trained/finetuned models [#120](https://github.com/ecmwf/anemoi-training/pull/120)
Expand Down
4 changes: 2 additions & 2 deletions src/anemoi/training/train/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def print_title() -> None:

@staticmethod
def print_metadata() -> None:
console.print(f"[bold blue] SLURM NODE(s) {os.environ['HOST']} [/bold blue]!")
console.print(f"[bold blue] SLURM JOB ID {os.environ['SLURM_JOB_ID']} [/bold blue]!")
console.print(f"[bold blue] SLURM NODE(s) {os.getenv('SLURM_JOB_NODELIST', '')} [/bold blue]!")
console.print(f"[bold blue] SLURM JOB ID {os.getenv('SLURM_JOB_ID', '')} [/bold blue]!")
console.print(f"[bold blue] TIMESTAMP {datetime.now(timezone.utc).strftime('%d/%m/%Y %H:%M:%S')} [/bold blue]!")

@rank_zero_only
Expand Down

0 comments on commit 5c4ac3f

Please sign in to comment.