Restructure and test VILLAS examples
Closed this issue · 2 comments
m-mirz commented
All villas related examples should be located in examples/villas and included in the tests if possible.
Examples using old interface can be moved to a villas-deprecated folder.
Focus for the examples should be on:
- MQTT
- simple circuit with import + export
- CIGRE-MV with node voltage export
- new villas interface
JTS22 commented
Overview over which Villas examples actually work (tested on the reorganization
-Branch (PR #94)):
Python / Jupyter Examples
dpsim-file.py
: Works without any interactiondpsim-mqtt.py
: Works, but explicitly waits for input data from MQTTdpsim-mqtt-import-export.py
: Works, but does not wait for input data from MQTTdpsim-mqtt-import-export-MIMO.py
: Segfaults after about 3 secondsshmem-distributed-reference.py
: Works (but also does not use any interfaces, as intended)shmem-distributed-villas.py
: Runs til the end, but produces an error when stopping villas. All log files remain empty, so no correct results are written:Opening shared memory interface failed (ret=-8): No such file or directory villas-node: /tmp/villasnode/lib/super_node.cpp:436: villas::node::SuperNode::~SuperNode(): Assertion `state == State::INITIALIZED || state == State::PARSED || state == State::CHECKED || state == State::STOPPED || state == State::PREPARED' failed. Traceback (most recent call last): File "/dpsim/examples/villas/shmem-distributed-villas.py", line 170, in <module> p_villas.join()
test_shmem_cigre_mv_pf_profiles.py
: Starts up VillasNode and then immediately segfaultstest_shmem_distributed_direct.py
: Uses the old dpsim-Python interface and therefore does not run at alltest_shmem_import_export.py
: Starts up and segfaults after about a secondShmemExample.ipynb
: The first cell runs but finishes with an error, the following cell cannot find the required log files:12:54:52 info node This is VILLASnode v0.11.0-b94746e-release (built on Jul 5 2022, 15:08:48) 12:54:52 info signals Initialize subsystem 12:54:52 info config Reading configuration from local file: /tmp/tmp.pCdHd59j7J 12:54:52 info memory Initialize memory sub-system: #hugepages=100 12:54:52 warn memory:mmap Running in an unprivileged environment. Hugepages are not used! 12:54:52 warn memory Running in an unprivileged environment. Memory is not locked to RAM! 12:54:52 info kernel:rt Initialize sub-system 12:54:52 warn kernel:rt We recommend to use an PREEMPT_RT patched kernel! 12:54:52 warn kernel:rt You might want to use the 'priority' setting to increase 's process priority 12:54:52 warn kernel:rt You might want to use the 'affinity' setting to pin to dedicate CPU cores 12:54:52 info node:shmem Initialized node type which is used by 1 nodes 12:54:52 info node:file Initialized node type which is used by 2 nodes 12:54:52 info api Starting sub-system 12:54:52 info web Starting sub-system 12:54:52 info api Started worker 12:54:52 err lws ERROR on binding fd 14 to port 80 (-1 98) 12:54:52 err lws init server failed 12:54:52 warn web Failed to setup vhost. Trying another port: 81 12:54:52 err lws ERROR on binding fd 14 to port 81 (-1 98) 12:54:52 err lws init server failed 12:54:52 warn web Failed to setup vhost. Trying another port: 82 12:54:52 info web Started worker Error while terminating subprocess (pid=83557):
ShmemDistributedDirect.ipynb
: Relative paths are wrong so the first cell does not runcigre-mv-pf-profiles-shmem.ipynb
: Simulation setup works, but the kernel crashes onsim.run()
Cpp Examples
FileExample.cpp
: Starts up then throws astd::exception
without any further descriptionMqttExample.cpp
: Works, but explicitly waits for input data from MQTTShmemExample.cpp
Only starts up when run on its own, but then awaits some input. When started viaconfigs/start_ShmemExample.sh
, it runs forever without producing any useful logs, outputting an error on KeyboardInterrupt:13:16:39 err node Opening shared memory interface failed (ret=-8): No such file or directory villas-node: /tmp/villasnode/lib/super_node.cpp:436: villas::node::SuperNode::~SuperNode(): Assertion `state == State::INITIALIZED || state == State::PARSED || state == State::CHECKED || state == State::STOPPED || state == State::PREPARED' failed. 13:16:39 err node Opening shared memory interface failed (ret=-8): No such file or directory villas-node: /tmp/villasnode/lib/super_node.cpp:436: villas::node::SuperNode::~SuperNode(): Assertion `state == State::INITIALIZED || state == State::PARSED || state == State::CHECKED || state == State::STOPPED || state == State::PREPARED' failed. configs/start_ShmemExample.sh: line 69: 108105 Aborted (core dumped) villas-node ${CONFIG}
Shmem_CIGRE_MV_PowerFlowTest_LoadProfiles.cpp
: Immediately crashes with FileNotFound ErrorShmem_CIGRE_MV_PowerFlowTest.cpp
: Immediately crashes with FileNotFound ErrorShmem_WSCC-9bus_Ctrl.cpp
: Immediately crashes with FileNotFound ErrorShmem_WSCC-9bus_CtrlDist.cpp
: Ends immediately with no output whatsoeverShmem_WSCC-9bus.cpp
: Immediately crashes with FileNotFound ErrorShmemControllableFiltSource.cpp
: Immediately crashes with a CPS::TypeException and no further informationShmemControllableSource.cpp
: Opens the interface, then immediately segfaultsShmemDistributedDirect.cpp
: Segfaults immediately for individual runs as well as for the start via theconfigs/start_ShmemDistributedDirect.sh
script.ShmemDistributedReference.cpp
: Works (but also does not use any interfaces, as intended)ShmemDistributedVillas.cpp
: Segfaults immediately for both inputs 0 and 1ShmemExample.cpp
: Segfaults immediately
Summary
4/9 Python, 0/3 Jupyter, and 2/14 Cpp Examples actually work the way they are supposed to (and two of the working ones do not even use the Villas interface).
leonardocarreras commented