iWrap
iWrap is a modular component generator, implemented in Python, used for creating IMAS actors from physics models. This mechanism allows to integrate physics codes written in one language (Fortran, CPP) within complex computing scenarios designed in other language (e.g. Python).
It's plug-in based modular design with clear separation of concerns allows to generate various types of actors and easily change data access paradigm (from dataset descriptor for AL to direct HDC data for instance)
Available Actor Types
iWrap includes the following built-in actor generators:
- Python Actor: Standard Python actors for straightforward Python integrations
- MUSCLE3 Actors (optional): High-performance multiscale coupling framework
- MUSCLE3-Python: Python code with MUSCLE3 coupling
- MUSCLE3-Cpp: C++ code with MUSCLE3 coupling
- MUSCLE3-Fortran: Fortran code with MUSCLE3 coupling
For user conveniency it provides two kinds of interfaces:
- user friendly graphical interface that allows non-experienced users to define an actor in intuitive way
- command line interface foreseen for more advanced users that may want to e.g. automatise actor generation process using scripts.
Tutorials
To learn about iWrap, please follow tutorials/README.md to generate an interactive and step-by-step tutorial in a Jupyter Notebook.
We have also prepared HTML and Docker versions, so you can choose the one that suits you best.
Installation
Quick Install
Basic Installation (Core Only)
pip install iwrap
This installs iWrap with the standard Python actor generator.
Installation with MUSCLE3 Support
pip install iwrap[muscle3]
This enables MUSCLE3 actor generators (MUSCLE3-Python, MUSCLE3-Cpp, MUSCLE3-Fortran).
Development Installation
pip install iwrap[all]
Installs all optional dependencies including MUSCLE3.
Verify Installation
List available actor types:
iwrap --list-actor-types
Configuration of working environment
Downloading software
git clone https://github.com/iterorganization/iWrap.git
cd iwrap
git checkout <branch>
Environment configuration
To configure an environment, please go to iwrap main directory and execute from commandline:
source set-iter.sh (on ITER IO cluster)
OR
source set-gw.sh (on EF Gateway)
The scripts provide very simple operations. It:
- purges modules
- loads
IMAS - sets
PATHandPYTHONPATH - sets compiler flags like
CXX,FC,MPICXX,MPIFC
Launching iWrap
To launch iWrap, just execute on commandline:
- to run commandline version
iwrap
- to run iWrap user interface
iwrap-gui
Both scripts share the same set arguments and switches:
shell>iwrap -h
usage: iwrap [-h] [-a ACTOR_NAME] [-t ACTOR_TYPE] [-d DATA_TYPE] [-f FILE]
[-i INSTALL_DIR] [--list-actor-types]
[--list-actor-details [ACTOR_TYPE]] [-v]
iWrap - a modular component generator, used for creating IMAS actors from
physics models.
optional arguments:
-h, --help show this help message and exit
Actor generation:
-a ACTOR_NAME, --actor-name ACTOR_NAME
user defined name of the actor
-t ACTOR_TYPE, --actor-type ACTOR_TYPE
type of an actor to be generated
-d DATA_TYPE, --data-type DATA_TYPE
type of data to be used by the actor
-f FILE, --file FILE a path to code/actor description *.yaml file
-i INSTALL_DIR, --install-dir INSTALL_DIR
actor installation directory
Additional information:
--list-actor-types lists registered actor types that can be generated
--list-actor-details [ACTOR_TYPE]
lists details of given actor type generator
-v, --version show program's version number and exit
For more information, visit <https://confluence.iter.org/display/IMP/IMAS+component+generator>.
Actor generation
shell> iwrap -a <actor_name> -f <path/to/code_description.yaml>
... will generate an actor based on code description stored in yaml, where ...
shell> iwrap-gui -a <actor_name> -f <path/to/code_description.yaml>
... will launch iWrap GUI filled in with information coming from code description
Tutorials
iWrap provides its tutorials in two formats:
- interactive Jupyter Notebooks
.ipynb - static nested HTML pages in a book format
.html
Start your tutorial journey by heading to the tutorials directory and opening the README.md file found there (it will explain how to set up and run tutorials in both formats and under different environments).
Manuals
Documentation is available at iwrap.readthedocs.io
Examples
Examples placed in directory iwrap/examples can be an excellent source of knowledge
related to code description syntax, actors API and the way actors are called from workflow.
Introduction
A content of a directory is similar for all examples and consist of:
native_codedirectory - containing a physics model to be wrappedYAMLfile - providing all information essential for iWrap to generate an actor from the native codeMakefilethat simplifies all the steps requires from building a native code to running an example- Python script - containing simple scenario (aka workflow) that allow to run given example
Prerequisites
Following software must be available to run the examples:
- IMAS built with Access Layer of version 4.11 (or later)
- XMLLib library - necessary to build and run actors that wraps code using XML parameters - should be available via pkg-config mechanism
- compiler flags:
CXX,FC,MPICXX,MPIFCmust be set
To simplify setting up a working environment, configuration scripts are available for two of the platforms commonly utilized by IMAS users:
set-iter.shfor the ITER Organisation computing cluster (SDCC)set-gw.(ba)shfor the EUROfusion Gateway
All scripts need to be sourced
Building and running examples
Following steps need to be performed to build and run an example:
-
Jump to example directory:
cd <example_dir>
-
Build the native code:
make native -
Generate a Python actor:
make actor -
Run a simple scenario:
make wf-run
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 iwrap-2.0.0.tar.gz.
File metadata
- Download URL: iwrap-2.0.0.tar.gz
- Upload date:
- Size: 11.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9298a3249f1c122a59011d8bcb6cebc3ec42e8adc83c12bd93fe14ad1940ed19
|
|
| MD5 |
9919a3077b5d5e97db107066d3426ef6
|
|
| BLAKE2b-256 |
99af29ec71b0ff46c53525eee42cb33707cbefd06b9a82652366e78be6072e32
|
Provenance
The following attestation bundles were made for iwrap-2.0.0.tar.gz:
Publisher:
publish.yml on iterorganization/iWrap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iwrap-2.0.0.tar.gz -
Subject digest:
9298a3249f1c122a59011d8bcb6cebc3ec42e8adc83c12bd93fe14ad1940ed19 - Sigstore transparency entry: 2212134796
- Sigstore integration time:
-
Permalink:
iterorganization/iWrap@2d737aaa1f0d81eb346b995d2c81fbc56873fde7 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/iterorganization
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d737aaa1f0d81eb346b995d2c81fbc56873fde7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file iwrap-2.0.0-py3-none-any.whl.
File metadata
- Download URL: iwrap-2.0.0-py3-none-any.whl
- Upload date:
- Size: 222.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef40d0bb3c840298304411628abf22476c06ba4e97936171c64a55f13d97252f
|
|
| MD5 |
5863952c4361b73cb348cf085e5624ba
|
|
| BLAKE2b-256 |
23dd6dd9d12e4868e18f1408ceeb4aeca545dfd9c7bc17d660305d27d1852c77
|
Provenance
The following attestation bundles were made for iwrap-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on iterorganization/iWrap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iwrap-2.0.0-py3-none-any.whl -
Subject digest:
ef40d0bb3c840298304411628abf22476c06ba4e97936171c64a55f13d97252f - Sigstore transparency entry: 2212134813
- Sigstore integration time:
-
Permalink:
iterorganization/iWrap@2d737aaa1f0d81eb346b995d2c81fbc56873fde7 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/iterorganization
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d737aaa1f0d81eb346b995d2c81fbc56873fde7 -
Trigger Event:
push
-
Statement type: