Skip to content

Commit

Permalink
Adding LDMS Connector/Forwarder (#518)
Browse files Browse the repository at this point in the history
* Adding LDMS

Adding LDMS calls to CMakeLists

* Adding LDMS to Services

Adding the Caliper-LDMS connector/forwarder and CMakeLists files to services directory.

* Adding LDMS Libraries

Adding LDMS Libraries to CMakeList to allow cali-query to identify LDMS publish functions.

* Create README.md

* Update README.md

* Update LdmsForwarder.cpp

* Adding CMake file

* Update CMakeLists.txt

Taking out unnecessary LDMS lib link

* Updating Log Messages

* Update README.md

Adding LDMS path to README instructions.

* Adding Env Variables Default Values

This avoids seg faulting the program if user's do not set LDMS's env variables.

* Update CMakeLists.txt

---------

Co-authored-by: David Boehme <[email protected]>
  • Loading branch information
vsurjadidjaja and daboehme authored Dec 8, 2023
1 parent 788c6fd commit ecd9138
Show file tree
Hide file tree
Showing 5 changed files with 396 additions and 2 deletions.
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ add_caliper_option(WITH_GOTCHA "Enable GOTCHA wrapping" ${CALIPER_HAVE_LINUX}
add_caliper_option(WITH_ROCTX "Enable AMD RocTX support" FALSE)
add_caliper_option(WITH_ROCTRACER "Enable AMD RocTracer support" FALSE)
add_caliper_option(WITH_ROCM "Enable AMD RocTracer and RocTX support" FALSE)
# add_caliper_option(WITH_SOS "Enable SOSFlow data management" FALSE)
#add_caliper_option(WITH_SOS "Enable SOSFlow data management" FALSE)
add_caliper_option(WITH_TAU "Enable TAU service (TAU Performance System)" FALSE)
add_caliper_option(WITH_VTUNE "Enable Intel(R) VTune(tm) annotation bindings" FALSE)
add_caliper_option(WITH_ADIAK "Enable adiak support" FALSE)
Expand All @@ -78,6 +78,7 @@ add_caliper_option(WITH_PCP "Enable performance co-pilot support" FALSE)
add_caliper_option(WITH_VARIORUM "Enable Variorum support" FALSE)
add_caliper_option(WITH_UMPIRE "Enable Umpire statistics support" FALSE)
add_caliper_option(WITH_CRAYPAT "Enable CrayPAT region forwarding support" FALSE)
add_caliper_option(WITH_LDMS "Enable LDMS forwarder" TRUE)

add_caliper_option(USE_EXTERNAL_GOTCHA "Use pre-installed gotcha instead of building our own" FALSE)

Expand Down Expand Up @@ -461,6 +462,17 @@ if (WITH_UMPIRE)
list(APPEND CALIPER_EXTERNAL_LIBS umpire)
endif()

if (WITH_LDMS)
include(FindLDMS)
if (LDMS_FOUND)
set(CALIPER_HAVE_LDMS TRUE)
set(CALIPER_LDMS_CMAKE_MSG "Yes, using ${LDMS_LIBLDMS} ${LDMS_LIBSTREAM}")
list(APPEND CALIPER_EXTERNAL_LIBS ${LDMS_LIBLDMS} ${LDMS_LIBSTREAM})
message("Include Directory: ${LDMS_INCLUDE_DIRS}")
message("Library Names: ${LDMS_LIBLDMS} ${LDMS_LIBSTREAM}")
endif()
endif()

# PGI 17.x has issues with some constexpr constructors
if(CMAKE_CXX_COMPILER_ID MATCHES PGI)
set(CALIPER_REDUCED_CONSTEXPR_USAGE TRUE)
Expand Down Expand Up @@ -583,7 +595,8 @@ set(CALIPER_MODULES
histogram
variorum
umpire
CrayPAT)
CrayPAT
LDMS)

foreach(_caliper_module ${CALIPER_MODULES})
string(LENGTH "${_caliper_module}" _strlen)
Expand Down
50 changes: 50 additions & 0 deletions cmake/FindLDMS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Try to find LDMS headers and libraries.
#
# Usage of this module as follows:
#
# find_package(LDMS)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# LDMS_PREFIX Set this variable to the root installation of
# LDMS if the module has problems finding the
# proper installation path.
#
# Variables defined by this module:
#
# LDMS_FOUND System has LDMS libraries and headers
# LDMS_LIBRARIES The LDMS library
# LDMS_INCLUDE_DIRS The location of LDMS headers

find_library(LDMS_LIBLDMS
NAMES ldms
PATHS /usr/lib64 /usr/lib /opt/ovis/lib
)

find_library(LDMS_LIBSTREAM
NAMES ldmsd_stream
PATHS /usr/lib64 /usr/lib /opt/ovis/lib
)

find_path(LDMS_INCLUDE_DIRS
NAMES "ldms.h" "ldmsd_stream.h"
PATH_SUFFIXES "ldms"
)
message(STATUS "libldms.so => ${LDMS_LIBRARIES}")
message(STATUS "ldmsd_stream.h => ${LDMS_INCLUDE_DIRS}")
message(STATUS "ldms.h => ${LDMS_INCLUDE_DIRS}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LDMS DEFAULT_MSG
LDMS_LIBLDMS
LDMS_LIBSTREAM
LDMS_INCLUDE_DIRS
)

mark_as_advanced(
LDMS_PREFIX_DIRS
LDMS_LIBLDMS
LDMS_LIBSTREAM
LDMS_INCLUDE_DIRS
)
11 changes: 11 additions & 0 deletions src/services/ldms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include_directories(${LDMS_INCLUDE_DIRS})

set(CALIPER_LDMS_SOURCES
LdmsForwarder.cpp)

add_library(caliper-ldms OBJECT ${CALIPER_LDMS_SOURCES})

add_service_objlib("caliper-ldms")
add_caliper_service("ldms CALIPER_HAVE_LDMS")


Loading

0 comments on commit ecd9138

Please sign in to comment.