Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: "Test Python bindings"
strategy:
matrix:
on: [ 'ubuntu-24.04', 'macos-15-intel', 'macos-26' ]
on: [ 'ubuntu-24.04', 'macos-15-intel', 'macos-15' ]
python: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]

runs-on: ${{ matrix.on }}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ dist/**

# debug information files
*.dwo
**.DS_Store
**.DS_Store

*build*
36 changes: 26 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,18 @@ FetchContent_Declare(
GIT_TAG v1.8.1
)

FetchContent_Declare(
calf
GIT_REPOSITORY https://github.com/High-Performance-IO/calf.git
GIT_TAG v0.1.1
)

# JSONCONS build flags
set(JSONCONS_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(JSONCONS_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(JSONCONS_BUILD_FUZZERS OFF CACHE BOOL "" FORCE)

FetchContent_MakeAvailable(jsoncons tomlplusplus)
FetchContent_MakeAvailable(jsoncons tomlplusplus calf)

if (BUILD_PYTHON_BINDINGS)
FetchContent_Declare(
Expand Down Expand Up @@ -129,24 +136,33 @@ set(CAPIO_CL_HEADERS capiocl.hpp)
# Library target
add_library(libcapio_cl STATIC ${CAPIO_SRC} ${CAPIO_CL_HEADERS})


target_include_directories(libcapio_cl PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
${jsoncons_SOURCE_DIR}/include
${CAPIOCL_JSON_SCHEMAS_DIRECTORY}
${TOMLPLUSPLUS_SOURCE_DIR}/include
${CALF_SOURCE_DIR}
)

target_link_libraries(libcapio_cl PUBLIC)
target_link_libraries(libcapio_cl PRIVATE
tomlplusplus::tomlplusplus
)
tomlplusplus::tomlplusplus)

find_library(LIBANL anl)
if(LIBANL)
if (LIBANL)
target_link_libraries(libcapio_cl PRIVATE ${LIBANL})
endif ()

#####################################
# set CALF logger component name
#####################################
calf_enable_log(libcapio_cl $<IF:$<CONFIG:Debug>,ON,OFF>)
calf_set_component(libcapio_cl "capiocl")
calf_set_default_log_dir(libcapio_cl "./capiocl_logs")
target_include_directories(libcapio_cl PRIVATE ${CALF_SOURCE_DIR})

#####################################
# Install rules
#####################################
Expand Down Expand Up @@ -202,7 +218,7 @@ if (CAPIO_CL_BUILD_TESTS)
CURL::libcurl
)

if(LIBANL)
if (LIBANL)
target_link_libraries(CAPIO_CL_tests PRIVATE ${LIBANL})
endif ()

Expand Down Expand Up @@ -296,11 +312,11 @@ if (ENABLE_COVERAGE_PIPELINE)

COMMAND ${LCOV_BIN}
--remove ${COVERAGE_INFO}
"*jsoncons*"
"/usr/include/*"
"*googletest*"
"*tests/*"
${COVERAGE_REMOVE_PATTERNS}
"*jsoncons*"
"/usr/include/*"
"*googletest*"
"*tests/*"
${COVERAGE_REMOVE_PATTERNS}
--ignore-errors unused
--ignore-errors inconsistent
--output-file ${COVERAGE_INFO}
Expand Down
27 changes: 13 additions & 14 deletions capiocl/monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define CAPIO_CL_MONITOR_H

#include <atomic>
#include <cstddef>
#include <filesystem>
#include <mutex>
#include <set>
Expand All @@ -12,17 +13,15 @@

#include "configuration.h"

#ifndef PATH_MAX
#define PATH_MAX 4096
#endif

#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 1024
#endif

/// @brief Namespace containing the CAPIO-CL Monitor components
namespace capiocl::monitor {

/// @brief Buffer size used to store a null-terminated host name.
inline constexpr std::size_t HOSTNAME_BUFFER_SIZE = 1024;

/// @brief Maximum path storage used in multicast monitor messages.
inline constexpr std::size_t PATH_BUFFER_SIZE = 4096;

/// @brief Constant value for when a home node is not found
static const std::string NO_HOME_NODE = "<NONE>";

Expand Down Expand Up @@ -84,7 +83,7 @@ class MonitorInterface {
/**
* @brief hostname of the current instance
*/
mutable char _hostname[HOST_NAME_MAX] = {0};
mutable char _hostname[HOSTNAME_BUFFER_SIZE] = {0};

public:
/**
Expand Down Expand Up @@ -118,7 +117,7 @@ class MonitorInterface {
* @param path
* @return the home node responsible for the given path
*/
virtual const std::string &getHomeNode(const std::filesystem::path &path) const;
virtual std::string getHomeNode(const std::filesystem::path &path) const;
};

/**
Expand All @@ -133,7 +132,7 @@ class MonitorInterface {
*/
class MulticastMonitor final : public MonitorInterface {

static constexpr int MESSAGE_SIZE = (2 + PATH_MAX + PATH_MAX); ///< Max network message size.
static constexpr int MESSAGE_SIZE = 2 + (2 * PATH_BUFFER_SIZE); ///< Max network message size.

/**
* @brief Background threads used to listen for commit messages and for home nodes.
Expand Down Expand Up @@ -229,7 +228,7 @@ class MulticastMonitor final : public MonitorInterface {
bool isCommitted(const std::filesystem::path &path) const override;
void setCommitted(const std::filesystem::path &path) const override;
void setHomeNode(const std::filesystem::path &path) const override;
const std::string &getHomeNode(const std::filesystem::path &path) const override;
std::string getHomeNode(const std::filesystem::path &path) const override;
};

/**
Expand Down Expand Up @@ -288,7 +287,7 @@ class FileSystemMonitor final : public MonitorInterface {
bool isCommitted(const std::filesystem::path &path) const override;
void setCommitted(const std::filesystem::path &path) const override;
void setHomeNode(const std::filesystem::path &path) const override;
const std::string &getHomeNode(const std::filesystem::path &path) const override;
std::string getHomeNode(const std::filesystem::path &path) const override;
};

/**
Expand Down Expand Up @@ -344,4 +343,4 @@ class Monitor {
};
} // namespace capiocl::monitor

#endif // CAPIO_CL_MONITOR_H
#endif // CAPIO_CL_MONITOR_H
42 changes: 0 additions & 42 deletions capiocl/printer.h

This file was deleted.

Loading
Loading