Development
Prerequisites
Optional
- VS Code with the following extensions:
- GitHub CLI
Development Cycle Overview
- Branch
- Develop
cargo build- Develop:
- tests
- implementation
- Document:
mdbook build- output:
automesh/book/build
- output:
mdbook serve --open- interactive mode
- On the local machine, with Firefox, open the
index.htmlfile, e.g.,file:///Users/chovey/autotwin/automesh/book/build/index.html
- Test:
cargo testcargo run// test without required input and output flagscargo run --release -- -i tests/input/f.npy -o foo.exocargo run -- --help
- Pre-commit:
pre-commit run --all-files
- Clean:
cargo clean
cargo doc --open
- Test
maturin develop --release --features python
- Merge Request
Environment Modules
The automesh application can be installed as a service on a High-Performance Computing (HPC) system with the following steps:
Install and Compile Application
automesh must be available and installed to a file location that is accessible by all compute nodes and users who need it.
- Location: Choose a central directory such as
/opt/hpc/or/sw/for theautomeshbinaries, libraries, and associated files. For example, let's assume the install path is/opt/hpc/apps/automesh/0.3.7. - Compilation: Compile
automeshand all its dependencies statically if possible, or ensure all shared libraries (.sofiles) are also included in the installation directory structure.
Create a Module File
The module file, a small script usually written in Tcl or Lua, provides the module load functionality. It tells the shell what changes to make to the user's environment when the module is loaded.
- Location: Module files are placed in a specific directory structure that is scanned by the Environment Modules software (e.g., Lmod or Tcl-based modules). A common path would be
/opt/hpc/modules/automesh/0.3.7.
A typical module file would be something like this:
#%Module
# Define the application name and version
set name automesh
set version 0.3.7
# 1. Prerequisite check (e.g., automesh needs a specific compiler)
# If your app needs a specific compiler, you can ensure it's loaded first:
# prereq gcc/11.2
# 2. Update the PATH variable
# This is the most critical step, allowing the user to run 'automesh' command
prepend-path PATH /opt/hpc/apps/$name/$version/bin
# 3. Update the LD_LIBRARY_PATH variable
# Allows the application to find shared libraries if not statically linked
prepend-path LD_LIBRARY_PATH /opt/hpc/apps/$name/$version/lib
# 4. Define other environment variables (optional)
# For configuration files, data paths, etc.
setenv MYAPP_HOME /opt/hpc/apps/$name/$version
# 5. Provide a short description (optional)
module-whatis "Loads $name $version, a high-performance compute application."
System Configuration
Finally, an HPC administrator needs to ensure that the directory containing the new module file
is known to the module system. The administrator must add the root of your module directory
(e.g., /opt/hpc/modules) to the central module configuration, typically via a command such as:
module use /opt/hpc/modules
This is usually done in a global system profile script so it is active for all users.
End User
Users can discover and load automesh:
- Check for the module:
module avail automesh - Load the service:
module load automesh/0.3.7(ormodule load automeshif it is the default) - Run the program:
automesh --version
References
-
As of Oct 2024,
cmakeis required forhdf5-metno-src v0.9.2, used for writing Exodus II files. On macOS withbrew, install withbrew install cmakeinstead of the GUI installer. ↩