Connector to allow you to easily add Simvue tracking and monitoring to MOOSE (Multiphysics Object Oriented Simulation Environment) simulations.
Project description
Simvue Connectors - MOOSE
Allow easy connection between Simvue and MOOSE (Multiphysics Object Oriented Simulation Environment), allowing for easy tracking and monitoring of physics simulations in real time.
Website • Documentation
Implementation
A customised MooseRun class has been created which automatically does the following:
- Uploads the MOOSE input file and application Makefile as input artifacts
- Launches the MOOSE simulation as a process, triggering an alert if it encounters an error or exception
- Uploads information from the MOOSE input file as metadata
- Uploads information from the top of the console log (MOOSE version, parallelism information, mesh information etc) as metadata
- Uploads key information from the console log as events
- Creates an alert which notifies the user if a step fails to converge
- Uploads any variable values being written to CSV files as metrics
- Adds relevant metadata and tags to the run if the MOOSE Terminator stopped the run early
- Once complete, upload the any output files as artifacts
Installation
To install and use this connector, first create a virtual environment:
python -m venv venv
Then activate it:
source venv/bin/activate
And then use pip to install this module:
pip install simvue-moose
Configuration
The service URL and token can be defined as environment variables:
export SIMVUE_URL=...
export SIMVUE_TOKEN=...
or a file simvue.toml can be created containing:
[server]
url = "..."
token = "..."
The exact contents of both of the above options can be obtained directly by clicking the Create new run button on the web UI. Note that the environment variables have preference over the config file.
Usage example
from simvue_moose.connector import MooseRun
...
if __name__ == "__main__":
...
# Using a context manager means that the status will be set to completed automatically,
# and also means that if the code exits with an exception this will be reported to Simvue
with MooseRun() as run:
# Specify a run name, along with any other optional parameters:
run.init(
name = 'my-moose-simulation', # Run name
metadata = {'initial_temp': 30}, # Metadata
tags = ['moose', 'conduction'], # Tags
description = 'MOOSE simulation of thermal conduction.', # Description
folder = '/moose/conduction/coffee_cup' # Folder path
)
# Set folder details if necessary
run.set_folder_details(
metadata = {'mesh': 'coffee_cup'}, # Metadata
tags = ['moose'], # Tags
description = 'MOOSE simulations of thermal conduction' # Description
)
# Can use the base Simvue Run() methods to upload extra information, eg:
run.save_file(os.path.abspath(__file__), "code")
# Can add alerts specific to your simulation, eg:
run.create_metric_threshold_alert(
name="temperature_above_eighty", # Name of Alert
metric="temperature", # Metric to monitor
frequency=1, # Frequency to evaluate rule at (mins)
rule="is above", # Rule to alert on
threshold=80, # Threshold to alert on
notification='email', # Notification type
trigger_abort=True # Abort simulation if triggered
)
# Launch the MOOSE simulation
run.launch(
moose_application_path='path/to/my/moose/app', # Path to MOOSE application
moose_file_path='path/to/my/input_file.i', # Path to MOOSE input file
track_vector_postprocessors=True, # Whether to track vector postprocessors
track_vector_positions=False, # Whether to track positions of vectors
run_in_parallel=True, # Whether to run in parallel using MPI
num_processors=2 # Number of cores to use if in parallel
)
License
Released under the terms of the Apache 2 license.
Citation
To reference Simvue, please use the information outlined in this citation file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simvue_moose-1.0.0.tar.gz.
File metadata
- Download URL: simvue_moose-1.0.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12afa9e791f0649056222eacf73683f11581fa0b8d09ce3da9c0a9887e6f4502
|
|
| MD5 |
03e93f8f0da087cb082fb62239df51a1
|
|
| BLAKE2b-256 |
5a6be466ea87f627bb03f8c3e2aa9ac932478b7f6639e84456d30cf63fda7fcc
|
Provenance
The following attestation bundles were made for simvue_moose-1.0.0.tar.gz:
Publisher:
deploy.yaml on simvue-io/connectors-moose
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simvue_moose-1.0.0.tar.gz -
Subject digest:
12afa9e791f0649056222eacf73683f11581fa0b8d09ce3da9c0a9887e6f4502 - Sigstore transparency entry: 178690471
- Sigstore integration time:
-
Permalink:
simvue-io/connectors-moose@7d3e7134c1975d5b1ae7e3318b227bfb1eb4ddd8 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/simvue-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@7d3e7134c1975d5b1ae7e3318b227bfb1eb4ddd8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file simvue_moose-1.0.0-py3-none-any.whl.
File metadata
- Download URL: simvue_moose-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b092065ff391092a0dd2dbb7623ced83d7ddb859fd7fc1ffa9cea06de5ef2358
|
|
| MD5 |
79be44548039cdd37245e19c467222bd
|
|
| BLAKE2b-256 |
c6fc3278fa8f3c898447ddcf7a3aff4a6c328de7c3ec5745ff1fe6cb8bf0105d
|
Provenance
The following attestation bundles were made for simvue_moose-1.0.0-py3-none-any.whl:
Publisher:
deploy.yaml on simvue-io/connectors-moose
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simvue_moose-1.0.0-py3-none-any.whl -
Subject digest:
b092065ff391092a0dd2dbb7623ced83d7ddb859fd7fc1ffa9cea06de5ef2358 - Sigstore transparency entry: 178690472
- Sigstore integration time:
-
Permalink:
simvue-io/connectors-moose@7d3e7134c1975d5b1ae7e3318b227bfb1eb4ddd8 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/simvue-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yaml@7d3e7134c1975d5b1ae7e3318b227bfb1eb4ddd8 -
Trigger Event:
push
-
Statement type: