Skip to content

Commit

Permalink
Merge pull request #2274 from GMLC-TDC/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
phlptp authored Jan 25, 2022
2 parents 9a5726b + 2881fb1 commit 26615ad
Show file tree
Hide file tree
Showing 909 changed files with 7,173 additions and 4,315 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
hooks:
- id: remove-tabs
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-added-large-files
- id: mixed-line-ending
Expand All @@ -47,7 +47,7 @@ repos:
exclude: "mac.md"
- id: script-must-have-extension
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.1
rev: v0.8.0.3
hooks:
- id: shellcheck
args: [-x]
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,33 @@ 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.2][] - 2022-01-25

This patch release is primarily to address some build issues on MSYS2, MINGW, and CYGWIN platforms. It also includes some preliminary features for the 3.2 release that were already merged including time monitors, remote logging, and a log buffer.

### Fixed

- Fixed issue building on CYGWIN with the latest FMT library.
- Build issues related to MSYS2 and Mingw in the networking submodule (submodule updated).
- Fixed argument processing issue in the comboFed Example.

### Changed

- Updates to FMT and SPDLOG
- Several documentation updates and cleanup
- Copyright date changed to 2022
- Targeted endpoints now allow all method calls, with the restriction being that the destination must be in the target list otherwise an error is generated. An empty destination in methods that allow destinations will operate identically to calls which do not specify a destination.
- Code cleanup for defining the default port numbers for network core types.

### Added

- A process comms method for federates to instruct HELICS to process messages for a specific amount of wall clock time without granting time or changing state.
- Added a threaded signal handler to deal with some particular issues with killing processes in python and potentially other language interfaces.
- Added a log buffer to brokers/cores/federates to store the latest N messages and retrieve it via a query. See [log buffer](./docs/user-guide/fundamental_topics/logging.md#log-buffer) for more details.
- Added a time monitor object to brokers to use a particular federate as the query time standard for brokers, this does not affect the cosimulation only the logging and queries. See [time monitor](./docs/user-guide/fundamental_topics/logging.md#time-monitor) for more details.
- Added a callback to be executed when the time is updated and before the value or message interface callbacks are executed.
- Added remote logging command to mirror logs from one HELICS object to another. See [remote logging](./docs/user-guide/fundamental_topics/logging.md#remote-logging) for more details.

## [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.
Expand Down Expand Up @@ -123,6 +150,7 @@ HELICS 3.0 is a major update to HELICS. The major features that have been added
[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
[3.1.2]: https://github.com/GMLC-TDC/HELICS/releases/tag/v3.1.2

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

Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ~~~
# Copyright (c) 2017-2021, Battelle Memorial Institute; Lawrence Livermore
# Copyright (c) 2017-2022, 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 All @@ -15,14 +15,14 @@ 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.1)
project(HELICS VERSION 3.1.2)

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

set(HELICS_VERSION_UNDERSCORE
"${HELICS_VERSION_MAJOR}_${HELICS_VERSION_MINOR}_${HELICS_VERSION_PATCH}"
Expand Down Expand Up @@ -653,7 +653,7 @@ if(NOT WIN32)
endif()

# -----------------------------------------------------------------------------
# create the fmt header only targets
# create the fmt target
# -----------------------------------------------------------------------------
include(addfmt)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017-2019, Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC.
Copyright (c) 2017-2022, Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/fmtlib
Submodule fmtlib updated 69 files
+2 −1 .github/workflows/linux.yml
+10 −5 CMakeLists.txt
+385 −8 ChangeLog.rst
+6 −6 README.rst
+29 −17 doc/api.rst
+3 −1 doc/basic-bootstrap/layout.html
+4 −1 doc/build.py
+15 −14 doc/syntax.rst
+2 −0 include/fmt/args.h
+970 −211 include/fmt/chrono.h
+23 −12 include/fmt/color.h
+14 −11 include/fmt/compile.h
+490 −256 include/fmt/core.h
+286 −263 include/fmt/format-inl.h
+588 −314 include/fmt/format.h
+30 −18 include/fmt/os.h
+31 −77 include/fmt/ostream.h
+12 −7 include/fmt/printf.h
+436 −111 include/fmt/ranges.h
+5 −5 include/fmt/xchar.h
+0 −1 src/fmt.cc
+46 −0 src/format.cc
+9 −8 src/os.cc
+1 −0 support/bazel/.bazelrc
+1 −0 support/bazel/.bazelversion
+29 −0 support/bazel/BUILD.bazel
+73 −0 support/bazel/README.md
+1 −0 support/bazel/WORKSPACE.bazel
+5 −5 support/manage.py
+201 −0 support/printable.py
+26 −29 test/CMakeLists.txt
+24 −11 test/args-test.cc
+279 −39 test/chrono-test.cc
+6 −0 test/color-test.cc
+169 −45 test/compile-error-test/CMakeLists.txt
+62 −0 test/compile-fp-test.cc
+18 −1 test/compile-test.cc
+97 −21 test/core-test.cc
+10 −9 test/enforce-checks-test.cc
+1 −2 test/find-package-test/main.cc
+0 −856 test/format
+7 −10 test/format-impl-test.cc
+223 −171 test/format-test.cc
+1 −1 test/fuzzing/CMakeLists.txt
+5 −3 test/fuzzing/build.sh
+6 −5 test/fuzzing/chrono-duration.cc
+32 −0 test/fuzzing/chrono-timepoint.cc
+5 −5 test/fuzzing/float.cc
+7 −5 test/fuzzing/fuzzer-common.h
+5 −3 test/fuzzing/named-arg.cc
+6 −5 test/fuzzing/one-arg.cc
+2 −1 test/fuzzing/two-args.cc
+3 −4 test/gtest-extra.cc
+7 −1 test/gtest-extra.h
+7 −0 test/gtest/CMakeLists.txt
+4 −0 test/header-only-test.cc
+23 −8 test/module-test.cc
+18 −0 test/noexception-test.cc
+22 −23 test/os-test.cc
+32 −13 test/ostream-test.cc
+0 −26 test/posix-mock-test.cc
+0 −6 test/printf-test.cc
+17 −0 test/ranges-odr-test.cc
+101 −2 test/ranges-test.cc
+0 −161 test/std-format-test.cc
+1 −0 test/test-main.cc
+1 −1 test/unicode-test.cc
+6 −2 test/util.h
+78 −3 test/xchar-test.cc
141 changes: 123 additions & 18 deletions ThirdParty/frozen/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "frozen/bits/basic_types.h"
#include "frozen/bits/constexpr_assert.h"
#include "frozen/bits/exceptions.h"
#include "frozen/bits/type_traits.h"
#include "frozen/bits/version.h"

#include <utility>
Expand All @@ -48,23 +49,46 @@ template <class Comparator> class CompareKey {
std::pair<Key, Value> const &other) const {
return comparator_(std::get<0>(self), std::get<0>(other));
}
template <class Key1, class Key2, class Value,
typename = bits::has_is_transparent_t<Comparator, Key1>>
constexpr int operator()(std::pair<Key1, Value> const &self,
std::pair<Key2, Value> const &other) const {
return comparator_(std::get<0>(self), std::get<0>(other));
}

template <class Key, class Value>
constexpr int operator()(Key const &self_key,
std::pair<Key, Value> const &other) const {
return comparator_(self_key, std::get<0>(other));
}
template <class Key1, class Key2, class Value,
typename = bits::has_is_transparent_t<Comparator, Key1>>
constexpr int operator()(Key1 const &self_key,
std::pair<Key2, Value> const &other) const {
return comparator_(self_key, std::get<0>(other));
}

template <class Key, class Value>
constexpr int operator()(std::pair<Key, Value> const &self,
Key const &other_key) const {
return comparator_(std::get<0>(self), other_key);
}
template <class Key1, class Key2, class Value,
typename = bits::has_is_transparent_t<Comparator, Key1>>
constexpr int operator()(std::pair<Key1, Value> const &self,
Key2 const &other_key) const {
return comparator_(std::get<0>(self), other_key);
}

template <class Key>
constexpr int operator()(Key const &self_key, Key const &other_key) const {
return comparator_(self_key, other_key);
}
template <class Key1, class Key2,
typename = bits::has_is_transparent_t<Comparator, Key1>>
constexpr int operator()(Key1 const &self_key, Key2 const &other_key) const {
return comparator_(self_key, other_key);
}
};

} // namespace impl
Expand Down Expand Up @@ -142,13 +166,28 @@ class map {
constexpr std::size_t count(Key const &key) const {
return bits::binary_search<N>(items_.begin(), key, less_than_);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr std::size_t count(K const &key) const {
return bits::binary_search<N>(items_.begin(), key, less_than_);
}

constexpr const_iterator find(Key const &key) const {
return find_impl(*this, key);
}
constexpr iterator find(Key const &key) {
return find_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr const_iterator find(K const &key) const {
return map::find_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr iterator find(K const &key) {
return map::find_impl(*this, key);
}

constexpr std::pair<const_iterator, const_iterator>
equal_range(Key const &key) const {
Expand All @@ -157,46 +196,77 @@ class map {
constexpr std::pair<iterator, iterator> equal_range(Key const &key) {
return equal_range_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr std::pair<const_iterator, const_iterator>
equal_range(K const &key) const {
return equal_range_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr std::pair<iterator, iterator> equal_range(K const &key) {
return equal_range_impl(*this, key);
}

constexpr const_iterator lower_bound(Key const &key) const {
return lower_bound_impl(*this, key);
}
constexpr iterator lower_bound(Key const &key) {
return lower_bound_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr const_iterator lower_bound(K const &key) const {
return lower_bound_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr iterator lower_bound(K const &key) {
return lower_bound_impl(*this, key);
}

constexpr const_iterator upper_bound(Key const &key) const {
return upper_bound_impl(*this, key);
}
constexpr iterator upper_bound(Key const &key) {
return upper_bound_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr const_iterator upper_bound(K const &key) const {
return upper_bound_impl(*this, key);
}
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr iterator upper_bound(K const &key) {
return upper_bound_impl(*this, key);
}

/* observers */
constexpr key_compare key_comp() const { return less_than_; }
constexpr key_compare value_comp() const { return less_than_; }

private:
template <class This>
static inline constexpr auto& at_impl(This&& self, Key const &key) {
template <class This, class K>
static inline constexpr auto& at_impl(This&& self, K const &key) {
auto where = self.lower_bound(key);
if (where != self.end())
return where->second;
else
FROZEN_THROW_OR_ABORT(std::out_of_range("unknown key"));
}

template <class This>
static inline constexpr auto find_impl(This&& self, Key const &key) {
template <class This, class K>
static inline constexpr auto find_impl(This&& self, K const &key) {
auto where = self.lower_bound(key);
if ((where != self.end()) && !self.less_than_(key, *where))
return where;
else
return self.end();
}

template <class This>
static inline constexpr auto equal_range_impl(This&& self, Key const &key) {
template <class This, class K>
static inline constexpr auto equal_range_impl(This&& self, K const &key) {
auto lower = self.lower_bound(key);
using lower_t = decltype(lower);
if (lower == self.end())
Expand All @@ -205,17 +275,17 @@ class map {
return std::pair<lower_t, lower_t>{lower, lower + 1};
}

template <class This>
static inline constexpr auto lower_bound_impl(This&& self, Key const &key) -> decltype(self.end()) {
template <class This, class K>
static inline constexpr auto lower_bound_impl(This&& self, K const &key) -> decltype(self.end()) {
auto where = bits::lower_bound<N>(self.items_.begin(), key, self.less_than_);
if ((where != self.end()) && !self.less_than_(key, *where))
return where;
else
return self.end();
}

template <class This>
static inline constexpr auto upper_bound_impl(This&& self, Key const &key) -> decltype(self.end()) {
template <class This, class K>
static inline constexpr auto upper_bound_impl(This&& self, K const &key) -> decltype(self.end()) {
auto where = bits::lower_bound<N>(self.items_.begin(), key, self.less_than_);
if ((where != self.end()) && !self.less_than_(key, *where))
return where + 1;
Expand Down Expand Up @@ -284,33 +354,58 @@ class map<Key, Value, 0, Compare> {
/* lookup */

constexpr std::size_t count(Key const &) const { return 0; }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr std::size_t count(K const &) const { return 0; }

constexpr const_iterator find(Key const &) const { return end(); }
constexpr iterator find(Key const &) { return end(); }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr const_iterator find(K const &) const { return end(); }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr iterator find(K const &) { return end(); }

constexpr std::pair<const_iterator, const_iterator>
equal_range(Key const &) const {
return {end(), end()};
}
equal_range(Key const &) const { return {end(), end()}; }
constexpr std::pair<iterator, iterator>
equal_range(Key const &) {
return {end(), end()};
}
equal_range(Key const &) { return {end(), end()}; }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr std::pair<const_iterator, const_iterator>
equal_range(K const &) const { return {end(), end()}; }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr std::pair<iterator, iterator>
equal_range(K const &) { return {end(), end()}; }

constexpr const_iterator lower_bound(Key const &) const { return end(); }
constexpr iterator lower_bound(Key const &) { return end(); }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr const_iterator lower_bound(K const &) const { return end(); }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr iterator lower_bound(K const &) { return end(); }

constexpr const_iterator upper_bound(Key const &) const { return end(); }
constexpr iterator upper_bound(Key const &) { return end(); }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr const_iterator upper_bound(K const &) const { return end(); }
template <class K,
typename = bits::has_is_transparent_t<Compare, K>>
constexpr iterator upper_bound(K const &) { return end(); }

/* observers */
constexpr key_compare key_comp() const { return less_than_; }
constexpr key_compare value_comp() const { return less_than_; }
};

template <typename T, typename U>
template <typename T, typename U, typename Compare = std::less<T>>
constexpr auto make_map(bits::ignored_arg = {}/* for consistency with the initializer below for N = 0*/) {
return map<T, U, 0>{};
return map<T, U, 0, Compare>{};
}

template <typename T, typename U, std::size_t N>
Expand All @@ -323,6 +418,16 @@ constexpr auto make_map(std::array<std::pair<T, U>, N> const &items) {
return map<T, U, N>{items};
}

template <typename T, typename U, typename Compare, std::size_t N>
constexpr auto make_map(std::pair<T, U> const (&items)[N]) {
return map<T, U, N, Compare>{items};
}

template <typename T, typename U, typename Compare, std::size_t N>
constexpr auto make_map(std::array<std::pair<T, U>, N> const &items) {
return map<T, U, N, Compare>{items};
}

} // namespace frozen

#endif
Loading

0 comments on commit 26615ad

Please sign in to comment.