Skip to content

Conversation

@lifflander
Copy link
Collaborator

Fixes #2183

@lifflander lifflander linked an issue Aug 10, 2023 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Aug 11, 2023

Pipelines results

PR tests (gcc-12, ubuntu, mpich)

Build for 1c98fba (2023-11-09 17:49:25 UTC)

FAILED: src/CMakeFiles/vt.dir/Unity/unity_20_cxx.cxx.o 
/usr/bin/ccache /usr/lib/ccache/g++ -DJSON_USE_IMPLICIT_CONVERSIONS=1 -DVT_NO_COLOR_ENABLED -I/vt/lib/CLI -I/build/vt/release -I/vt/src -I/vt/lib/json/include -I/vt/lib/brotli/c/include -I/vt/lib/libfort/lib -isystem /ovis/LDMS_install/include -isystem /vt/lib/fmt/include -isystem /vt/lib/EngFormat-Cpp/include -isystem /build/checkpoint/install/include -O3 -DNDEBUG -Wall -pedantic -Wshadow -Wno-unknown-pragmas -Wsign-compare -ftemplate-backtrace-limit=100 -Werror -std=c++17 -MD -MT src/CMakeFiles/vt.dir/Unity/unity_20_cxx.cxx.o -MF src/CMakeFiles/vt.dir/Unity/unity_20_cxx.cxx.o.d -o src/CMakeFiles/vt.dir/Unity/unity_20_cxx.cxx.o -c /build/vt/src/CMakeFiles/vt.dir/Unity/unity_20_cxx.cxx
In file included from /vt/src/vt/vrt/collection/manager.impl.h:69,
                 from /vt/src/vt/vrt/collection/manager.h:1773,
                 from /vt/src/vt/scheduler/scheduler.cc:49,
                 from /build/vt/src/CMakeFiles/vt.dir/Unity/unity_20_cxx.cxx:5:
/vt/src/vt/vrt/collection/balance/node_lb_data.h:267:24: error: 'nlohman' has not been declared
  267 |   void writeJSONToLDMS(nlohman::json& j);
      |                        ^~~~~~~
/vt/src/vt/vrt/collection/balance/node_lb_data.h:267:37: error: expected ',' or '...' before '&' token
  267 |   void writeJSONToLDMS(nlohman::json& j);
      |                                     ^
FAILED: examples/collection/CMakeFiles/migrate_collection.dir/Unity/unity_0_cxx.cxx.o 
/usr/bin/ccache /usr/lib/ccache/g++ -DJSON_USE_IMPLICIT_CONVERSIONS=1 -DVT_NO_COLOR_ENABLED -I/vt/lib/CLI -I/vt/lib/json/include -I/vt/lib/brotli/c/include -I/vt/lib/libfort/lib -I/build/vt/release -I/vt/src -isystem /ovis/LDMS_install/include -isystem /vt/lib/fmt/include -isystem /vt/lib/EngFormat-Cpp/include -isystem /build/checkpoint/install/include -O3 -DNDEBUG -fdiagnostics-color=always -Wall -pedantic -Wshadow -Wno-unknown-pragmas -Wsign-compare -ftemplate-backtrace-limit=100 -Werror -std=c++17 -MD -MT examples/collection/CMakeFiles/migrate_collection.dir/Unity/unity_0_cxx.cxx.o -MF examples/collection/CMakeFiles/migrate_collection.dir/Unity/unity_0_cxx.cxx.o.d -o examples/collection/CMakeFiles/migrate_collection.dir/Unity/unity_0_cxx.cxx.o -c /build/vt/examples/collection/CMakeFiles/migrate_collection.dir/Unity/unity_0_cxx.cxx
In file included from /vt/src/vt/vrt/collection/manager.impl.h:69,
                 from /vt/src/vt/vrt/collection/manager.h:1773,
                 from /vt/src/vt/vrt/collection/collection_headers.h:49,
                 from /vt/src/vt/transport.h:69,
                 from /vt/examples/collection/migrate_collection.cc:44,
                 from /build/vt/examples/collection/CMakeFiles/migrate_collection.dir/Unity/unity_0_cxx.cxx:3:
/vt/src/vt/vrt/collection/balance/node_lb_data.h:267:24: error: 'nlohman' has not been declared
  2%0D%0A%0D%0A%0D%0A ==> And there is more. Read log. <==

Build log


vt-build-amd64-ubuntu-20-04-clang-9-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-alpine-3-16-clang-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-24-04-gcc-14-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-10-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-10-openmpi-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-22-04-clang-15-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-22-04-gcc-12-vtk-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-22-04-clang-12-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-10-openmpi-cpp-spack

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-22-04-clang-11-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-24-04-clang-16-zoltan-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-22-04-gcc-12-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-22-04-gcc-11-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-icpx-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-24-04-clang-18-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-9-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-24-04-gcc-13-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-9-cuda-11-4-3-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

/vt/src/vt/pipe/pipe_manager.impl.h(135): warning: missing return statement at end of non-void function "vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&vt::vrt::collection::lb::GreedyLB::collectHandler, Target=vt::objgroup::proxy::ProxyElm<vt::vrt::collection::lb::GreedyLB>]"
          detected during:
            instantiation of "auto vt::pipe::PipeManager::makeSend<f,Target>(Target) [with f=&vt::vrt::collection::lb::GreedyLB::collectHandler, Target=vt::objgroup::proxy::ProxyElm<vt::vrt::collection::lb::GreedyLB>]" 
/vt/src/vt/objgroup/proxy/proxy_objgroup.impl.h(221): here
            instantiation of "vt::objgroup::proxy::Proxy<ObjT>::PendingSendType vt::objgroup::proxy::Proxy<ObjT>::reduce<f,Op,Target,Args...>(Target, Args &&...) const [with ObjT=vt::vrt::collection::lb::GreedyLB, f=&vt::vrt::collection::lb::GreedyLB::collectHandler, Op=vt::collective::PlusOp, Target=vt::objgroup::proxy::ProxyElm<vt::vrt::collection::lb::GreedyLB>, Args=<vt::vrt::collection::lb::GreedyPayload>]" 
/vt/src/vt/vrt/collection/balance/greedylb/greedylb.cc(222): here

/vt/src/vt/runtime/runtime.cc(1068): warning: parameter "comm" was declared but never referenced

/vt/src/vt/runtime/component/component_pack.impl.h(55): warning: parameter "seq" was declared but never referenced
          detected during:
            instantiation of "std::unique_ptr<T, std::default_delete<T>> vt::runtime::component::<unnamed>::tupleCons<T,Tuple>(Tuple &&) [with T=vt::arguments::ArgConfig, Tuple=std::tuple<std::unique_ptr<vt::arguments::ArgConfig, std::default_delete<vt::arguments::ArgConfig>>>]" 
(104): here
            instantiation of "vt::runtime::component::registry::AutoHandlerType vt::runtime::component::ComponentPack::registerComponent(T **, vt::runtime::component::BaseComponent::StartupDepsPack<StartupDeps...>, vt::runtime::component::BaseComponent::RuntimeDepsPack<RuntimeDeps...>, Cons &&...) [with T=vt::arguments::ArgConfig, StartupDeps=<>, RuntimeDeps=<>, Cons=<std::unique_ptr<v

 ==> And there is more. Read log. <==

View job log


vt-build-amd64-ubuntu-24-04-clang-17-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-24-04-clang-16-vtk-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-clang-10-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-9-cuda-12-2-0-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

/vt/lib/fmt/include/fmt-vt/base.h(472): warning #128-D: loop is not reachable
    for (; n != 0; ++s1, ++s2, --n) {
    ^
          detected during:
            instantiation of "auto fmt::v11::detail::compare(const Char *, const Char *, std::size_t)->int [with Char=char]" at line 591
            instantiation of "auto fmt::v11::basic_string_view<Char>::compare(fmt::v11::basic_string_view<Char>) const->int [with Char=char]" at line 598
            instantiation of class "fmt::v11::basic_string_view<Char> [with Char=char]" at line 2621
            instantiation of "auto fmt::v11::basic_format_args<Context>::get_id(fmt::v11::basic_string_view<Char>) const->int [with Context=fmt::v11::context, Char=char]" at line 2664

Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"

/vt/lib/fmt/include/fmt-vt/format.h(2596): warning #2417-D: constexpr constructor calls non-constexpr function "fmt::v11::basic_memory_buffer<T, SIZE, Allocator>::basic_memory_buffer(const Allocator &) [with T=fmt::v11::detail::bigint::bigit, SIZE=32UL, Allocator=fmt::v11::detail::allocator<fmt::v11::detail::bigint::bigit>]"
    constexpr bigint() : exp_(0) {}
                                 ^

/vt/lib/fmt/include/fmt-vt/base.h(472): warning #128-D: loop is not reachable
    for (; n != 0; ++s1, ++s2, --n) {
    ^
          detected during:
            instantiation of "auto fmt::v11::detail::compare(const Char *, const Char *, std::size_t)->int [with Char=char]" at line 591
            instantiation of "auto fmt::v11::basic_string_view<Char>::compare(fmt::v11::basic_string_view<Char>) const->int [with Char=char]" at line 598
            instantiation of class "fmt::v11::basic_string_view<Char> [with Char=char]" at line 2621
            instantiation of "auto fmt::v11::basic_format_args<Context>::get_id(fmt::v11::basic_string_view<Char>) const->int [with Context=fmt::v11::context, Char=char]" at line 2664

Remark: The warnings can be suppressed with "-diag-suppress <warning-n

 ==> And there is more. Read log. <==

View job log


vt-build-amd64-ubuntu-22-04-clang-14-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-9-cpp-docs

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-22-04-clang-13-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


vt-build-amd64-ubuntu-20-04-gcc-9-ldms-cpp

Build for cee9682 (2025-08-12 15:20:44 UTC)

Compilation – successful

Testing – passed

View job log


@JacobDomagala JacobDomagala force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from 365191b to cacd48a Compare September 30, 2023 13:16
@JacobDomagala JacobDomagala self-assigned this Oct 2, 2023
@JacobDomagala JacobDomagala force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch 2 times, most recently from 8baa8fc to 7b49e32 Compare October 3, 2023 13:02
@JacobDomagala
Copy link
Member

Code used for reading the data:

#include <ldms/ldms.h>
#include <ldms/ldmsd_stream.h>
#include <ovis_util/util.h>

int stream_handler(ldmsd_stream_client_t c, void *ctxt,
                    ldmsd_stream_type_t stream_type,
                    const char *data, size_t data_len,
                    json_entity_t entity)
{
    // Process the received data
    printf("%.*s\n", (int)data_len, data);

    return 0;
}

int main()
{
    ldms_init(256);
    ldms_t ldms = ldms_xprt_new_with_auth("sock", "none", NULL);
    int rc = ldms_xprt_connect_by_name(ldms, "localhost", "10444", NULL, NULL);
    if(!rc){
      printf("Error code %d \n", rc);
    }
    ldmsd_stream_subscribe("LB_data", stream_handler, NULL);
    while (1){
         // Keep running to continue receiving data
    }
    ldms_xprt_put(ldms);
    return 0;
}

Config file:
export HOSTNAME=localhost
export COMPONENT_ID=1

load name=hello_sampler
config name=hello_sampler producer=${HOSTANAME} instance=${HOSTNAME}/hello_sampler component_id=${COMPONENT_ID} stream=LB_data

Script to launch the LDMS deamon:

#!/bin/bash

TOP=/ovis/LDMS_install
export LD_LIBRARY_PATH=$TOP/lib/:$TOP/lib:$LD_LIBRARY_PATH
export LDMSD_PLUGIN_LIBPATH=$TOP/lib/ovis-ldms
export ZAP_LIBPATH=$TOP/lib/ovis-ldms
export PATH=$TOP/sbin:$TOP/bin:$PATH
export PYTHONPATH=$TOP/lib/python2.7/site-packages


ldmsd -x sock:10444 -c /ldmsd.conf -l /tmp/demo_ldmsd_log -v DEBUG -r $(pwd)/ldmsd.pid

@JacobDomagala JacobDomagala force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch 5 times, most recently from caca0d1 to 1939ddb Compare October 10, 2023 16:18
@lifflander lifflander force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from 1939ddb to 1c98fba Compare November 9, 2023 17:49
@ppebay ppebay assigned Logan590 and unassigned JacobDomagala Jul 14, 2025
@Logan590 Logan590 force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from fb560c0 to 78c2a34 Compare July 16, 2025 16:38
@github-actions
Copy link

github-actions bot commented Jul 16, 2025

clang-format output for this changeset:

diff --git a/src/vt/configs/features/features_defines.h b/src/vt/configs/features/features_defines.h
index 3e645c2fb..39c01bbc1 100644
--- a/src/vt/configs/features/features_defines.h
+++ b/src/vt/configs/features/features_defines.h
@@ -63,7 +63,7 @@
 #define vt_feature_memory_pool         0 || vt_feature_cmake_memory_pool
 #define vt_feature_priorities          0 || vt_feature_cmake_priorities
 #define vt_feature_fcontext            0 || vt_feature_cmake_fcontext
-#define vt_feature_ldms                0 || vt_feature_cmake_ldms
+#define vt_feature_ldms 0 || vt_feature_cmake_ldms
 #define vt_feature_mimalloc            0 || vt_feature_cmake_mimalloc
 #define vt_feature_mpi_access_guards   0 || vt_feature_cmake_mpi_access_guards
 #define vt_feature_zoltan              0 || vt_feature_cmake_zoltan
diff --git a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
index 1f7f8adc8..0e23ab61b 100644
--- a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
+++ b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
@@ -631,11 +631,10 @@ void LBManager::stagePreLBStatistics(const StatisticMapType &statistics) {
   nlohmann::json j;
   j["pre-LB"] = lb::jsonifyPhaseStatistics(statistics);
 
-
-  #if vt_check_enabled(ldms)
+#if vt_check_enabled(ldms)
   j["ts"] = MPI_Wtime();
   theNodeLBData()->writeJSONToLDMS(j);
-  #endif
+#endif
 
   if (!statistics_writer_) {
     createStatisticsFile();
diff --git a/src/vt/vrt/collection/balance/node_lb_data.cc b/src/vt/vrt/collection/balance/node_lb_data.cc
index 2d87ed386..bff24dd3e 100644
--- a/src/vt/vrt/collection/balance/node_lb_data.cc
+++ b/src/vt/vrt/collection/balance/node_lb_data.cc
@@ -67,7 +67,6 @@
 
 #include INCLUDE_FMT_FORMAT
 
-
 namespace vt { namespace vrt { namespace collection { namespace balance {
 
 void NodeLBData::setProxy(objgroup::proxy::Proxy<NodeLBData> in_proxy) {
@@ -169,8 +168,12 @@ void NodeLBData::initializeLDMS() {
 
   const auto hostname = getenv("VT_LDMS_HOSTNAME");
   const auto port = getenv("VT_LDMS_PORT");
-  const auto returnCode = ldms_xprt_connect_by_name(ldms_, hostname, port, NULL, NULL);
-  vtWarnIf(returnCode == 0, fmt::format("ldms_xprt_connect_by_name failed with code {} \n", returnCode));
+  const auto returnCode =
+    ldms_xprt_connect_by_name(ldms_, hostname, port, NULL, NULL);
+  vtWarnIf(
+    returnCode == 0,
+    fmt::format("ldms_xprt_connect_by_name failed with code {} \n", returnCode)
+  );
 }
 #endif
 
@@ -340,9 +343,8 @@ void NodeLBData::outputLBDataForPhase(PhaseType phase) {
 void NodeLBData::writeJSONToLDMS([[maybe_unused]] const nlohmann::json& j) {
   if (ldms_prev_submission_ == 0) {
     ldms_prev_submission_ = MPI_Wtime();
-  } else if (
-    (MPI_Wtime() - ldms_prev_submission_) * 1000.0 < (double)ldms_milli_freq_
-  ) {
+  } else if ((MPI_Wtime() - ldms_prev_submission_) * 1000.0 <
+             (double)ldms_milli_freq_) {
     return;
   } else {
     ldms_prev_submission_ = MPI_Wtime();
@@ -352,7 +354,10 @@ void NodeLBData::writeJSONToLDMS([[maybe_unused]] const nlohmann::json& j) {
   const auto returnVal = ldmsd_stream_publish(
     ldms_, "vtLBStats", LDMSD_STREAM_JSON, jsonStr.c_str(), jsonStr.length() + 1
   );
-  vtWarnIf(returnVal == 0, fmt::format("ldmsd_stream_publish returned {}!\n", returnVal));
+  vtWarnIf(
+    returnVal == 0,
+    fmt::format("ldmsd_stream_publish returned {}!\n", returnVal)
+  );
 }
 #endif
 

@Logan590 Logan590 marked this pull request as ready for review July 17, 2025 14:06
@Logan590 Logan590 force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from 0100832 to de1449a Compare July 17, 2025 15:07
@lifflander lifflander force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from c49ac24 to 80ed20e Compare July 17, 2025 18:28
@cz4rs
Copy link
Contributor

cz4rs commented Jul 21, 2025

@Logan590 Please fix the commit message for ca0cdd3 (just start it with #2183:).

https://github.com/DARMA-tasking/vt/wiki/Pull-Requests#commit-formatting

@Logan590 Logan590 force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from ca0cdd3 to 9637749 Compare July 22, 2025 18:24
@Logan590 Logan590 marked this pull request as draft July 25, 2025 10:27
@Logan590
Copy link
Contributor

Logan590 commented Jul 25, 2025

@lifflander, there are many versions of LDMS. I'm currently using the version 4.3.5 to work on this issue. Does it seem good to you ?

@cz4rs cz4rs force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch 2 times, most recently from 3105c59 to a0c37c5 Compare August 11, 2025 23:33
Comment on lines +162 to +171
if (auto ldms_freq = getenv("VT_LDMS_MILLI_FREQ")) {
ldms_milli_freq_ = atoi(ldms_freq);
}
const auto xPrt = getenv("VT_LDMS_XPRT");
const auto auth = getenv("VT_LDMS_AUTH");
ldms_ = ldms_xprt_new_with_auth(xPrt, NULL, auth, NULL);
vtWarnIf(ldms_, "ldms_xprt_new_with_auth failed!");

const auto hostname = getenv("VT_LDMS_HOSTNAME");
const auto port = getenv("VT_LDMS_PORT");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those variables should be documented along with the LDMS test procedure described earlier. Maybe a wiki page?

@cz4rs cz4rs force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from a0c37c5 to f1c010d Compare August 12, 2025 07:44
@cz4rs cz4rs self-requested a review August 12, 2025 12:52
@cz4rs cz4rs force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from 6968966 to 8146684 Compare August 12, 2025 14:02
@cz4rs
Copy link
Contributor

cz4rs commented Aug 12, 2025

@JacobDomagala Can you please have a look?

Copy link
Member

@JacobDomagala JacobDomagala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@cz4rs cz4rs force-pushed the 2183-create-ldma-stream-publish-for-phase-data branch from 5004ca8 to ce87f55 Compare August 12, 2025 15:20
Copy link
Contributor

@cz4rs cz4rs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in the parts I haven't touched.

Copy link
Collaborator Author

@lifflander lifflander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@lifflander lifflander merged commit e194d0c into develop Aug 12, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create LDMS stream publish for phase data

5 participants