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
5 changes: 3 additions & 2 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "CI Tests"
name: "C++ Unit Tests"
on:
push:
branches:
Expand All @@ -7,7 +7,7 @@ on:
branches:
- main
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
group: build-unit-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
codespell-check:
Expand Down Expand Up @@ -122,6 +122,7 @@ jobs:
path: ./coverage.xml
retention-days: 1
if-no-files-found: error

# upload-to-codecov:
# name: "Codecov report upload"
# needs: [ "unit-tests" , "codespell-check" , "format-check" ]
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/python-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Python Bindings Unit Tests"
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: build-python-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
python-tests:
name: "Test python bindings"
strategy:
matrix:
on: [ 'ubuntu-24.04', 'macos-15-intel' , 'macos-26' ]
python: [ '3.10', '3.11', '3.12', '3.13' ]

runs-on: ${{matrix.on}}
env:
INSTALL_PREFIX: "/usr/local"

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: ${{matrix.python}}
- name: "Install packages ubuntu"
if: ${{ startsWith(matrix.on, 'ubuntu-') }}
run: sudo apt install -y ninja-build g++

- name: "Setup macos runner"
if: ${{ startsWith(matrix.on, 'macos-') }}
uses: Homebrew/actions/setup-homebrew@main

- name: "Install macos packages"
if: ${{ startsWith(matrix.on, 'macos-') }}
run: brew install ninja gcc cmake

- name: "Run CMake"
run: |
cmake -DCMAKE_BUILD_TYPE=Release \
-G Ninja \
-B ../build \
-S ${GITHUB_WORKSPACE}
cmake --build ../build -j $(nproc)
sudo cmake --install ../build --prefix $INSTALL_PREFIX

- name: "Install python test environment"
run: python -m pip install -r ${GITHUB_WORKSPACE}/test-requirement.txt

- name: "Run python tests"
run: |
export CAPIO_CL_PY_BINDING_PATH=$(realpath $INSTALL_PREFIX/lib/python/py_capio_cl*)
echo "Python module path: $CAPIO_CL_PY_BINDING_PATH"
pytest ${GITHUB_WORKSPACE}/tests/python/test_*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# IntelliJ
.idea/**
cmake-build-*/**
.venv/**
__pycache__/
*.pyc

# Prerequisites
*.d
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

include(FetchContent)
include(GNUInstallDirs)

#####################################
# Options
Expand All @@ -40,7 +41,7 @@ endif ()
FetchContent_Declare(
simdjson
GIT_REPOSITORY https://github.com/simdjson/simdjson.git
GIT_TAG v3.3.0
GIT_TAG v4.0.7
)
FetchContent_Declare(
pybind11
Expand Down Expand Up @@ -98,6 +99,12 @@ if (BUILD_PYTHON_BINDINGS)
${CMAKE_CURRENT_SOURCE_DIR}
)

install(TARGETS ${PYTHON_BIND_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/python
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/python
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

endif ()


Expand All @@ -116,7 +123,7 @@ if (CAPIO_CL_BUILD_TESTS)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

add_executable(CAPIO_CL_tests tests/main.cpp)
add_executable(CAPIO_CL_tests tests/cpp/main.cpp)

target_link_libraries(CAPIO_CL_tests PRIVATE
libcapio_cl
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
# CAPIO-CL — Cross-Application Programmable I/O Coordination Language

[![CI](https://github.com/High-Performance-IO/CAPIO-CL/actions/workflows/ci-test.yml/badge.svg)](https://github.com/High-Performance-IO/CAPIO-CL/actions/workflows/ci-test.yml)
[![Python Bindings](https://github.com/High-Performance-IO/CAPIO-CL/actions/workflows/python-bindings.yml/badge.svg)](https://github.com/High-Performance-IO/CAPIO-CL/actions/workflows/python-bindings.yml)

![CMake](https://img.shields.io/badge/CMake-%E2%89%A53.15-blue?logo=cmake&logoColor=white)
![C++](https://img.shields.io/badge/C%2B%2B-%E2%89%A517-blueviolet?logo=c%2B%2B&logoColor=white)
![Python Bindings](https://img.shields.io/badge/Python_Bindings-3.8–3.14-darkgreen?style=flat&logo=python&logoColor=white&labelColor=gray)
![Python Bindings](https://img.shields.io/badge/Python_Bindings-3.10–3.14-darkgreen?style=flat&logo=python&logoColor=white&labelColor=gray)

![Ubuntu](https://img.shields.io/badge/Ubuntu-121212?logo=ubuntu&logoColor=E95420)
![macOS](https://img.shields.io/badge/macOS-121212?logo=apple&logoColor=white)

[![DOI](https://img.shields.io/badge/DOI-10.1007%2Fs10766--025--00789--0-%23cc5500?logo=doi&logoColor=white&labelColor=2b2b2b)](https://doi.org/10.1007/s10766-025-00789-0)

Expand Down
9 changes: 8 additions & 1 deletion bindings/python_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PYBIND11_MODULE(py_capio_cl, m) {
.def("setFileDeps", &capiocl::Engine::setFileDeps)
.def("setStoreFileInMemory", &capiocl::Engine::setStoreFileInMemory)
.def("setStoreFileInFileSystem", &capiocl::Engine::setStoreFileInFileSystem)
.def("getDirectoryFileCount", &capiocl::Engine::setDirectoryFileCount)
.def("getDirectoryFileCount", &capiocl::Engine::getDirectoryFileCount)
.def("getCommitRule", &capiocl::Engine::getCommitRule)
.def("getFireRule", &capiocl::Engine::getFireRule)
.def("getProducers", &capiocl::Engine::getProducers)
Expand All @@ -53,6 +53,13 @@ PYBIND11_MODULE(py_capio_cl, m) {
return "<Engine repr at " + std::to_string(reinterpret_cast<uintptr_t>(&e)) + ">";
});

m.attr("MODE_UPDATE") = py::str(capiocl::MODE_UPDATE);
m.attr("MODE_NO_UPDATE") = py::str(capiocl::MODE_NO_UPDATE);
m.attr("COMMITTED_ON_CLOSE") = py::str(capiocl::COMMITTED_ON_CLOSE);
m.attr("COMMITTED_ON_FILE") = py::str(capiocl::COMMITTED_ON_FILE);
m.attr("COMMITTED_N_FILES") = py::str(capiocl::COMMITTED_N_FILES);
m.attr("COMMITTED_ON_TERMINATION") = py::str(capiocl::COMMITTED_ON_TERMINATION);

py::class_<capiocl::Parser>(m, "Parser", "The CAPIO-CL Parser component.")
.def("parse", &capiocl::Parser::parse)
.def("__str__",
Expand Down
4 changes: 4 additions & 0 deletions capiocl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <unordered_map>
#include <vector>

#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 1024
#endif

/**
* Compatibility layer for CAPIO logger.
*/
Expand Down
1 change: 1 addition & 0 deletions src/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <algorithm>
#include <fnmatch.h>
#include <iostream>
#include <sstream>

void capiocl::Engine::print() const {
// First message
Expand Down
2 changes: 1 addition & 1 deletion src/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ capiocl::Parser::parse(const std::filesystem::path &source,
std::vector<std::filesystem::path> streaming_names;
std::vector<std::string> file_deps;
long int n_close = -1;
long n_files = -1;
int64_t n_files = -1;
bool is_file = true;

simdjson::ondemand::array name;
Expand Down
1 change: 1 addition & 0 deletions test-requirement.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==8.4.2
File renamed without changes.
Loading
Loading