Skip to content

Commit c2f4bd2

Browse files
authored
Merge pull request #2642 from GMLC-TDC/develop
Update main for 3.5.2 release
2 parents 00c47c7 + a203870 commit c2f4bd2

40 files changed

+899
-363
lines changed

.circleci/config.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,22 @@ jobs:
7878
helicsgccTSan:
7979
docker:
8080
- image: helics/buildenv:gcc13-builder
81+
resource_class: large
8182
environment:
82-
CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-fsanitize=thread -g -O1 " -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON -DHELICS_DISABLE_SYSTEM_CALL_TESTS=ON -DCMAKE_CXX_STANDARD=20'
83+
CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-fsanitize=thread -g -O1 " -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON -DHELICS_ENABLE_EXTRA_COMPILER_WARNINGS=OFF -DHELICS_DISABLE_SYSTEM_CALL_TESTS=ON -DCMAKE_CXX_STANDARD=20'
8384
TSAN_OPTIONS: "second_deadlock_stack=1 suppressions=/root/project/.circleci/tsan_suppression.txt history_size=4"
8485

8586
steps:
8687
- checkout
87-
- run: *setup_helics_low_mem
88+
- run: *setup_helics
8889
- run: *run_helics_sanitizer_tests
8990

9091
helicsgccASan:
9192
docker:
9293
- image: helics/buildenv:gcc13-builder
94+
resource_class: large
9395
environment:
94-
CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-ggdb -fsanitize=address -fno-omit-frame-pointer -static-libstdc++ -static-libasan -lrt -g -O1 " -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON -DHELICS_DISABLE_SYSTEM_CALL_TESTS=ON -DCMAKE_CXX_STANDARD=20'
96+
CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-ggdb -fsanitize=address -fno-omit-frame-pointer -static-libstdc++ -static-libasan -lrt -g -O1 " -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON -DHELICS_ENABLE_EXTRA_COMPILER_WARNINGS=OFF -DHELICS_DISABLE_SYSTEM_CALL_TESTS=ON -DCMAKE_CXX_STANDARD=20'
9597
ASAN_OPTIONS: "alloc_dealloc_mismatch=0"
9698
LSAN_OPTIONS: "suppressions=/root/project/.circleci/leak_suppression_gcc.txt"
9799
steps:
@@ -103,7 +105,7 @@ jobs:
103105
docker:
104106
- image: helics/buildenv:sanitizers-14
105107
environment:
106-
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=undefined,address -lc++ -lc++abi -fsanitize-address-use-after-scope -fsanitize-ignorelist=/root/project/.circleci/asan_suppression.txt -Wno-reserved-macro-identifier -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -fsanitize-blacklist=/root/project/.circleci/asan_blacklist.txt" -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'
108+
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=undefined,address -lc++ -lc++abi -fsanitize-address-use-after-scope -fsanitize-ignorelist=/root/project/.circleci/asan_suppression.txt -Wno-reserved-macro-identifier -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -fsanitize-blacklist=/root/project/.circleci/asan_blacklist.txt" -DHELICS_ENABLE_EXTRA_COMPILER_WARNINGS=OFF -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'
107109
LSAN_OPTIONS: "suppressions=/root/project/.circleci/leak_suppression.txt"
108110
UBSAN_OPTIONS: "print_stacktrace=1 suppressions=/root/project/.circleci/ubsan_suppression.txt"
109111
ASAN_OPTIONS: "alloc_dealloc_mismatch=0"
@@ -116,7 +118,7 @@ jobs:
116118
docker:
117119
- image: helics/buildenv:sanitizers-14
118120
environment:
119-
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=memory -nostdinc++ -nostdlib++ -Wno-reserved-macro-identifier -L/root/develop/libcxx_msan/lib -lc++ -lc++abi -I/root/develop/libcxx_msan/include -I/root/develop/libcxx_msan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath,/root/develop/libcxx_msan/lib" -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'
121+
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=memory -nostdinc++ -nostdlib++ -Wno-reserved-macro-identifier -L/root/develop/libcxx_msan/lib -lc++ -lc++abi -I/root/develop/libcxx_msan/include -I/root/develop/libcxx_msan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath,/root/develop/libcxx_msan/lib" -DHELICS_ENABLE_EXTRA_COMPILER_WARNINGS=OFF -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'
120122

121123
steps:
122124
- checkout
@@ -127,7 +129,7 @@ jobs:
127129
docker:
128130
- image: helics/buildenv:sanitizers-14
129131
environment:
130-
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=thread -nostdinc++ -nostdlib++ -L/root/develop/libcxx_tsan/lib -lc++ -lc++abi -I/root/develop/libcxx_tsan/include -I/root/develop/libcxx_tsan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O2 -Wl,-rpath,/root/develop/libcxx_tsan/lib" -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'
132+
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=thread -nostdinc++ -nostdlib++ -L/root/develop/libcxx_tsan/lib -lc++ -lc++abi -I/root/develop/libcxx_tsan/include -I/root/develop/libcxx_tsan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O2 -Wl,-rpath,/root/develop/libcxx_tsan/lib" -DHELICS_ENABLE_EXTRA_COMPILER_WARNINGS=OFF -DHELICS_BUILD_TESTS=ON -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ZMQ_FORCE_SUBPROJECT=ON'
131133
TSAN_OPTIONS: "suppressions=/root/project/.circleci/tsan_suppression.txt"
132134
steps:
133135
- checkout

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ repos:
7474
"--exclude-file=./config/spelling_ignorelines.txt",
7575
]
7676
- repo: https://github.com/pre-commit/mirrors-clang-format
77-
rev: v18.1.1
77+
rev: v18.1.2
7878
hooks:
7979
- id: clang-format
8080
types:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
99
A note on future revisions.
1010
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.
1111

12+
## [3.5.2][] - 2024-04-08
13+
14+
Patch release with fixes for certain compiler builds, a fix to the test core leading to some sporadic test failures, and fixing a discrepancy in the handing of config files with the helics_apps.
15+
16+
### Fixed
17+
18+
- Fixed an issue with the test core leading to sporadic failures in the test suite with the connector
19+
- Fixed compile issues on some versions of clang
20+
- Fixed some warnings on certain builds using sanitizers
21+
- Fixed a discrepancy in the handing of config files with the helics_apps library
22+
- Fixed several clang tidy issues and code cleanup
23+
24+
### Added
25+
26+
- Added an `--error_on_unmatched` flag to the broker for it to error if there are any unmatched requested connectors
27+
- Support for a broker section in config files and subcommand in the command line parsing
28+
1229
## [3.5.1][] - 2024-03-19
1330

1431
Patch release including beta version of reentrant federates and support for "potential_interfaces" section in config files and automatic handling of potential interface generation in the federate class for operation with the connector app.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE AND NOT HELICS_D
1717
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
1818
endif()
1919

20-
project(HELICS VERSION 3.5.1)
20+
project(HELICS VERSION 3.5.2)
2121

2222
# -----------------------------------------------------------------------------
2323
# HELICS Version number
2424
# -----------------------------------------------------------------------------
2525
set(HELICS_VERSION_BUILD)
2626
# use ISO date YYYY-MM-DD
27-
set(HELICS_DATE "2024-03-19")
27+
set(HELICS_DATE "2024-04-08")
2828

2929
set(HELICS_VERSION_UNDERSCORE
3030
"${HELICS_VERSION_MAJOR}_${HELICS_VERSION_MINOR}_${HELICS_VERSION_PATCH}"

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ branches:
55
- main
66
- develop
77

8-
version: 3.5.1.{build}
8+
version: 3.5.2.{build}
99

1010
image: Visual Studio 2019
1111

scripts/run-circleci-tests-sanitizer.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
tests=(
33
"/root/project/build/bin/core-tests --gtest_filter=-*ci_skip*:*nosan*"
44
"/root/project/build/bin/common-tests --gtest_filter=-*ci_skip*:*nosan*"
5-
"/root/project/build/bin/system-tests --gtest_filter=-*realtime*:*nosan*:*error*"
5+
"/root/project/build/bin/system-tests --gtest_filter=-*realtime*:*nosan*:*error*:*ci_skip*"
66
"/root/project/build/bin/helics_apps-tests --gtest_filter=-*ci_skip*:*nosan*"
7-
"/root/project/build/bin/shared-library-tests-cpp --gtest_filter=-*death*:*nosan*"
8-
"/root/project/build/bin/shared-library-tests --gtest_filter=-*bad_input*:*evil*:*after_close*:*death*:*nosan*"
7+
"/root/project/build/bin/shared-library-tests-cpp --gtest_filter=-*ci_skip*:*death*:*nosan*"
8+
"/root/project/build/bin/shared-library-tests --gtest_filter=-*ci_skip*:*bad_input*:*evil*:*after_close*:*death*:*nosan*"
99
"/root/project/build/bin/applicationApiTests --gtest_filter=-*ci_skip*:*nosan*"
1010
"/root/project/build/bin/filterTranslatorTests --gtest_filter=-*ci_skip*:*nosan*"
1111
"/root/project/build/bin/messageFederateTests --gtest_filter=-*ci_skip*:*nosan*"

scripts/run-circleci-tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
tests=(
33
"$1/bin/core-tests --gtest_filter=-*ci_skip*"
44
"$1/bin/common-tests --gtest_filter=-*ci_skip*"
5-
"$1/bin/system-tests --gtest_filter=-*realtime*"
5+
"$1/bin/system-tests --gtest_filter=-*ci_skip*:*realtime*"
66
"$1/bin/helics_apps-tests --gtest_filter=-*ci_skip*"
7-
"$1/bin/shared-library-tests-cpp --gtest_filter=-*death*"
8-
"$1/bin/shared-library-tests --gtest_filter=-*bad_input*:*evil*:*after_close*:*death*"
7+
"$1/bin/shared-library-tests-cpp --gtest_filter=-*ci_skip*:*death*"
8+
"$1/bin/shared-library-tests --gtest_filter=-*ci_skip*:*bad_input*:*evil*:*after_close*:*death*"
99
"$1/bin/applicationApiTests --gtest_filter=-*ci_skip*"
1010
"$1/bin/filterTranslatorTests --gtest_filter=-*ci_skip*"
1111
"$1/bin/messageFederateTests --gtest_filter=-*ci_skip*"
1212
"$1/bin/valueFederateTests --gtest_filter=-*ci_skip*"
13-
"$1/bin/helics_webserver-tests --gtest_filter=*"
14-
"$1/bin/network-tests --gtest_filter=*"
13+
"$1/bin/helics_webserver-tests --gtest_filter=-*ci_skip*"
14+
"$1/bin/network-tests --gtest_filter=-*ci_skip*"
1515
)
1616

1717
SUMRESULT=0

src/helics/application_api/ConnectorFederateManager.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ SPDX-License-Identifier: BSD-3-Clause
1616
namespace helics {
1717
ConnectorFederateManager::ConnectorFederateManager(Core* coreObj,
1818
Federate* ffed,
19-
LocalFederateId id,
19+
LocalFederateId fid,
2020
bool singleThreaded):
2121
coreObject(coreObj), filters(!singleThreaded), translators(!singleThreaded), fed(ffed),
22-
fedID(id)
22+
fedID(fid)
2323
{
2424
}
2525
ConnectorFederateManager::~ConnectorFederateManager() = default;
@@ -66,15 +66,15 @@ CloningFilter& ConnectorFederateManager::registerCloningFilter(std::string_view
6666
{
6767
auto handle = coreObject->registerCloningFilter(name, type_in, type_out);
6868
if (handle.isValid()) {
69-
auto filt = std::make_unique<CloningFilter>(fed, name, handle);
70-
CloningFilter& f = *filt;
69+
auto filtPtr = std::make_unique<CloningFilter>(fed, name, handle);
70+
CloningFilter& filt = *filtPtr;
7171
auto filts = filters.lock();
7272
if (name.empty()) {
73-
filts->insert(coreObject->getHandleName(handle), std::move(filt));
73+
filts->insert(coreObject->getHandleName(handle), std::move(filtPtr));
7474
} else {
75-
filts->insert(name, std::move(filt));
75+
filts->insert(name, std::move(filtPtr));
7676
}
77-
return f;
77+
return filt;
7878
}
7979
throw(RegistrationFailure("Unable to register Filter"));
8080
}

src/helics/application_api/ConnectorFederateManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ConnectorFederateManager {
2727
*/
2828
ConnectorFederateManager(Core* coreObj,
2929
Federate* fFed,
30-
LocalFederateId id,
30+
LocalFederateId fid,
3131
bool singleThreaded);
3232
/** destructor */
3333
~ConnectorFederateManager();

src/helics/application_api/Federate.cpp

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void Federate::registerFederate(const FederateInfo& fedInfo)
230230

231231
useJsonSerialization = fedInfo.useJsonSerialization;
232232
observerMode = fedInfo.observer;
233-
configFile = fedInfo.fileInUse;
233+
configFile = fedInfo.configString;
234234
mCurrentTime = coreObject->getCurrentTime(fedID);
235235
if (!singleThreadFederate) {
236236
asyncCallInfo = std::make_unique<shared_guarded_m<AsyncFedCallInfo>>();
@@ -1209,21 +1209,29 @@ void Federate::disconnectTransition()
12091209

12101210
void Federate::registerInterfaces(const std::string& configString)
12111211
{
1212-
// this will be deprecated at some point in the future
12131212
registerConnectorInterfaces(configString);
12141213
}
12151214

12161215
void Federate::registerConnectorInterfaces(const std::string& configString)
12171216
{
1218-
if (fileops::hasTomlExtension(configString)) {
1219-
registerConnectorInterfacesToml(configString);
1220-
} else {
1221-
try {
1222-
registerConnectorInterfacesJson(configString);
1223-
}
1224-
catch (const std::invalid_argument& e) {
1225-
throw(helics::InvalidParameter(e.what()));
1226-
}
1217+
auto hint = fileops::getConfigType(configString);
1218+
switch (hint) {
1219+
case fileops::ConfigType::JSON_FILE:
1220+
case fileops::ConfigType::JSON_STRING:
1221+
try {
1222+
registerConnectorInterfacesJson(configString);
1223+
}
1224+
catch (const std::invalid_argument& e) {
1225+
throw(helics::InvalidParameter(e.what()));
1226+
}
1227+
break;
1228+
case fileops::ConfigType::TOML_FILE:
1229+
case fileops::ConfigType::TOML_STRING:
1230+
registerConnectorInterfacesToml(configString);
1231+
break;
1232+
case fileops::ConfigType::NONE:
1233+
default:
1234+
break;
12271235
}
12281236
}
12291237

@@ -2159,6 +2167,35 @@ const std::string& Interface::getDestinationTargets() const
21592167
return mCore->getDestinationTargets(handle);
21602168
}
21612169

2170+
std::size_t Interface::getSourceTargetCount() const
2171+
{
2172+
const auto& targets = getSourceTargets();
2173+
if (targets.empty()) {
2174+
return 0;
2175+
}
2176+
try {
2177+
const Json::Value tvalues = fileops::loadJsonStr(targets);
2178+
return (tvalues.isArray()) ? tvalues.size() : 1;
2179+
}
2180+
catch (...) {
2181+
return 1;
2182+
}
2183+
}
2184+
std::size_t Interface::getDestinationTargetCount() const
2185+
{
2186+
const auto& targets = getDestinationTargets();
2187+
if (targets.empty()) {
2188+
return 0;
2189+
}
2190+
try {
2191+
const Json::Value tvalues = fileops::loadJsonStr(targets);
2192+
return (tvalues.isArray()) ? tvalues.size() : 1;
2193+
}
2194+
catch (...) {
2195+
return 1;
2196+
}
2197+
}
2198+
21622199
const std::string& Interface::getDisplayName() const
21632200
{
21642201
return (mName.empty() ? getSourceTargets() : mName);

0 commit comments

Comments
 (0)