Skip to content

Commit

Permalink
Merge pull request #2240 from GMLC-TDC/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
phlptp authored Dec 16, 2021
2 parents 39470e8 + 1a0c389 commit 244bb65
Show file tree
Hide file tree
Showing 551 changed files with 3,169 additions and 4,011 deletions.
4 changes: 2 additions & 2 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ jobs:
- job: Windows
strategy:
matrix:
VS2017-32bit:
imageName: 'vs2017-win2016'
VS2019-32bit:
imageName: 'windows-2019'
langArch: 'x86'
vsArch: 'Win32'
extraFlags: '-DHELICS_DISABLE_WEBSERVER=ON'
Expand Down
28 changes: 14 additions & 14 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
[submodule "ThirdParty/asio"]
path = ThirdParty/asio
url = https://github.com/chriskohlhoff/asio
url = ../../chriskohlhoff/asio
[submodule "ThirdParty/fmtlib"]
path = ThirdParty/fmtlib
url = https://github.com/fmtlib/fmt.git
url = ../../fmtlib/fmt.git
[submodule "ThirdParty/containers"]
path = ThirdParty/containers
url = https://github.com/GMLC-TDC/containers.git
url = ../../GMLC-TDC/containers.git
branch = master
[submodule "ThirdParty/concurrency"]
path = ThirdParty/concurrency
url = https://github.com/GMLC-TDC/concurrency.git
url = ../../GMLC-TDC/concurrency.git
[submodule "ThirdParty/utilities"]
path = ThirdParty/utilities
url = https://github.com/GMLC-TDC/utilities.git
url = ../../GMLC-TDC/utilities.git
[submodule "ThirdParty/units"]
path = ThirdParty/units
url = https://github.com/LLNL/units.git
[submodule "ThirdParty/toml11"]
path = ThirdParty/toml11
url = https://github.com/GMLC-TDC/toml11.git
[submodule "ThirdParty/netif"]
path = ThirdParty/netif
url = https://github.com/GMLC-TDC/netif.git
url = ../../LLNL/units.git
[submodule "ThirdParty/spdlog"]
path = ThirdParty/spdlog
url = https://github.com/gabime/spdlog.git
url = ../../gabime/spdlog.git
[submodule "ThirdParty/json_cpp"]
path = ThirdParty/json_cpp
url = https://github.com/open-source-parsers/jsoncpp.git
url = ../../open-source-parsers/jsoncpp.git
branch = master
[submodule "ThirdParty/toml"]
path = ThirdParty/toml
url = ../../ToruNiina/toml11
[submodule "ThirdParty/networking"]
path = ThirdParty/networking
url = ../../GMLC-TDC/networking.git
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ repos:
- id: dockerfile_lint
args: [--rulefile, ./config/Docker/docker_rules.yml, --dockerfile]
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 21.12b0
hooks:
- id: black
args: ["--line-length=100"]
- repo: https://github.com/asottile/blacken-docs
rev: v1.11.0
rev: v1.12.0
hooks:
- id: blacken-docs
additional_dependencies: [black==21.10b0]
Expand All @@ -35,7 +35,7 @@ repos:
- id: end-of-file-fixer
- id: check-shebang-scripts-are-executable
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.4.1
rev: v2.5.1
hooks:
- id: prettier
exclude: ^(docs/user-guide/examples/user_guide_examples)
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@ 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.

## [3.1.1][] - 2021-12-14

Primarily a bug fix release to fix a build issue resulting in internal logging messages being disabled for some of the release packages. Also includes a `maxcosimduration` argument for brokers to kill the co-sim after a certain amount of wall clock time.

### Fixed

- CMake issue resulting in internal logging messages being disabled for some builds including some package releases.
- Fixed a few deadlock pathways if the core was killed internally.
- Fixed some timeout issues in the CI builds.
- Fixed a potential race condition when setting the log file after execution has started on helics cores.

### Changed

- CMake version 3.22 tested and used if available.
- The TCP networking components that were not core to HELICS have been moved to a separate repo and linked as a submodule. See [networking](www.github.com/GMLC-TDC/networking).
- Several documentation fixes and updates.
- Moved to using the upstream toml11 repo instead of a custom modified version. Customized modifications have now been merged upstream.

### Added

- '--maxcosimduration' flag added in the broker to specify a max co-sim duration after which the cosimulation will be terminated.
- `helicsGetSystemInfo()` function was added to the API to retrieve HELICS version and system info for debugging and diagnostic purposes.
- Added a threaded signal handler to execute close out operations in a new thread and return control back to the main thread to wait for error signals.
- Added `helicsFederateInfoLoadFromString` to better match C++ API available functions. This loads the federateInfo structure from command line arguments contained in a string.

## [3.1.0][] - 2021-11-25

This release includes some bug fixes and enhancements to HELICS 3 which is now the default. The [migrating 2 to 3](./docs/developer-guide/porting-2-to-3.md) page includes some specific details on migrating from HELICS 2 to 3.
Expand Down Expand Up @@ -97,6 +122,7 @@ HELICS 3.0 is a major update to HELICS. The major features that have been added
[3.0.0]: https://github.com/GMLC-TDC/HELICS/releases/tag/v3.0.0
[3.0.1]: https://github.com/GMLC-TDC/HELICS/releases/tag/v3.0.1
[3.1.0]: https://github.com/GMLC-TDC/HELICS/releases/tag/v3.1.0
[3.1.1]: https://github.com/GMLC-TDC/HELICS/releases/tag/v3.1.1

## [2.7.1][] - 2021-06-05

Expand Down
75 changes: 45 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
# SPDX-License-Identifier: BSD-3-Clause
# ~~~

cmake_minimum_required(VERSION 3.10...3.20)
cmake_minimum_required(VERSION 3.10...3.22)

# Install dependencies using vcpkg if VCPKG_ROOT is set and no CMake Toolchain file is given vcpkg
# installation on a system doesn't set VCPKG_ROOT, so setting it should be like an opt-in for users
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()

project(HELICS VERSION 3.1.0)
project(HELICS VERSION 3.1.1)

# -----------------------------------------------------------------------------
# HELICS Version number
# -----------------------------------------------------------------------------
set(HELICS_VERSION_BUILD)
# use ISO date YYYY-MM-DD
set(HELICS_DATE "2021-11-24")
set(HELICS_DATE "2021-12-14")

set(HELICS_VERSION_UNDERSCORE
"${HELICS_VERSION_MAJOR}_${HELICS_VERSION_MINOR}_${HELICS_VERSION_PATCH}"
Expand Down Expand Up @@ -226,6 +226,15 @@ if(NOT HELICS_DISABLE_C_SHARED_LIB OR HELICS_BUILD_CXX_SHARED_LIB
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

option(HELICS_ENABLE_LOGGING "enable normal, debug, and trace logging in HELICS" ON)

cmake_dependent_advanced_option(
HELICS_ENABLE_TRACE_LOGGING "enable trace logging" ON "HELICS_ENABLE_LOGGING" ON
)
cmake_dependent_advanced_option(
HELICS_ENABLE_DEBUG_LOGGING "enable debug logging" ON "HELICS_ENABLE_LOGGING" ON
)

# -----------------------------------------------------------------------------
# General project wide configuration for debug postfix
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -376,16 +385,16 @@ if(NOT HELICS_DISABLE_GIT_OPERATIONS)
submod_update(ThirdParty/utilities)
endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/units/units/units.hpp")
submod_update(ThirdParty/units)
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/networking/gmlc/networking/TcpServer.h")
submod_update(ThirdParty/networking)
endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/toml11/toml/value.hpp")
submod_update(ThirdParty/toml11)
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/units/units/units.hpp")
submod_update(ThirdParty/units)
endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/netif/gmlc/netif/NetIF.hpp")
submod_update(ThirdParty/netif)
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/toml/toml/value.hpp")
submod_update(ThirdParty/toml)
endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/ThirdParty/spdlog/CMakeLists.txt")
Expand Down Expand Up @@ -415,7 +424,7 @@ endif()
set(toml11_BUILD_TEST OFF CACHE INTERNAL "")
set(toml11_TEST_WITH_ASAN OFF CACHE INTERNAL "")
set(toml11_TEST_WITH_UBSAN OFF CACHE INTERNAL "")
add_subdirectory(ThirdParty/toml11 EXCLUDE_FROM_ALL)
add_subdirectory(ThirdParty/toml EXCLUDE_FROM_ALL)

# -------------------------------------------------------------
# options for enabling specific core communication types
Expand Down Expand Up @@ -481,12 +490,8 @@ endif(HELICS_ENABLE_MPI_CORE)
# -------------------------------------------------------------
# add threading support
# -------------------------------------------------------------
if(NOT WIN32)
set(THREADS_PREFER_PTHREAD_FLAG ON)
elseif(MSYS OR CYGWIN)
if(MSYS OR CYGWIN OR NOT WIN32)
set(THREADS_PREFER_PTHREAD_FLAG ON)
else()
set(CMAKE_USE_WIN32_THREADS_INIT ON)
endif()
find_package(Threads REQUIRED)

Expand Down Expand Up @@ -561,7 +566,6 @@ target_include_directories(
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDE_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/ThirdParty/containers>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/ThirdParty/concurrency>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/ThirdParty/netif>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/ThirdParty/utilities>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/ThirdParty/utilities/gmlc/utilities>
)
Expand All @@ -572,7 +576,7 @@ target_include_directories(
)

target_link_libraries(helics_base INTERFACE toml11::toml11)
# TODO: this should be removed when we require a compiler with the filesystem header defined
# TODO(PT): this should be removed when we require a compiler with the filesystem header defined
target_compile_definitions(helics_base INTERFACE "-DTOML11_DISABLE_STD_FILESYSTEM")

if(NOT HELICS_DISABLE_BOOST)
Expand Down Expand Up @@ -648,15 +652,6 @@ if(NOT WIN32)
endif()
endif()

option(HELICS_ENABLE_LOGGING "enable normal, debug, and trace logging in HELICS" ON)

cmake_dependent_advanced_option(
HELICS_ENABLE_TRACE_LOGGING "enable trace logging" ON "HELICS_ENABLE_LOGGING" ON
)
cmake_dependent_advanced_option(
HELICS_ENABLE_DEBUG_LOGGING "enable debug logging" ON "HELICS_ENABLE_LOGGING" ON
)

# -----------------------------------------------------------------------------
# create the fmt header only targets
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -685,6 +680,7 @@ add_library(HELICS::units ALIAS units-static)
# -----------------------------------------------------------------------------

set(GMLC_UTILITIES_INSTALL OFF CACHE INTERNAL "")

add_subdirectory(ThirdParty/utilities)

hide_variable(GMLC_UTILITIES_GENERATE_DOXYGEN_DOC)
Expand All @@ -696,14 +692,33 @@ hide_variable(GMLC_UTILITIES_STATIC_LIB)
hide_variable(GMLC_UTILITIES_CLANG_TIDY_OPTIONS)

target_compile_definitions(gmlc_utilities PUBLIC USE_STD_STRING_VIEW=1)
add_library(HELICS::utilities ALIAS gmlc_utilities)

set_target_properties(gmlc_utilities PROPERTIES FOLDER Extern)
if(NOT HELICS_DISABLE_BOOST)
target_include_directories(
gmlc_utilities SYSTEM PRIVATE $<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
)
endif()

# -----------------------------------------------------------------------------
# create networking target
# -----------------------------------------------------------------------------

set(GMLC_NETWORKING_INSTALL OFF CACHE INTERNAL "")
set(GMLC_NETWORKING_ASIO_INCLUDE ${PROJECT_SOURCE_DIR}/ThirdParty/asio/asio/include)
set(GMLC_NETWORKING_CONCURRENCY_INCLUDE ${PROJECT_SOURCE_DIR}/ThirdParty/concurrency)
set(GMLC_NETWORKING_DISABLE_ASIO ${HELICS_DISABLE_ASIO})
add_subdirectory(ThirdParty/networking)

hide_variable(GMLC_NETWORKING_GENERATE_DOXYGEN_DOC)
hide_variable(GMLC_NETWORKING_INCLUDE_BOOST)
hide_variable(GMLC_NETWORKING_WITH_CMAKE_PACKAGE)
hide_variable(GMLC_NETWORKING_OBJECT_LIB)
hide_variable(GMLC_NETWORKING_STATIC_LIB)
hide_variable(GMLC_NETWORKING_CLANG_TIDY_OPTIONS)

set_target_properties(gmlc_networking PROPERTIES FOLDER Extern)

# -----------------------------------------------------------------------------
# CMAKE Subdirectories
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -849,11 +864,11 @@ set(LICENSE_LIST
"JsonCpp"
"${PROJECT_SOURCE_DIR}/ThirdParty/json_cpp/LICENSE"
"toml11"
"${PROJECT_SOURCE_DIR}/ThirdParty/toml11/LICENSE"
"${PROJECT_SOURCE_DIR}/ThirdParty/toml/LICENSE"
"GMLC Utilities"
"${PROJECT_SOURCE_DIR}/ThirdParty/utilities/LICENSE"
"netif"
"${PROJECT_SOURCE_DIR}/ThirdParty/netif/LICENSE"
"GMLC Networking"
"${PROJECT_SOURCE_DIR}/ThirdParty/networking/LICENSE"
)

if(NOT CMAKE_VERSION VERSION_LESS 3.11)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The following is a set of guidelines for contributing to HELICS and associated p
## Licensing

HELICS is distributed under the terms of the BSD-3 clause license. All new
contributions must be made under this [LICENSE](LICENSE) in accordance with the Github [terms of service](https://help.github.com/en/articles/github-terms-of-service#6-contributions-under-repository-license), which uses inbound=outbound policy. By submitting a pull request you are acknowledging that you have the right to license your code under these terms.
contributions must be made under this [LICENSE](LICENSE) in accordance with the GitHub [terms of service](https://help.github.com/en/articles/github-terms-of-service#6-contributions-under-repository-license), which uses inbound=outbound policy. By submitting a pull request you are acknowledging that you have the right to license your code under these terms.

## [Code of Conduct](.github/CODE_OF_CONDUCT.md)

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ While not used directly, much of the inspiration for HELICS comes from three sep

A single-header standalone variant of the filesystem library(v1.3.0) is used to avoid compiled libraries in boost. The single header version is included with the source and is released with a [MIT](https://github.com/gulrak/filesystem/blob/master/LICENSE) license (used as of HELICS 2.4.1) prior versions had a BSD-3-Clause license.

### [gmlc/netif](https://github.com/GMLC-TDC/netif)
### [gmlc/networking](https://github.com/GMLC-TDC/networking)

A header-only library for getting a list of network interfaces in a cross-platform way. It is included in HELICS as a submodule and is released under a [BSD-3 clause](https://github.com/GMLC-TDC/netif/blob/master/LICENSE) license.
A networking library with helper functions around Asio and other network interface and address operations used within HELICS and other related tools. It is included in HELICS as a submodule and is released under a [BSD-3 clause](https://github.com/GMLC-TDC/networking/blob/main/LICENSE) license.

### CMake scripts

Expand Down
1 change: 0 additions & 1 deletion ThirdParty/netif
Submodule netif deleted from 72de54
1 change: 1 addition & 0 deletions ThirdParty/networking
Submodule networking added at 584c17
1 change: 1 addition & 0 deletions ThirdParty/toml
Submodule toml added at 1dc09d
1 change: 0 additions & 1 deletion ThirdParty/toml11
Submodule toml11 deleted from eef710
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ branches:
- develop
- helics2

version: 3.1.0.{build}
version: 3.1.1.{build}

image: Visual Studio 2019

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if(hasParent)
include(AddGooglebenchmark)
add_subdirectory(helics)
else()
cmake_minimum_required(VERSION 3.10...3.20)
cmake_minimum_required(VERSION 3.10...3.22)
set(HELICS_BUILD_TESTS OFF CACHE INTERNAL "")
set(HELICS_BUILD_MATLAB_INTERFACE OFF CACHE INTERNAL "")
set(HELICS_BUILD_JAVA_INTERFACE OFF CACHE INTERNAL "")
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/helics/helics_benchmark_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPDX-License-Identifier: BSD-3-Clause
#include <string>
#include <thread>

#if defined(ENABLE_ZMQ_CORE) && !defined(USING_HELICS_C_SHARED_LIB)
#if defined(HELICS_ENABLE_ZMQ_CORE) && !defined(USING_HELICS_C_SHARED_LIB)
# include "helics/network/zmq/ZmqCommsCommon.h"
#endif

Expand Down Expand Up @@ -102,7 +102,7 @@ inline void printHELICSsystemInfo()
{
std::cout << "------------HELICS BUILD INFO -------------\nHELICS VERSION: "
<< HELICS_VERSION_STRING << '\n';
#if defined(ENABLE_ZMQ_CORE) && !defined(USING_HELICS_C_SHARED_LIB)
#if defined(HELICS_ENABLE_ZMQ_CORE) && !defined(USING_HELICS_C_SHARED_LIB)
std::cout << "ZMQ VERSION: " << helics::zeromq::getZMQVersion() << '\n';
#endif
std::cout << "COMPILER INFO: " << helics::compiler << '\n';
Expand Down
2 changes: 1 addition & 1 deletion config/cmake/combineLicenses.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright (c) 2017-2020, Battelle Memorial Institute; Lawrence Livermore
# Copyright (c) 2017-2021, Battelle Memorial Institute; Lawrence Livermore
# National Security, LLC; Alliance for Sustainable Energy, LLC.
# See the top-level NOTICE for additional details.
# All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions docs/build_RTD.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
python -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
Binary file modified docs/logos/HELICS.ico
Binary file not shown.
Loading

0 comments on commit 244bb65

Please sign in to comment.