Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_test_linux_rocky.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: cmake $GITHUB_WORKSPACE -DFETCH_SPDLOG=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DWITH_PYBIND=OFF
run: cmake $GITHUB_WORKSPACE -DFETCH_SPDLOG=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang

- name: Build every target
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions dpsim/include/dpsim/DataLoggerInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class DataLoggerInterface {

DataLoggerInterface() : mAttributes(){};

virtual ~DataLoggerInterface() = default;

// Start the logger. After starting the number of columns should not be changed.
virtual void start() = 0;
// Stops the logger. Afterwards it should not be used anymore.
Expand Down
2 changes: 2 additions & 0 deletions dpsim/include/dpsim/Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class Interface : public SharedFactory<Interface> {
mLog = CPS::Logger::get("Interface", logLevel);
};

virtual ~Interface() = default;

virtual void open() = 0;
virtual void close() = 0;

Expand Down
25 changes: 19 additions & 6 deletions dpsim/src/pybind/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ void addAttributes(py::module_ m) {
CPS::AttributeBase>(m, "AttributeReal")
.def("get", &CPS::Attribute<CPS::Real>::get)
.def("set", &CPS::Attribute<CPS::Real>::set)
.def("derive_scaled", &CPS::Attribute<CPS::Real>::deriveScaled);
.def("derive_scaled",
py::overload_cast<CPS::Real>(
&CPS::Attribute<CPS::Real>::template deriveScaled<CPS::Real>));

py::class_<CPS::AttributeStatic<CPS::Real>,
CPS::AttributePointer<CPS::AttributeStatic<CPS::Real>>,
Expand All @@ -48,11 +50,22 @@ void addAttributes(py::module_ m) {
CPS::AttributeBase>(m, "AttributeComplex")
.def("get", &CPS::Attribute<CPS::Complex>::get)
.def("set", &CPS::Attribute<CPS::Complex>::set)
.def("derive_real", &CPS::Attribute<CPS::Complex>::deriveReal)
.def("derive_imag", &CPS::Attribute<CPS::Complex>::deriveImag)
.def("derive_mag", &CPS::Attribute<CPS::Complex>::deriveMag)
.def("derive_phase", &CPS::Attribute<CPS::Complex>::derivePhase)
.def("derive_scaled", &CPS::Attribute<CPS::Complex>::deriveScaled);
.def("derive_real",
py::overload_cast<>(
&CPS::Attribute<CPS::Complex>::template deriveReal<>))
.def("derive_imag",
py::overload_cast<>(
&CPS::Attribute<CPS::Complex>::template deriveImag<>))
.def("derive_mag",
py::overload_cast<>(
&CPS::Attribute<CPS::Complex>::template deriveMag<>))
.def("derive_phase",
py::overload_cast<>(
&CPS::Attribute<CPS::Complex>::template derivePhase<>))
.def("derive_scaled",
py::overload_cast<CPS::Complex>(
&CPS::Attribute<CPS::Complex>::template deriveScaled<
CPS::Complex>));

py::class_<CPS::AttributeStatic<CPS::Complex>,
CPS::AttributePointer<CPS::AttributeStatic<CPS::Complex>>,
Expand Down
5 changes: 3 additions & 2 deletions packaging/Docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM fedora:42 AS base

ARG CIM_VERSION=CGMES_2.4.15_16FEB2016
ARG CIMPP_COMMIT=1b11d5c17bedf0ae042628b42ecb4e49df70b2f6
ARG VILLAS_VERSION=825237cb11f687169a9455ecaa97b5dc6cbce26e
ARG VILLAS_VERSION=4df38d26d425117e538ad74bef27e62e353aadc3

ARG CMAKE_OPTS
ARG MAKE_OPTS=-j4
Expand Down Expand Up @@ -66,7 +66,8 @@ RUN dnf -y install \
libwebsockets-devel

# Install optional VILLASnode dependencies
RUN dnf -y install \
RUN dnf -y remove systemd-standalone-tmpfiles || true && \
dnf -y install \
mosquitto-devel \
libconfig-devel \
libnl3-devel \
Expand Down
55 changes: 45 additions & 10 deletions packaging/Docker/Dockerfile.dev-rocky
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM rockylinux:9

ARG CIM_VERSION=CGMES_2.4.15_16FEB2016
ARG CIMPP_COMMIT=1b11d5c17bedf0ae042628b42ecb4e49df70b2f6
ARG VILLAS_VERSION=4df38d26d425117e538ad74bef27e62e353aadc3

ARG CMAKE_OPTS
ARG MAKE_OPTS=-j4
Expand Down Expand Up @@ -40,7 +41,9 @@ RUN dnf -y install \
wget \
libarchive \
openblas-devel \
gcc-gfortran
gcc-gfortran \
coreutils-single \
glib2-devel

# Dependencies
RUN dnf --refresh -y install \
Expand All @@ -61,7 +64,16 @@ RUN dnf -y install \
jansson-devel \
mosquitto-devel \
libjpeg-devel \
zlib-devel
zlib-devel \
protobuf-c-devel \
protobuf-devel \
libmodbus-devel \
librdkafka-devel \
zeromq-devel \
libusb-devel \
lua-devel \
nanomsg-devel \
git-svn

# CUDARPC and dependencies
RUN dnf install -y \
Expand Down Expand Up @@ -90,6 +102,14 @@ RUN dnf -y install \
qt5-qtbase qt5-qtsvg
RUN pip3 install gprof2dot

# Build & Install sundials
RUN cd /tmp && \
git clone --branch v3.2.1 --recurse-submodules --depth 1 https://github.com/LLNL/sundials.git && \
mkdir -p sundials/build && cd sundials/build && \
cmake ${CMAKE_OPTS} .. \
-DCMAKE_BUILD_TYPE=Release && \
make ${MAKE_OPTS} install

# Install CIMpp from source
RUN cd /tmp && \
git clone https://github.com/sogno-platform/libcimpp.git && \
Expand All @@ -116,17 +136,32 @@ RUN cd /tmp && \
-DBUILD_SHARED_LIBS=on && \
make ${MAKE_OPTS} install && rm -rf /tmp/magma-2.6.0

# Install VILLASnode and deps from source
ENV CMAKE_OPTS="${CMAKE_OPTS} \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
-DCMAKE_CUDA_ARCHITECTURES=60;61;70;75"

RUN cd /tmp && \
git clone --recurse-submodules https://github.com/VILLASframework/node.git villas-node && \
cd villas-node && \
git checkout ${VILLAS_VERSION} && \
env MAKE_OPTS="" DEPS_NONINTERACTIVE=1 bash packaging/deps.sh && \
mkdir -p build && cd build && \
cmake ${CMAKE_OPTS} .. \
-DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 \
-DCMAKE_CUDA_FLAGS="-Xcompiler=-Wall,-Werror" && \
make ${MAKE_OPTS} install && \
rm -rf /tmp/villas-node

# CIMpp and VILLASnode are installed here
ENV LD_LIBRARY_PATH="/usr/local/lib64:${LD_LIBRARY_PATH}"

# # Python dependencies
# ADD requirements.txt .
# RUN pip3 install --upgrade wheel build setuptools packaging
# RUN pip3 install -r requirements.txt
# This is a hack: the VILLASnode build system does not install the libraries in the correct location for OpenDSS
RUN echo "/usr/local/openDSSC/bin" > /etc/ld.so.conf.d/opendssc.conf && \
ldconfig

# # Remove this part in the future and use dedicated Jupyter Dockerfile
# # Activate Jupyter extensions
# RUN dnf -y --refresh install npm
# RUN pip3 install jupyter jupyter_contrib_nbextensions nbconvert nbformat
# Python dependencies
COPY requirements.txt requirements.txt
RUN pip3 install --upgrade wheel build setuptools packaging && pip3 install -r requirements.txt

EXPOSE 8888
Loading