Skip to content

Commit

Permalink
#2183: Use env variables for LDMS inputs instead of hardcoded values
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Oct 10, 2023
1 parent 628bd73 commit 1939ddb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ci/docker/ubuntu-gnu-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ RUN if test ${zoltan_enabled} -eq 1; then \

ENV VT_LDMS_INCLUDES_DIR="/ovis/LDMS_install/include"
ENV VT_LDMS_LIBS_DIR="/ovis/LDMS_install/lib"
ENV VT_LDMS_XPTR="sock"
ENV VT_LDMS_AUTH="none"
ENV VT_LDMS_HOSTNAME="localhost"
ENV VT_LDMS_PORT="10444"

COPY ./ci/deps/ldms.sh ldms.sh
RUN if test ${ldms_enabled} -eq 1; then \
Expand Down
8 changes: 6 additions & 2 deletions src/vt/vrt/collection/balance/node_lb_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,14 @@ void NodeLBData::initialize() {
#endif

#if vt_check_enabled(ldms)
ldms_ = ldms_xprt_new_with_auth("sock", "none", NULL);
const auto xPtr = getenv("VT_LDMS_XPTR");
const auto auth = getenv("VT_LDMS_AUTH");
ldms_ = ldms_xprt_new_with_auth(xPtr, auth, NULL);
vtWarnIf(ldms_, "ldms_xprt_new_with_auth failed!");

const auto returnCode = ldms_xprt_connect_by_name(ldms_, "localhost", "10444", NULL, NULL);
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));
#endif
}
Expand Down

0 comments on commit 1939ddb

Please sign in to comment.