Skip to content

Commit

Permalink
Merge pull request #2642 from GMLC-TDC/develop
Browse files Browse the repository at this point in the history
Update main for 3.5.2 release
  • Loading branch information
nightlark committed Apr 8, 2024
2 parents 00c47c7 + a203870 commit c2f4bd2
Show file tree
Hide file tree
Showing 40 changed files with 899 additions and 363 deletions.
14 changes: 8 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,22 @@ jobs:
helicsgccTSan:
docker:
- image: helics/buildenv:gcc13-builder
resource_class: large
environment:
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'
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'
TSAN_OPTIONS: "second_deadlock_stack=1 suppressions=/root/project/.circleci/tsan_suppression.txt history_size=4"

steps:
- checkout
- run: *setup_helics_low_mem
- run: *setup_helics
- run: *run_helics_sanitizer_tests

helicsgccASan:
docker:
- image: helics/buildenv:gcc13-builder
resource_class: large
environment:
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'
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'
ASAN_OPTIONS: "alloc_dealloc_mismatch=0"
LSAN_OPTIONS: "suppressions=/root/project/.circleci/leak_suppression_gcc.txt"
steps:
Expand All @@ -103,7 +105,7 @@ jobs:
docker:
- image: helics/buildenv:sanitizers-14
environment:
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'
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'
LSAN_OPTIONS: "suppressions=/root/project/.circleci/leak_suppression.txt"
UBSAN_OPTIONS: "print_stacktrace=1 suppressions=/root/project/.circleci/ubsan_suppression.txt"
ASAN_OPTIONS: "alloc_dealloc_mismatch=0"
Expand All @@ -116,7 +118,7 @@ jobs:
docker:
- image: helics/buildenv:sanitizers-14
environment:
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'
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'

steps:
- checkout
Expand All @@ -127,7 +129,7 @@ jobs:
docker:
- image: helics/buildenv:sanitizers-14
environment:
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'
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'
TSAN_OPTIONS: "suppressions=/root/project/.circleci/tsan_suppression.txt"
steps:
- checkout
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ repos:
"--exclude-file=./config/spelling_ignorelines.txt",
]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.1
rev: v18.1.2
hooks:
- id: clang-format
types:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ 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.5.2][] - 2024-04-08

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.

### Fixed

- Fixed an issue with the test core leading to sporadic failures in the test suite with the connector
- Fixed compile issues on some versions of clang
- Fixed some warnings on certain builds using sanitizers
- Fixed a discrepancy in the handing of config files with the helics_apps library
- Fixed several clang tidy issues and code cleanup

### Added

- Added an `--error_on_unmatched` flag to the broker for it to error if there are any unmatched requested connectors
- Support for a broker section in config files and subcommand in the command line parsing

## [3.5.1][] - 2024-03-19

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.
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE AND NOT HELICS_D
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()

project(HELICS VERSION 3.5.1)
project(HELICS VERSION 3.5.2)

# -----------------------------------------------------------------------------
# HELICS Version number
# -----------------------------------------------------------------------------
set(HELICS_VERSION_BUILD)
# use ISO date YYYY-MM-DD
set(HELICS_DATE "2024-03-19")
set(HELICS_DATE "2024-04-08")

set(HELICS_VERSION_UNDERSCORE
"${HELICS_VERSION_MAJOR}_${HELICS_VERSION_MINOR}_${HELICS_VERSION_PATCH}"
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ branches:
- main
- develop

version: 3.5.1.{build}
version: 3.5.2.{build}

image: Visual Studio 2019

Expand Down
6 changes: 3 additions & 3 deletions scripts/run-circleci-tests-sanitizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
tests=(
"/root/project/build/bin/core-tests --gtest_filter=-*ci_skip*:*nosan*"
"/root/project/build/bin/common-tests --gtest_filter=-*ci_skip*:*nosan*"
"/root/project/build/bin/system-tests --gtest_filter=-*realtime*:*nosan*:*error*"
"/root/project/build/bin/system-tests --gtest_filter=-*realtime*:*nosan*:*error*:*ci_skip*"
"/root/project/build/bin/helics_apps-tests --gtest_filter=-*ci_skip*:*nosan*"
"/root/project/build/bin/shared-library-tests-cpp --gtest_filter=-*death*:*nosan*"
"/root/project/build/bin/shared-library-tests --gtest_filter=-*bad_input*:*evil*:*after_close*:*death*:*nosan*"
"/root/project/build/bin/shared-library-tests-cpp --gtest_filter=-*ci_skip*:*death*:*nosan*"
"/root/project/build/bin/shared-library-tests --gtest_filter=-*ci_skip*:*bad_input*:*evil*:*after_close*:*death*:*nosan*"
"/root/project/build/bin/applicationApiTests --gtest_filter=-*ci_skip*:*nosan*"
"/root/project/build/bin/filterTranslatorTests --gtest_filter=-*ci_skip*:*nosan*"
"/root/project/build/bin/messageFederateTests --gtest_filter=-*ci_skip*:*nosan*"
Expand Down
10 changes: 5 additions & 5 deletions scripts/run-circleci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
tests=(
"$1/bin/core-tests --gtest_filter=-*ci_skip*"
"$1/bin/common-tests --gtest_filter=-*ci_skip*"
"$1/bin/system-tests --gtest_filter=-*realtime*"
"$1/bin/system-tests --gtest_filter=-*ci_skip*:*realtime*"
"$1/bin/helics_apps-tests --gtest_filter=-*ci_skip*"
"$1/bin/shared-library-tests-cpp --gtest_filter=-*death*"
"$1/bin/shared-library-tests --gtest_filter=-*bad_input*:*evil*:*after_close*:*death*"
"$1/bin/shared-library-tests-cpp --gtest_filter=-*ci_skip*:*death*"
"$1/bin/shared-library-tests --gtest_filter=-*ci_skip*:*bad_input*:*evil*:*after_close*:*death*"
"$1/bin/applicationApiTests --gtest_filter=-*ci_skip*"
"$1/bin/filterTranslatorTests --gtest_filter=-*ci_skip*"
"$1/bin/messageFederateTests --gtest_filter=-*ci_skip*"
"$1/bin/valueFederateTests --gtest_filter=-*ci_skip*"
"$1/bin/helics_webserver-tests --gtest_filter=*"
"$1/bin/network-tests --gtest_filter=*"
"$1/bin/helics_webserver-tests --gtest_filter=-*ci_skip*"
"$1/bin/network-tests --gtest_filter=-*ci_skip*"
)

SUMRESULT=0
Expand Down
14 changes: 7 additions & 7 deletions src/helics/application_api/ConnectorFederateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ SPDX-License-Identifier: BSD-3-Clause
namespace helics {
ConnectorFederateManager::ConnectorFederateManager(Core* coreObj,
Federate* ffed,
LocalFederateId id,
LocalFederateId fid,
bool singleThreaded):
coreObject(coreObj), filters(!singleThreaded), translators(!singleThreaded), fed(ffed),
fedID(id)
fedID(fid)
{
}
ConnectorFederateManager::~ConnectorFederateManager() = default;
Expand Down Expand Up @@ -66,15 +66,15 @@ CloningFilter& ConnectorFederateManager::registerCloningFilter(std::string_view
{
auto handle = coreObject->registerCloningFilter(name, type_in, type_out);
if (handle.isValid()) {
auto filt = std::make_unique<CloningFilter>(fed, name, handle);
CloningFilter& f = *filt;
auto filtPtr = std::make_unique<CloningFilter>(fed, name, handle);
CloningFilter& filt = *filtPtr;
auto filts = filters.lock();
if (name.empty()) {
filts->insert(coreObject->getHandleName(handle), std::move(filt));
filts->insert(coreObject->getHandleName(handle), std::move(filtPtr));
} else {
filts->insert(name, std::move(filt));
filts->insert(name, std::move(filtPtr));
}
return f;
return filt;
}
throw(RegistrationFailure("Unable to register Filter"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/helics/application_api/ConnectorFederateManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ConnectorFederateManager {
*/
ConnectorFederateManager(Core* coreObj,
Federate* fFed,
LocalFederateId id,
LocalFederateId fid,
bool singleThreaded);
/** destructor */
~ConnectorFederateManager();
Expand Down
59 changes: 48 additions & 11 deletions src/helics/application_api/Federate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void Federate::registerFederate(const FederateInfo& fedInfo)

useJsonSerialization = fedInfo.useJsonSerialization;
observerMode = fedInfo.observer;
configFile = fedInfo.fileInUse;
configFile = fedInfo.configString;
mCurrentTime = coreObject->getCurrentTime(fedID);
if (!singleThreadFederate) {
asyncCallInfo = std::make_unique<shared_guarded_m<AsyncFedCallInfo>>();
Expand Down Expand Up @@ -1209,21 +1209,29 @@ void Federate::disconnectTransition()

void Federate::registerInterfaces(const std::string& configString)
{
// this will be deprecated at some point in the future
registerConnectorInterfaces(configString);
}

void Federate::registerConnectorInterfaces(const std::string& configString)
{
if (fileops::hasTomlExtension(configString)) {
registerConnectorInterfacesToml(configString);
} else {
try {
registerConnectorInterfacesJson(configString);
}
catch (const std::invalid_argument& e) {
throw(helics::InvalidParameter(e.what()));
}
auto hint = fileops::getConfigType(configString);
switch (hint) {
case fileops::ConfigType::JSON_FILE:
case fileops::ConfigType::JSON_STRING:
try {
registerConnectorInterfacesJson(configString);
}
catch (const std::invalid_argument& e) {
throw(helics::InvalidParameter(e.what()));
}
break;
case fileops::ConfigType::TOML_FILE:
case fileops::ConfigType::TOML_STRING:
registerConnectorInterfacesToml(configString);
break;
case fileops::ConfigType::NONE:
default:
break;
}
}

Expand Down Expand Up @@ -2159,6 +2167,35 @@ const std::string& Interface::getDestinationTargets() const
return mCore->getDestinationTargets(handle);
}

std::size_t Interface::getSourceTargetCount() const
{
const auto& targets = getSourceTargets();
if (targets.empty()) {
return 0;
}
try {
const Json::Value tvalues = fileops::loadJsonStr(targets);
return (tvalues.isArray()) ? tvalues.size() : 1;
}
catch (...) {
return 1;
}
}
std::size_t Interface::getDestinationTargetCount() const
{
const auto& targets = getDestinationTargets();
if (targets.empty()) {
return 0;
}
try {
const Json::Value tvalues = fileops::loadJsonStr(targets);
return (tvalues.isArray()) ? tvalues.size() : 1;
}
catch (...) {
return 1;
}
}

const std::string& Interface::getDisplayName() const
{
return (mName.empty() ? getSourceTargets() : mName);
Expand Down
4 changes: 4 additions & 0 deletions src/helics/application_api/Federate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,10 @@ class HELICS_CXX_EXPORT Interface {
/** get the destination targets for an interface, either the destinations of data for endpoints
* or publications, or the destination endpoints for a filter*/
const std::string& getDestinationTargets() const;
/** get the number of source targets*/
std::size_t getSourceTargetCount() const;
/** get the number of destination targets*/
std::size_t getDestinationTargetCount() const;
/** close the interface*/
void close();
/** disconnect the object from the core*/
Expand Down

0 comments on commit c2f4bd2

Please sign in to comment.