...
as you can see, we have to explicitly select version of the actor. An alternative approach would be importing actors by embedding version as a part of package (sort of: from actor_demo.1_0.actor_demo import wrapper
). Anyway, there is no simple way of making the very same workflow to be compatible with different versions of actor without altering workflow's code, environment variables, whatever the way of selecting the version we choose.
One common installation of actor resources
Idea
- To keep all (common) actor resources for both: Python and Kepler actors in one place (directory)
- To allow switching between "workspaces" (user defined sets of actors)
- To load actor libraries only for current version of IMAS (if actor is IMAS dependent)
Layout of actor directory
TBD (the same as previously?)
IMAS Workspace
Final directory structure
Below you can find final suggestion for the Python
based layout
Code Block |
---|
3.25.0 |
Code Block |
workspaces/ |-- workspaceX |-- workspaceY `-- workspaceZ |-- common | |-- actor1 | | `-- lib | | `-- libActor1.so | |-- actor2 | | `-- lib | | - IMAS version `-- libActor2.so coreprofiles2distsources | `-- lib | |-- libActor1.so -> ../actor1/lib/libActor1.so | `-- libActor2.so -> ../actor2/lib/libActor2.so `-- imas |-- 3.23.2 |name of the actor (package for PIP) |`-- actorA 1.0.0 | | `-- lib | | `-- libActorA.so | |-- actorB | | `-- lib - version of the actor (as |specified in |FC2K's project) `|-- libActorB.so coreprofiles2distsources | |-- actorC | | `-- lib | |- name of the actor (as visible `-- libActorC.soinside Python) | `|-- lib __init__.py | |-- libActorA.so -> ../actorA/lib/libActorA.so | |-- libActorB.so -> ../actorB/lib/libActorB.so | - makes an actor a `-- libActorC.so -> ../actorC/lib/libActorC.so module | `|-- 3.24.0code_parameters | | |-- actorAcp_default.xml | | `|-- libcp_user.xml | | `-- cp_schema.xsd `-- libActorA.so | |-- native_wrapper |-- actorB | `-- lib | `-- libActorB.so - all the native elements required |--by actorDactor | | `|-- libbin | | | `|-- libActorD.so coreprofiles2distsourcesF.exe `-- lib - standalone execution |-- libActorA.so -> ../actorA/lib/libActorA.so | | `-- coreprofiles2distsourcesF_opt.exe | | |-- build |-- libActorB.so -> ../actorB/lib/libActorB.so | | |-- lib | | | `|-- libActorD.so -> ../actorD/lib/libActorD.so |
Workspace layout:
- directory
common
- keeps all actors with no IMAS dependencies - directory
imas/$IMAS_VERSION
- keeps all actors build for given version of IMAS - directories
common/lib
andimas/$IMAS_VERSION/lib
- keeps links to libraries (to simplifyLD_LIBRARY_PATH
)
Actor generation:
- Generated code (wrapper) will be saved under
$ACTIVE_WORKSPACE/imas/$IMAS_VERSION/<actor_name>
Switching workspace
LD_LIBRARY_PATH = $ACTIVE_WORKSPACE/common/lib + $ACTIVE_WORKSPACE/imas/$IMAS_VERSION/lib
- java.lib.path = $LD_LIBRARY_PATH
- Kepler: rm target/* ? ant compile?
Scripts:
- list workspaces
- switch workspace
- remove workspace
- create workspace
Open points
...
The whole imas related directory (
$KEPLER/imas
) ?- How to achieve this? Kepler module or just CLASSPATH?
def
| | | | `-- libcore_profiles_2_distribution_sources.a - (do we need this one?)
| | | |-- libcoreprofiles2distsources_def.so - shared libraries
| | | |-- libcoreprofiles2distsources_opt.so
| | | |-- libcoreprofiles2distsources.so
| | | `-- opt
| | | `-- libcore_profiles_2_distribution_sources.a - (do we need this one?)
| | |-- lib_ext
| | | |-- def
| | | `-- opt
| | |-- Makefile - Makefile for building all the native based part
| | `-- src
| | |-- fortrantools.f90 - Fortran based wrappers
| | |-- FortranWrap.f90
| | |-- RWTools.f90
| | `-- standalone.f90
| `-- wrapper.py - this Python code contains Python based actor
|-- MANIFEST.in - required by PIP
|-- README.md - required by PIP
|-- setup.cfg - required by PIP
`-- setup.py - required by PIP |
PyAL modifications
...
Alternative approach: One common installation of actor resources
...