Skip to content

Commit

Permalink
Merge pull request #1547 from GMLC-TDC/develop
Browse files Browse the repository at this point in the history
2.6.0 release
  • Loading branch information
phlptp authored Aug 20, 2020
2 parents badf0ad + 7821c51 commit 7423839
Show file tree
Hide file tree
Showing 405 changed files with 4,574 additions and 1,404 deletions.
16 changes: 16 additions & 0 deletions .github/actions/benchmark-build/benchmark-Linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# This uses bash variable substitution in a few places
# 1. getting the cmake directory for running cpack with an absolute path (chocolatey has an unfortunately named alias)

#wget --quiet -O cmake-install.sh https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-Linux-x86_64.sh && chmod +x cmake-install.sh
#sudo ./cmake-install.sh --prefix=/usr/local --exclude-subdir --skip-license
#rm cmake-install.sh

mkdir build && cd build || exit
cmake -DCMAKE_BUILD_TYPE=Release -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ENABLE_PACKAGE_BUILD=ON -DSTATIC_STANDARD_LIB=static -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=OFF -DHELICS_BUILD_BENCHMARKS=ON -DBUILD_TESTING=OFF ..
cmake --build . --config Release
cpack_dir="$(command -v cmake)"
cpack_dir="${cpack_dir%/cmake}"
"${cpack_dir}/cpack" -G "${CPACK_GEN}" -C Release -B "$(pwd)/../artifact"
cd ../artifact || exit
rm -rf _CPack_Packages
16 changes: 16 additions & 0 deletions .github/actions/benchmark-build/benchmark-Windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# This uses bash variable substitution in a few places
# 1. replacing x86 with Win32 (setting the Python version uses x86)
# 2. getting the cmake directory for running cpack with an absolute path (chocolatey has an unfortunately named alias)

echo "Building ${CPACK_GEN} installer with ${BUILD_GEN} for ${BUILD_ARCH}"
BOOST_ROOT="${BOOST_ROOT_1_72_0}"
export BOOST_ROOT
mkdir build && cd build || exit
cmake -G "${BUILD_GEN}" -A "${BUILD_ARCH/x86/Win32}" -DCMAKE_BUILD_TYPE=Release -DHELICS_ENABLE_PACKAGE_BUILD=ON -DSTATIC_STANDARD_LIB=static -DHELICS_USE_ZMQ_STATIC_LIBRARY=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=OFF -DHELICS_BUILD_BENCHMARKS=ON -DBUILD_TESTING=OFF ..
cmake --build . --config Release
cpack_dir="$(command -v cmake)"
cpack_dir="${cpack_dir%/cmake}"
"${cpack_dir}/cpack" -G "${CPACK_GEN}" -C Release -B "$(pwd)/../artifact"
cd ../artifact || exit
rm -rf _CPack_Packages
13 changes: 13 additions & 0 deletions .github/actions/benchmark-build/benchmark-macOS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# This uses bash variable substitution in a few places
# 1. getting the cmake directory for running cpack with an absolute path (chocolatey has an unfortunately named alias)

brew install boost
mkdir build && cd build || exit
cmake -DCMAKE_BUILD_TYPE=Release -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ENABLE_PACKAGE_BUILD=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=OFF -DHELICS_BUILD_BENCHMARKS=ON -DBUILD_TESTING=OFF ..
cmake --build . --config Release
cpack_dir="$(command -v cmake)"
cpack_dir="${cpack_dir%/cmake}"
"${cpack_dir}/cpack" -G "${CPACK_GEN}" -C Release -B "$(pwd)/../artifact"
cd ../artifact || exit
rm -rf _CPack_Packages
95 changes: 95 additions & 0 deletions .github/workflows/benchmark-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Build benchmarks

on:
workflow_dispatch:
inputs:
webhook:
description: 'Webhook to call with the completed workflow run id'
required: false
schedule:
- cron: '15 09 * * */2' # Run at in the early hours of the morning every other day of the week (UTC)

jobs:
#####################################
# Build benchmarks
#####################################
build-benchmarks:
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.cpack_gen }} Benchmarks
strategy:
matrix:
id: [windows-x64, macos-x64, linux-x64]
include:
- id: windows-x64
os: windows-latest
arch: x64
cpack_gen: ZIP
cmake_gen: 'Visual Studio 16 2019'
msvc_ver: 'msvc2019'
- id: macos-x64
os: macos-latest
arch: x64
cpack_gen: ZIP
macos_target_ver: '10.9'
- id: linux-x64
os: ubuntu-latest
arch: x64
cpack_gen: TGZ

steps:
- name: Checkout event ref
uses: actions/checkout@v2
if: github.event_name != 'schedule'

- name: Checkout develop branch
uses: actions/checkout@v2
with:
ref: develop
if: github.event_name == 'schedule'

# Setup a copy of the macOS SDK
- name: Setup macOS SDK
if: runner.os == 'macOS'
run: ./.github/actions/setup-macos-10.9-sdk.sh

# Compile HELICS and create the benchmark package
- name: Build benchmarks
if: runner.os != 'Linux'
env:
BUILD_ARCH: ${{ matrix.arch }}
BUILD_GEN: ${{ matrix.cmake_gen }}
MSVC_VER: ${{ matrix.msvc_ver }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_target_ver }}
CPACK_GEN: ${{ matrix.cpack_gen }}
shell: bash
run: ./.github/actions/benchmark-build/benchmark-${{ runner.os }}.sh

- name: Build benchmarks (container)
if: runner.os == 'Linux'
uses: ./.github/actions/linux-release-builder
with:
script: ./.github/actions/benchmark-build/benchmark-${{ runner.os }}.sh

# GitHub Actions combines artifacts uploaded with the same name
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-benchmarks
path: artifact


#####################################
# Call webhook for finished build
#####################################
benchmark-build-complete-webhook:
name: Call webhook to notify of the finished benchmark build
needs: [build-benchmarks]
runs-on: ubuntu-latest
if: github.event.inputs.webhook
steps:
- name: Call webhook
run: |
curl -X POST --header 'authorization: Bearer ${{ secrets.BM_BUILD_SECRET }}' \
--url ${{ github.event.inputs.webhook }} \
--header 'content-type: application/json' \
--data "{\"id\":\"${{ github.run_id }}\"}"
2 changes: 2 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- name: set PY
run: echo "::set-env name=PY::$(python --version --version | sha256sum | cut -d' ' -f1)"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/swig-interface-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run SWIG
run: |
rm -rf interfaces/*/interface/*
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
[submodule "ThirdParty/netif"]
path = ThirdParty/netif
url = https://github.com/GMLC-TDC/netif.git
[submodule "ThirdParty/spdlog"]
path = ThirdParty/spdlog
url = https://github.com/gabime/spdlog.git
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,43 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
A note on future revisions.
Everything within a major version number should be code compatible (with the exception of experimental interfaces). The most notable example of an experimental interface is the support for multiple source inputs. The APIs to deal with this will change in future minor releases. Everything within a single minor release should be network compatible with other federates on the same minor release number. Compatibility across minor release numbers may be possible in some situations but we are not going to guarantee this as those components are subject to performance improvements and may need to be modified at some point. Patch releases will be limited to bug fixes and other improvements not impacting the public API or network compatibility. Check the [Public API](./docs/Public_API.md) for details on what is included and excluded from the public API and version stability.

## [2.6.0][] ~ 2020-08-20

Bug fixes and major logging update

### Changed

- The build flag function now returns correct debug or release flags depending on the build
- The debug postfix `d` is no longer added to the interface libraries
- Spdlog is now being used for logging inside HELICS and the old logger has been removed this results in fewer thread being generated by HELICS.
- CMake will now error if the install directory is set to the build directory
- Some argument names in the C API have been changed for consistency
- Output a more descriptive error message for mismatched data sizes when converting types #1521
- Some C++98 API functions were added and changed for consistency, specifically endpoint get type no returns a `char *` instead of std::string, and a getCurrentTime function was added to `Federate`
- logging level properties from a federateInfo structure will be inherited by a core for the first registered federate

### Fixed

- String with negative numerical values were not acknowledging the negation Issue #1306
- Config file parsing was not acknowledging "unit" string #1512
- A performance issue with the tcpss and tcp cores in some cases has been resolved by setting the no_delay option
- Inconsistency in type returned by endpoint getType in C++98 API #1523
- a potential segmentation fault when calling some methods in the C shared library after calling helicsCloseLibrary

### Added

- Flags for `dumplog` and `force_logging_flush` were added to the C API
- Added missing C++98 call to `getCurrentTime`
- Added `closeLibrary` function to the C++98 API
- Added a Python benchmark file
- An option to install the benchmark executables has been added
- Data logging output for both send and receive of messages
- A GitHub Actions workflow to build packages for Linux with the benchmark executables

### Removed

- The previous logger including logger.h has been replaced with spdlog

## [2.5.2][] ~ 2020-06-15

Bug fix release for some build issues and a fix to the `wait_for_current_time` flag
Expand Down Expand Up @@ -734,3 +771,4 @@ This is a major revision so this changelog will not capture all the changes that
[2.5.0]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.5.0
[2.5.1]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.5.1
[2.5.2]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.5.2
[2.5.2]: https://github.com/GMLC-TDC/HELICS/releases/tag/v2.6.0
31 changes: 26 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ else()
cmake_policy(VERSION 3.17)
endif()

project(HELICS VERSION 2.5.2)
project(HELICS VERSION 2.6.0)

# -----------------------------------------------------------------------------
# HELICS Version number
# -----------------------------------------------------------------------------
set(HELICS_VERSION_BUILD)
# use ISO date YYYY-MM-DD
set(HELICS_DATE "2020-06-14")
set(HELICS_DATE "2020-08-20")

set(HELICS_VERSION_UNDERSCORE
"${HELICS_VERSION_MAJOR}_${HELICS_VERSION_MINOR}_${HELICS_VERSION_PATCH}"
Expand Down Expand Up @@ -100,6 +100,18 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND CMAKE_PROJECT_NAME STREQUAL P
endif(WIN32)
endif()

# Check to make sure the install prefix isn't the build folder, if it is, build errors will happen
get_filename_component(tmp_install_prefix ${CMAKE_INSTALL_PREFIX} REALPATH)
get_filename_component(tmp_proj_bindir ${PROJECT_BINARY_DIR} REALPATH)
# Windows paths are case insensitive
if(WIN32)
string(TOLOWER "${tmp_install_prefix}" tmp_install_prefix)
string(TOLOWER "${tmp_proj_bindir}" tmp_proj_bindir)
endif()
if(tmp_install_prefix STREQUAL tmp_proj_bindir)
message(FATAL_ERROR "CMAKE_INSTALL_PREFIX must not be set to the build folder")
endif()

if(MSYS
OR CYGWIN
OR UNIX
Expand Down Expand Up @@ -244,9 +256,6 @@ add_library(HELICS::compile_flags_target ALIAS compile_flags_target)
add_library(HELICS::build_flags_target ALIAS build_flags_target)

get_target_property(EXTRA_BUILD_FLAGS build_flags_target INTERFACE_COMPILE_OPTIONS)
set(HELICS_BUILD_FLAGS_OUTPUT
"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_STATIC_LINKER_FLAGS} ${EXTRA_BUILD_FLAGS} "
)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(NOT USE_LIBCXX)
Expand Down Expand Up @@ -380,6 +389,9 @@ if(NOT HELICS_DISABLE_GIT_OPERATIONS)
submod_update(ThirdParty/netif)
endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/spdlog/CMakeLists.txt")
submod_update(ThirdParty/spdlog)
endif()
check_submodule_status()

endif() # NOT HELICS_DISABLE_GIT_OPERATIONS
Expand Down Expand Up @@ -649,6 +661,12 @@ include(addfmt)
include(addJsoncpp)
add_library(HELICS::jsoncpp_lib ALIAS jsoncpp_lib)

# --------------------------------------------------------------
# Create the target for spdlog
# -----------------------------------------------------------
include(addSpdlog)
add_library(HELICS::spdlog ALIAS spdlog)

# --------------------------------------------------------------
# Create the target for unitslib
# -----------------------------------------------------------
Expand Down Expand Up @@ -980,6 +998,7 @@ if(HELICS_ENABLE_PACKAGE_BUILD)
java
octave
csharp
benchmarks
cereal
)
if(WIN32)
Expand All @@ -994,6 +1013,7 @@ if(HELICS_ENABLE_PACKAGE_BUILD)
set(CPACK_COMPONENT_LIBS_DISPLAY_NAME "Libraries")
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Headers")
set(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Runtime Libraries")
set(CPACK_COMPONENT_BENCHMARKS_DISPLAY_NAME "Benchmarks")
set(CPACK_COMPONENT_SWIG_DISPLAY_NAME "SWIG")
set(CPACK_COMPONENT_JAVA_DISPLAY_NAME "Java")
set(CPACK_COMPONENT_PYTHON_DISPLAY_NAME "Python")
Expand Down Expand Up @@ -1021,6 +1041,7 @@ if(HELICS_ENABLE_PACKAGE_BUILD)
set(CPACK_COMPONENT_LIBS_DESCRIPTION "Libraries for compiling and linking with HELICS")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION "Headers for linking and compiling with HELICS")
set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Runtime libraries for HELICS")
set(CPACK_COMPONENT_BENCHMARKS_DESCRIPTION "Benchmark applications for HELICS")
set(CPACK_COMPONENT_CEREAL_DESCRIPTION
"cereal C++11 serialization library [no support for other language interfaces]"
)
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ If you would like to contribute to the HELICS project see [CONTRIBUTING](CONTRIB
- [Jacob Hansen](https://github.com/Jacobhansens)
- [Marc Eberlein](https://github.com/eberleim)
- [Shrirang Abhyankar](https://github.com/abhyshr)
- [Corrine Roth](https://github.com/corinnegroth)

### Lawrence Livermore National Lab

Expand Down Expand Up @@ -98,6 +99,10 @@ A library that provides runtime unit values, instead of individual unit types, f

The cereal library is used for serialization of messages sent around inside HELICS. A modified version of cereal is included in the HELICS source and licensed under the [BSD-3 clause](https://github.com/USCiLab/cereal/blob/master/LICENSE) license. The modifications include modifying the headers to use relative paths instead of absolute so it can be included in different locations.

### [spdlog](https://https://github.com/gabime/spdlog)

Very fast, header-only/compiled, C++ logging library. The spdlog library is used for logging. It is included in HELICS as a submodule and is released under a [MIT](https://github.com/gabime/spdlog/blob/v1.x/LICENSE) license.

### [FNCS](https://github.com/FNCS/fncs), [IGMS](https://www.nrel.gov/docs/fy16osti/65552.pdf), and FSKIT

While not used directly, much of the inspiration for HELICS comes from three separate projects at the different National Labs. These include FNCS at PNNL, FSKIT at LLNL(unreleased), and IGMS(unreleased) at NREL. The lessons learned from these three co-simulation platforms was fed directly into the design of HELICS, and the hope that the combination and partnership is better than any one lab could have accomplished on their own.
Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/fmtlib
Submodule fmtlib updated 61 files
+1 −0 .gitignore
+47 −28 CMakeLists.txt
+334 −5 ChangeLog.rst
+112 −119 README.rst
+2 −1 doc/CMakeLists.txt
+6 −7 doc/_templates/layout.html
+60 −55 doc/api.rst
+3 −3 doc/build.py
+1 −1 doc/index.rst
+2 −2 doc/syntax.rst
+66 −62 include/fmt/chrono.h
+35 −37 include/fmt/color.h
+173 −103 include/fmt/compile.h
+537 −444 include/fmt/core.h
+114 −64 include/fmt/format-inl.h
+1,140 −1,068 include/fmt/format.h
+16 −16 include/fmt/locale.h
+64 −6 include/fmt/os.h
+37 −13 include/fmt/ostream.h
+1 −1 include/fmt/posix.h
+93 −63 include/fmt/printf.h
+35 −36 include/fmt/ranges.h
+29 −136 src/format.cc
+13 −12 src/os.cc
+1 −0 support/Vagrantfile
+26 −0 support/cmake/JoinPaths.cmake
+2 −2 support/cmake/fmt.pc.in
+26 −2 support/manage.py
+2 −1 test/chrono-test.cc
+1 −0 test/color-test.cc
+48 −25 test/compile-test.cc
+100 −84 test/core-test.cc
+7 −5 test/custom-formatter-test.cc
+81 −87 test/format
+42 −46 test/format-impl-test.cc
+166 −278 test/format-test.cc
+9 −4 test/fuzzing/README.md
+2 −2 test/fuzzing/chrono_duration.cpp
+2 −2 test/fuzzing/main.cpp
+5 −5 test/fuzzing/named_arg.cpp
+3 −3 test/fuzzing/one_arg.cpp
+2 −2 test/fuzzing/sprintf.cpp
+2 −2 test/fuzzing/two_args.cpp
+7 −0 test/gmock-gtest-all.cc
+26 −22 test/gtest-extra-test.cc
+3 −3 test/gtest-extra.cc
+5 −3 test/gtest-extra.h
+19 −16 test/locale-test.cc
+4 −4 test/mock-allocator.h
+62 −40 test/os-test.cc
+39 −22 test/ostream-test.cc
+10 −10 test/posix-mock-test.cc
+67 −60 test/printf-test.cc
+18 −5 test/ranges-test.cc
+4 −2 test/scan-test.cc
+17 −16 test/scan.h
+3 −2 test/std-format-test.cc
+1 −0 test/test-assert.h
+1 −0 test/test-main.cc
+1 −0 test/util.cc
+1 −1 test/util.h
1 change: 1 addition & 0 deletions ThirdParty/spdlog
Submodule spdlog added at 616caa
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
clone_depth: 1

version: 2.5.2.{build}
version: 2.6.0.{build}

image: Visual Studio 2015

Expand Down
13 changes: 11 additions & 2 deletions benchmarks/helics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,20 @@ foreach(T ${HELICS_BENCHMARKS})
target_compile_definitions(
${T} PRIVATE "HELICS_BENCHMARK_SHIFT_FACTOR=(${HELICS_BENCHMARK_SHIFT_FACTOR})"
)
install(TARGETS ${T} ${HELICS_EXPORT_COMMAND} DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT benchmarks
)
endforeach()

add_executable(helics_benchmarks BenchmarkMain.cpp BenchmarkFederate.hpp)
target_link_libraries(helics_benchmarks PUBLIC helics_application_api)
set_target_properties(helics_benchmarks PROPERTIES FOLDER benchmarks_multimachine)
foreach(T ${HELICS_MULTINODE_BENCHMARKS})
target_sources(helics_benchmarks PUBLIC ${T}.hpp)
target_sources(helics_benchmarks PRIVATE ${T}.hpp)
endforeach()
install(TARGETS helics_benchmarks ${HELICS_EXPORT_COMMAND} DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT benchmarks
)

if(NOT HELICS_DISABLE_C_SHARED_LIB)
add_executable(echoBenchmarks_c echoBenchmarks_c.cpp)
Expand All @@ -80,7 +86,10 @@ if(NOT HELICS_DISABLE_C_SHARED_LIB)
echoBenchmarks_c PRIVATE "HELICS_BENCHMARK_SHIFT_FACTOR=(${HELICS_BENCHMARK_SHIFT_FACTOR})"
)
target_include_directories(
echoBenchmarks_c PUBLIC ${HELICS_BINARY_DIR}/helics_generated_includes/
echoBenchmarks_c PRIVATE ${HELICS_BINARY_DIR}/helics_generated_includes/
)
install(TARGETS echoBenchmarks_c ${HELICS_EXPORT_COMMAND} DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT benchmarks
)
endif()

Expand Down
Loading

0 comments on commit 7423839

Please sign in to comment.