ucm-toolkit 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ucm_toolkit/__init__.py +17 -0
- ucm_toolkit/_resources/LICENSE +21 -0
- ucm_toolkit/_resources/dev-sandbox/.clang-format +35 -0
- ucm_toolkit/_resources/dev-sandbox/.github/workflows/lint-and-build.yml +57 -0
- ucm_toolkit/_resources/dev-sandbox/.github/workflows/push-check.yml +9 -0
- ucm_toolkit/_resources/dev-sandbox/.gitignore +47 -0
- ucm_toolkit/_resources/dev-sandbox/AGENTS.md +71 -0
- ucm_toolkit/_resources/dev-sandbox/CMakeLists.txt +29 -0
- ucm_toolkit/_resources/dev-sandbox/LICENSE +21 -0
- ucm_toolkit/_resources/dev-sandbox/cmake/DetectRuntime.cmake +187 -0
- ucm_toolkit/_resources/dev-sandbox/module/CMakeLists.txt +5 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/CMakeLists.txt +14 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_engine.h +145 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_impl.cc +181 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_impl.h +71 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/aio_main.cc +221 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/block_opener.h +113 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/block_type.h +51 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/error_handle.h +39 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer.cc +56 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer.h +57 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer_ascend.cc +74 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/host_buffer_cuda.cc +73 -0
- ucm_toolkit/_resources/dev-sandbox/module/aio/space_layout.h +81 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/CMakeLists.txt +39 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_buffer_ascend.h +274 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_case_ascend.cc +201 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_instance_ascend.h +340 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/copy_runtime_ascend.cc +29 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/error_handle_ascend.h +44 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/ffts_direct_h2d/copy_case_ffts_direct_h2d_ascend.cc +189 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/ffts_direct_h2d/copy_instance_ffts_direct_h2d_ascend.h +174 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/ffts_direct_h2d/mapped_host_buffer_ffts_direct_h2d_ascend.h +298 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/forked_copy_runner_ascend.h +286 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/ascend/h2d_ffts_pipeline/ffts_d2d_dispatcher_ascend.h +212 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_buffer.h +53 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_case.h +103 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_instance.h +93 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_main.cc +125 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_result.h +106 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/copy_runtime.h +33 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_buffer_cuda.h +91 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_case_cuda.cc +227 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_instance_cuda.h +324 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_kernel_cuda.cu +70 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/copy_runtime_cuda.cc +28 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/error_handle_cuda.h +43 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/copy_buffer_gdr.h +145 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/copy_case_gdr.cc +133 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/copy_instance_gdr.h +129 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/error_handle_gdr.h +61 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/rdma_channel_gdr.cc +323 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/rdma_channel_gdr.h +95 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/cuda/gdr/submit_executor_gdr.h +148 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/error_handle.h +37 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_buffer_simu.h +98 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_case_simu.cc +60 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_instance_simu.h +93 -0
- ucm_toolkit/_resources/dev-sandbox/module/copy/simu/copy_runtime_simu.cc +28 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/CMakeLists.txt +5 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/logger.cc +215 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/logger.h +72 -0
- ucm_toolkit/_resources/dev-sandbox/module/logger/logger_example.cc +53 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/CMakeLists.txt +22 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_assert_ascend.h +52 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_case_ascend.cc +213 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_device_buffer_ascend.h +49 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_host_buffer_ascend.h +98 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_runtime_ascend.cc +29 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/ascend/trans_template_ascend.h +300 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_assert_cuda.h +51 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_case_cuda.cc +209 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_device_buffer_cuda.h +49 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_host_buffer_cuda.h +98 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_kernel_cuda.cu +71 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_kernel_cuda.h +32 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_runtime_cuda.cc +27 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/cuda/trans_template_cuda.h +265 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_assert_simu.h +37 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_buffer_simu.h +91 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_case_simu.cc +78 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_runtime_simu.cc +27 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/simu/trans_template_simu.h +76 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_buffer.h +52 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_case.h +139 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_main.cc +150 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_result.h +101 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_runtime.h +33 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_stopwatch.h +43 -0
- ucm_toolkit/_resources/dev-sandbox/module/trans/trans_template.h +79 -0
- ucm_toolkit/_resources/dev-sandbox/readme.md +120 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/CMakeLists.txt +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.clang-format +15 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/dependabot.yml +8 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/issue_template.md +6 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/pull_request_template.md +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/cifuzz.yml +32 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/doc.yml +42 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/lint.yml +28 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/linux.yml +176 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/macos.yml +58 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/scorecard.yml +65 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.github/workflows/windows.yml +95 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/.gitignore +21 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/CMakeLists.txt +535 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/CONTRIBUTING.md +20 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/ChangeLog.md +3050 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/LICENSE +27 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/README.md +485 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/ChangeLog-old.md +3290 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/api.md +679 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/fmt.css +61 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/fmt.js +4 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/get-started.md +222 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/index.md +151 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/perf.svg +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/python-license.txt +290 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/doc/syntax.md +886 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/args.h +220 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/base.h +2989 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/chrono.h +2330 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/color.h +637 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/compile.h +539 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/core.h +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/format-inl.h +1948 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/format.h +4244 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/os.h +427 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/ostream.h +167 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/printf.h +633 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/ranges.h +850 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/std.h +728 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/include/fmt/xchar.h +369 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/src/fmt.cc +153 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/src/format.cc +46 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/src/os.cc +398 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/Android.mk +15 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/AndroidManifest.xml +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/C++.sublime-syntax +2061 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/README +4 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/Vagrantfile +19 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/.bazelversion +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/BUILD.bazel +22 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/MODULE.bazel +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/README.md +28 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/bazel/WORKSPACE.bazel +2 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/build.gradle +132 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/check-commits +71 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/FindSetEnv.cmake +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/JoinPaths.cmake +26 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/fmt-config.cmake.in +7 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/cmake/fmt.pc.in +11 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/docopt.py +586 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/mkdocs +82 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/mkdocs.yml +48 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/printable.py +224 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/python/mkdocstrings_handlers/cxx/__init__.py +357 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/python/mkdocstrings_handlers/cxx/templates/README +1 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/support/release.py +209 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/CMakeLists.txt +257 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/add-subdirectory-test/CMakeLists.txt +17 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/add-subdirectory-test/main.cc +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/args-test.cc +202 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/assert-test.cc +31 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/base-test.cc +902 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/chrono-test.cc +1023 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/color-test.cc +129 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/compile-error-test/CMakeLists.txt +215 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/compile-fp-test.cc +61 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/compile-test.cc +423 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/cuda-test/CMakeLists.txt +73 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/cuda-test/cpp14.cc +11 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/cuda-test/cuda-cpp14.cu +28 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/detect-stdfs.cc +18 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/enforce-checks-test.cc +65 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/find-package-test/CMakeLists.txt +17 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/find-package-test/main.cc +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/format-impl-test.cc +477 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/format-test.cc +2567 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/.gitignore +3 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/CMakeLists.txt +30 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/README.md +25 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/build.sh +90 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/chrono-duration.cc +136 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/chrono-timepoint.cc +32 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/float.cc +39 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/fuzzer-common.h +77 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/main.cc +22 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/named-arg.cc +102 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/one-arg.cc +92 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/fuzzing/two-args.cc +106 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/.clang-format +3 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/CMakeLists.txt +32 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gmock/gmock.h +11659 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gmock-gtest-all.cc +14442 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gtest/gtest-spi.h +238 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest/gtest/gtest.h +12399 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest-extra-test.cc +410 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest-extra.cc +80 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/gtest-extra.h +165 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/header-only-test.cc +11 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/mock-allocator.h +77 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/module-test.cc +520 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/no-builtin-types-test.cc +25 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/noexception-test.cc +18 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/os-test.cc +592 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/ostream-test.cc +308 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/perf-sanity.cc +25 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/posix-mock-test.cc +442 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/posix-mock.h +75 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/printf-test.cc +568 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/ranges-odr-test.cc +18 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/ranges-test.cc +799 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/scan-test.cc +184 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/scan.h +669 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/static-export-test/CMakeLists.txt +30 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/static-export-test/library.cc +5 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/static-export-test/main.cc +6 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/std-test.cc +417 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/test-assert.h +39 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/test-main.cc +43 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/unicode-test.cc +48 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/util.cc +48 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/util.h +83 -0
- ucm_toolkit/_resources/dev-sandbox/vendor/fmt/test/xchar-test.cc +421 -0
- ucm_toolkit/_resources/nic_monitor_pro.sh +310 -0
- ucm_toolkit/_resources/posixstore_aio_test.py +198 -0
- ucm_toolkit/_version.py +1 -0
- ucm_toolkit/cli.py +48 -0
- ucm_toolkit/commands/__init__.py +1 -0
- ucm_toolkit/commands/build.py +37 -0
- ucm_toolkit/commands/clean.py +24 -0
- ucm_toolkit/commands/doctor.py +26 -0
- ucm_toolkit/commands/list.py +29 -0
- ucm_toolkit/commands/run.py +24 -0
- ucm_toolkit/errors.py +73 -0
- ucm_toolkit/registry.py +92 -0
- ucm_toolkit/resources.py +31 -0
- ucm_toolkit/runner.py +46 -0
- ucm_toolkit/tools/__init__.py +1 -0
- ucm_toolkit/tools/dev_sandbox/__init__.py +5 -0
- ucm_toolkit/tools/dev_sandbox/adapter.py +285 -0
- ucm_toolkit/tools/metrics_view/__init__.py +5 -0
- ucm_toolkit/tools/metrics_view/adapter.py +47 -0
- ucm_toolkit/tools/metrics_view/configs/connector.json +1003 -0
- ucm_toolkit/tools/metrics_view/configs/metrics_lite.json +183 -0
- ucm_toolkit/tools/metrics_view/configs/store.json +1779 -0
- ucm_toolkit/tools/metrics_view/configs/vllm.json +417 -0
- ucm_toolkit/tools/metrics_view/metrics_cli.py +11 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/__init__.py +1 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/cli.py +338 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/collector.py +100 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/config.py +178 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/parser.py +80 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/promql.py +635 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/query.py +371 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/render.py +116 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/snapshot.py +193 -0
- ucm_toolkit/tools/metrics_view/terminal_view_metrics/storage.py +154 -0
- ucm_toolkit/tools/nic_monitor/__init__.py +5 -0
- ucm_toolkit/tools/nic_monitor/adapter.py +77 -0
- ucm_toolkit/tools/posix_aio/__init__.py +5 -0
- ucm_toolkit/tools/posix_aio/adapter.py +399 -0
- ucm_toolkit/tools/posix_aio/model_profile.py +316 -0
- ucm_toolkit/tools/precheck/__init__.py +7 -0
- ucm_toolkit/tools/precheck/adapter.py +42 -0
- ucm_toolkit/tools/precheck/bandwidth.py +976 -0
- ucm_toolkit/tools/precheck/checks.py +534 -0
- ucm_toolkit/tools/precheck/cli.py +303 -0
- ucm_toolkit/tools/precheck/config.py +218 -0
- ucm_toolkit/tools/precheck/parseutil.py +233 -0
- ucm_toolkit/tools/precheck/precheck.defaults.json +23 -0
- ucm_toolkit/tools/precheck/reporter.py +156 -0
- ucm_toolkit-0.8.0.dist-info/METADATA +26 -0
- ucm_toolkit-0.8.0.dist-info/RECORD +277 -0
- ucm_toolkit-0.8.0.dist-info/WHEEL +5 -0
- ucm_toolkit-0.8.0.dist-info/entry_points.txt +2 -0
- ucm_toolkit-0.8.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Mag1c.H
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
* */
|
|
24
|
+
#include "aio_impl.h"
|
|
25
|
+
#include <cstring>
|
|
26
|
+
#include <fmt/format.h>
|
|
27
|
+
#include <sys/epoll.h>
|
|
28
|
+
#include <sys/eventfd.h>
|
|
29
|
+
#include <sys/syscall.h>
|
|
30
|
+
#include <unistd.h>
|
|
31
|
+
#include "error_handle.h"
|
|
32
|
+
|
|
33
|
+
namespace aio {
|
|
34
|
+
|
|
35
|
+
static inline int32_t AioSetup(int32_t nEvents, aio_context_t* pCtx)
|
|
36
|
+
{
|
|
37
|
+
return syscall(SYS_io_setup, nEvents, pCtx);
|
|
38
|
+
}
|
|
39
|
+
static inline int32_t AioGetEvents(aio_context_t ctx, int64_t minNr, int64_t maxNr,
|
|
40
|
+
io_event* events, timespec* timeout)
|
|
41
|
+
{
|
|
42
|
+
return syscall(SYS_io_getevents, ctx, minNr, maxNr, events, timeout);
|
|
43
|
+
}
|
|
44
|
+
static inline int32_t AioSubmit(aio_context_t ctx, int64_t nr, iocb** ios)
|
|
45
|
+
{
|
|
46
|
+
return syscall(SYS_io_submit, ctx, nr, ios);
|
|
47
|
+
}
|
|
48
|
+
static inline int32_t AioDestroy(aio_context_t ctx) { return syscall(SYS_io_destroy, ctx); }
|
|
49
|
+
static inline void AioPrepareRead(struct iocb* iocb, int32_t fd, void* buf, size_t count,
|
|
50
|
+
size_t offset)
|
|
51
|
+
{
|
|
52
|
+
std::memset(iocb, 0, sizeof(*iocb));
|
|
53
|
+
iocb->aio_fildes = fd;
|
|
54
|
+
iocb->aio_lio_opcode = 0; /* IO_CMD_PREAD */
|
|
55
|
+
iocb->aio_reqprio = 0;
|
|
56
|
+
iocb->aio_buf = reinterpret_cast<uintptr_t>(buf);
|
|
57
|
+
iocb->aio_nbytes = count;
|
|
58
|
+
iocb->aio_offset = offset;
|
|
59
|
+
}
|
|
60
|
+
static inline void AioPrepareWrite(struct iocb* iocb, int32_t fd, void* buf, size_t count,
|
|
61
|
+
size_t offset)
|
|
62
|
+
{
|
|
63
|
+
std::memset(iocb, 0, sizeof(*iocb));
|
|
64
|
+
iocb->aio_fildes = fd;
|
|
65
|
+
iocb->aio_lio_opcode = 1; /* IO_CMD_PWRITE */
|
|
66
|
+
iocb->aio_reqprio = 0;
|
|
67
|
+
iocb->aio_buf = reinterpret_cast<uintptr_t>(buf);
|
|
68
|
+
iocb->aio_nbytes = count;
|
|
69
|
+
iocb->aio_offset = offset;
|
|
70
|
+
}
|
|
71
|
+
static inline void AioSetEventFd(struct iocb* iocb, int32_t eventfd)
|
|
72
|
+
{
|
|
73
|
+
iocb->aio_flags |= (1 << 0) /* IOCB_FLAG_RESFD */;
|
|
74
|
+
iocb->aio_resfd = eventfd;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
AioImpl::AioImpl()
|
|
78
|
+
{
|
|
79
|
+
AIO_ASSERT(AioSetup(queueDepth_, &ctx_) == 0);
|
|
80
|
+
eventFd_ = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
|
|
81
|
+
AIO_ASSERT(eventFd_ >= 0);
|
|
82
|
+
epollFd_ = epoll_create1(EPOLL_CLOEXEC);
|
|
83
|
+
AIO_ASSERT(epollFd_ >= 0);
|
|
84
|
+
epoll_event ev{};
|
|
85
|
+
ev.events = EPOLLIN;
|
|
86
|
+
ev.data.ptr = nullptr;
|
|
87
|
+
AIO_ASSERT(epoll_ctl(epollFd_, EPOLL_CTL_ADD, eventFd_, &ev) == 0);
|
|
88
|
+
eventThread_ = std::thread([this] { CompletionLoop(); });
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
AioImpl::~AioImpl()
|
|
92
|
+
{
|
|
93
|
+
stop_ = true;
|
|
94
|
+
if (eventThread_.joinable()) {
|
|
95
|
+
uint64_t val = 1;
|
|
96
|
+
auto ret = write(eventFd_, &val, sizeof(val));
|
|
97
|
+
if (ret < 0) { fmt::println("Failed to call write."); }
|
|
98
|
+
eventThread_.join();
|
|
99
|
+
}
|
|
100
|
+
if (epollFd_ >= 0) { close(epollFd_); }
|
|
101
|
+
if (eventFd_ >= 0) { close(eventFd_); }
|
|
102
|
+
if (ctx_) { AioDestroy(ctx_); }
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
void AioImpl::ReadAsync(Io&& io)
|
|
106
|
+
{
|
|
107
|
+
struct iocb cb;
|
|
108
|
+
auto data = std::make_unique<Callback>(std::move(io.callback));
|
|
109
|
+
AioPrepareRead(&cb, io.fd, io.buffer, io.length, io.offset);
|
|
110
|
+
cb.aio_data = (uintptr_t)(void*)data.get();
|
|
111
|
+
SubmitIo(&cb);
|
|
112
|
+
data.release();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
void AioImpl::WriteAsync(Io&& io)
|
|
116
|
+
{
|
|
117
|
+
struct iocb cb;
|
|
118
|
+
auto data = std::make_unique<Callback>(std::move(io.callback));
|
|
119
|
+
AioPrepareWrite(&cb, io.fd, io.buffer, io.length, io.offset);
|
|
120
|
+
cb.aio_data = (uintptr_t)(void*)data.get();
|
|
121
|
+
SubmitIo(&cb);
|
|
122
|
+
data.release();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
void AioImpl::CompletionLoop()
|
|
126
|
+
{
|
|
127
|
+
std::vector<epoll_event> epollEvents(128);
|
|
128
|
+
std::vector<io_event> aioEvents(batchCompleteSize);
|
|
129
|
+
while (!stop_) {
|
|
130
|
+
auto nfds = epoll_wait(epollFd_, epollEvents.data(), epollEvents.size(), epollTimeoutMs);
|
|
131
|
+
for (auto i = 0; i < nfds; i++) {
|
|
132
|
+
if (epollEvents[i].data.ptr == nullptr) {
|
|
133
|
+
uint64_t count;
|
|
134
|
+
auto ret = read(eventFd_, &count, sizeof(count));
|
|
135
|
+
if (ret < 0) { fmt::println("Failed to call read."); }
|
|
136
|
+
HarvestCompletions(aioEvents);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
void AioImpl::HarvestCompletions(std::vector<io_event>& events)
|
|
143
|
+
{
|
|
144
|
+
auto batchSize = static_cast<int>(events.size());
|
|
145
|
+
while (!stop_) {
|
|
146
|
+
auto num = AioGetEvents(ctx_, 1, batchSize, events.data(), nullptr);
|
|
147
|
+
for (auto i = 0; i < num; i++) {
|
|
148
|
+
auto cb = (Callback*)(void*)events[i].data;
|
|
149
|
+
if (!cb) { continue; }
|
|
150
|
+
Result res;
|
|
151
|
+
if (events[i].res >= 0) {
|
|
152
|
+
res.nBytes = events[i].res;
|
|
153
|
+
res.error = 0;
|
|
154
|
+
} else {
|
|
155
|
+
res.nBytes = -1;
|
|
156
|
+
res.error = -static_cast<int>(events[i].res);
|
|
157
|
+
}
|
|
158
|
+
(*cb)(res);
|
|
159
|
+
delete cb;
|
|
160
|
+
}
|
|
161
|
+
if (num < batchSize) { break; }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
void AioImpl::SubmitIo(iocb* cb)
|
|
166
|
+
{
|
|
167
|
+
AioSetEventFd(cb, eventFd_);
|
|
168
|
+
auto ret = 0;
|
|
169
|
+
for (;;) {
|
|
170
|
+
ret = AioSubmit(ctx_, 1, &cb);
|
|
171
|
+
auto eno = errno;
|
|
172
|
+
if (ret == 1) { return; }
|
|
173
|
+
if (eno == EAGAIN) {
|
|
174
|
+
std::this_thread::yield();
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
AIO_ASSERT(eno == 0);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
} // namespace aio
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Mag1c.H
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
* */
|
|
24
|
+
#ifndef AIO_AIO_IMPL_H
|
|
25
|
+
#define AIO_AIO_IMPL_H
|
|
26
|
+
|
|
27
|
+
#include <atomic>
|
|
28
|
+
#include <functional>
|
|
29
|
+
#include <linux/aio_abi.h>
|
|
30
|
+
#include <thread>
|
|
31
|
+
|
|
32
|
+
namespace aio {
|
|
33
|
+
|
|
34
|
+
class AioImpl {
|
|
35
|
+
public:
|
|
36
|
+
struct Result {
|
|
37
|
+
ssize_t nBytes;
|
|
38
|
+
int32_t error;
|
|
39
|
+
};
|
|
40
|
+
using Callback = std::function<void(Result)>;
|
|
41
|
+
struct Io {
|
|
42
|
+
int32_t fd;
|
|
43
|
+
uint64_t offset;
|
|
44
|
+
uint32_t length;
|
|
45
|
+
void* buffer;
|
|
46
|
+
Callback callback;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
AioImpl();
|
|
50
|
+
~AioImpl();
|
|
51
|
+
void ReadAsync(Io&& io);
|
|
52
|
+
void WriteAsync(Io&& io);
|
|
53
|
+
|
|
54
|
+
private:
|
|
55
|
+
void CompletionLoop();
|
|
56
|
+
void HarvestCompletions(std::vector<io_event>& events);
|
|
57
|
+
void SubmitIo(struct iocb* cb);
|
|
58
|
+
|
|
59
|
+
size_t queueDepth_{4096};
|
|
60
|
+
size_t epollTimeoutMs{10};
|
|
61
|
+
size_t batchCompleteSize{512};
|
|
62
|
+
aio_context_t ctx_{0};
|
|
63
|
+
int32_t eventFd_{-1};
|
|
64
|
+
int32_t epollFd_{-1};
|
|
65
|
+
std::atomic_bool stop_{false};
|
|
66
|
+
std::thread eventThread_;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace aio
|
|
70
|
+
|
|
71
|
+
#endif
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Mag1c.H
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
* */
|
|
24
|
+
#include <chrono>
|
|
25
|
+
#include <random>
|
|
26
|
+
#include "aio_engine.h"
|
|
27
|
+
#include "host_buffer.h"
|
|
28
|
+
|
|
29
|
+
struct Config {
|
|
30
|
+
std::string workspace;
|
|
31
|
+
aio::HostBuffer::Strategy ioType = aio::HostBuffer::Strategy::MMAP;
|
|
32
|
+
size_t ioSize = 1024 * 1024;
|
|
33
|
+
size_t ioNumber = 512;
|
|
34
|
+
size_t deviceId = 0;
|
|
35
|
+
size_t epochNumber = 32;
|
|
36
|
+
|
|
37
|
+
bool Parse(int argc, char const* argv[])
|
|
38
|
+
{
|
|
39
|
+
auto PrintUsage = +[](const char* prog) {
|
|
40
|
+
fmt::println(
|
|
41
|
+
"Usage: {} --workspace <path> [--io-type mmap|alloc] [--io-size <bytes>] "
|
|
42
|
+
"[--io-number <n>] [--device-id <id>] [--epoch-number <n>]",
|
|
43
|
+
prog ? prog : "aio_main");
|
|
44
|
+
};
|
|
45
|
+
for (int i = 1; i < argc; ++i) {
|
|
46
|
+
std::string opt = argv[i];
|
|
47
|
+
if (opt == "-h" || opt == "--help") {
|
|
48
|
+
PrintUsage(argv[0]);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (opt == "--workspace") {
|
|
53
|
+
if (i + 1 >= argc) {
|
|
54
|
+
fmt::println("Missing value for --workspace");
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
workspace = argv[++i];
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (opt == "--io-type") {
|
|
62
|
+
if (i + 1 >= argc) {
|
|
63
|
+
fmt::println("Missing value for --io-type");
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
std::string v = argv[++i];
|
|
67
|
+
for (auto& c : v) {
|
|
68
|
+
c = static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
|
|
69
|
+
}
|
|
70
|
+
if (v == "mmap") {
|
|
71
|
+
ioType = aio::HostBuffer::Strategy::MMAP;
|
|
72
|
+
} else if (v == "alloc") {
|
|
73
|
+
ioType = aio::HostBuffer::Strategy::ALLOC;
|
|
74
|
+
} else {
|
|
75
|
+
fmt::println("Unknown io-type: {}. Supported: mmap, alloc", v);
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (opt == "--io-size") {
|
|
82
|
+
if (i + 1 >= argc) {
|
|
83
|
+
fmt::println("Missing value for --io-size");
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
ioSize = std::stoull(argv[++i]);
|
|
88
|
+
} catch (const std::exception& e) {
|
|
89
|
+
fmt::println("Invalid number for --io-size: {}", e.what());
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (opt == "--io-number") {
|
|
96
|
+
if (i + 1 >= argc) {
|
|
97
|
+
fmt::println("Missing value for --io-number");
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
ioNumber = std::stoull(argv[++i]);
|
|
102
|
+
} catch (const std::exception& e) {
|
|
103
|
+
fmt::println("Invalid number for --io-number: {}", e.what());
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (opt == "--device-id") {
|
|
110
|
+
if (i + 1 >= argc) {
|
|
111
|
+
fmt::println("Missing value for --device-id");
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
deviceId = std::stoull(argv[++i]);
|
|
116
|
+
} catch (const std::exception& e) {
|
|
117
|
+
fmt::println("Invalid number for --device-id: {}", e.what());
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (opt == "--epoch-number") {
|
|
124
|
+
if (i + 1 >= argc) {
|
|
125
|
+
fmt::println("Missing value for --epoch-number");
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
try {
|
|
129
|
+
epochNumber = std::stoull(argv[++i]);
|
|
130
|
+
} catch (const std::exception& e) {
|
|
131
|
+
fmt::println("Invalid number for --epoch-number: {}", e.what());
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
fmt::println("Unknown option: {}", opt);
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (workspace.empty()) {
|
|
142
|
+
fmt::println("Error: --workspace is required");
|
|
143
|
+
PrintUsage(argv[0]);
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
void Show() const
|
|
150
|
+
{
|
|
151
|
+
fmt::println("Set Config::Workspace = {}.", workspace);
|
|
152
|
+
fmt::println("Set Config::IoType = {}.",
|
|
153
|
+
ioType == aio::HostBuffer::Strategy::ALLOC ? "alloc" : "mmap");
|
|
154
|
+
fmt::println("Set Config::IoSize = {}.", ioSize);
|
|
155
|
+
fmt::println("Set Config::IoNumber = {}.", ioNumber);
|
|
156
|
+
fmt::println("Set Config::DeviceId = {}.", deviceId);
|
|
157
|
+
fmt::println("Set Config::EpochNumber = {}.", epochNumber);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
std::vector<aio::BlockId> MakeBlockIdsRandomly(size_t number)
|
|
162
|
+
{
|
|
163
|
+
auto makeBlockIdRandomly = +[] {
|
|
164
|
+
static std::random_device rd;
|
|
165
|
+
static std::mt19937 gen(rd());
|
|
166
|
+
static std::uniform_int_distribution<std::uint8_t> dist(0, 255);
|
|
167
|
+
aio::BlockId id;
|
|
168
|
+
for (std::size_t i = 0; i < id.size(); ++i) { id[i] = static_cast<std::byte>(dist(gen)); }
|
|
169
|
+
return id;
|
|
170
|
+
};
|
|
171
|
+
std::vector<aio::BlockId> blockIds;
|
|
172
|
+
blockIds.reserve(number);
|
|
173
|
+
for (size_t i = 0; i < number; i++) { blockIds.push_back(makeBlockIdRandomly()); }
|
|
174
|
+
return blockIds;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
template <bool write>
|
|
178
|
+
void Run(aio::AioEngine& ioEngine, aio::AioEngine::IoTask& task, size_t epochNumber)
|
|
179
|
+
{
|
|
180
|
+
using namespace std::chrono;
|
|
181
|
+
const char* taskType = write ? "Write" : "Read";
|
|
182
|
+
const auto size = task.front().length;
|
|
183
|
+
const auto number = task.size();
|
|
184
|
+
const auto total = size * number;
|
|
185
|
+
for (size_t i = 0; i < epochNumber; i++) {
|
|
186
|
+
auto tp = steady_clock::now();
|
|
187
|
+
if constexpr (write) {
|
|
188
|
+
ioEngine.SubmitWrite(task)->Wait();
|
|
189
|
+
} else {
|
|
190
|
+
ioEngine.SubmitRead(task)->Wait();
|
|
191
|
+
}
|
|
192
|
+
auto cost = duration<double>(steady_clock::now() - tp).count() * 1e3;
|
|
193
|
+
auto bandwidth = total / cost / 1e6;
|
|
194
|
+
fmt::println("[{:04}/{:04}] {} task({} x {}) finish, cost={:.3f}ms, bw={:.3f}GB/s.", i + 1,
|
|
195
|
+
epochNumber, taskType, size, number, cost, bandwidth);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
int main(int argc, char const* argv[])
|
|
200
|
+
{
|
|
201
|
+
Config config;
|
|
202
|
+
if (config.Parse(argc, argv)) {
|
|
203
|
+
config.Show();
|
|
204
|
+
|
|
205
|
+
aio::SpaceLayout layout{config.workspace};
|
|
206
|
+
aio::AioEngine ioEngine{&layout, 32};
|
|
207
|
+
aio::HostBuffer buffers{config.ioType, (int32_t)config.deviceId, config.ioSize,
|
|
208
|
+
config.ioNumber};
|
|
209
|
+
auto blockIds = MakeBlockIdsRandomly(config.ioNumber);
|
|
210
|
+
aio::AioEngine::IoTask task;
|
|
211
|
+
task.reserve(config.ioNumber);
|
|
212
|
+
for (size_t i = 0; i < config.ioNumber; i++) {
|
|
213
|
+
task.push_back(aio::AioEngine::IoShard{blockIds[i], buffers[i], config.ioSize});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
Run<true>(ioEngine, task, config.epochNumber);
|
|
217
|
+
Run<false>(ioEngine, task, config.epochNumber);
|
|
218
|
+
return 0;
|
|
219
|
+
}
|
|
220
|
+
return -1;
|
|
221
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Mag1c.H
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
* */
|
|
24
|
+
#ifndef AIO_BLOCK_OPENER_H
|
|
25
|
+
#define AIO_BLOCK_OPENER_H
|
|
26
|
+
|
|
27
|
+
#include <atomic>
|
|
28
|
+
#include <condition_variable>
|
|
29
|
+
#include <fcntl.h>
|
|
30
|
+
#include <functional>
|
|
31
|
+
#include <list>
|
|
32
|
+
#include <mutex>
|
|
33
|
+
#include <thread>
|
|
34
|
+
#include "space_layout.h"
|
|
35
|
+
|
|
36
|
+
namespace aio {
|
|
37
|
+
|
|
38
|
+
class BlockOpener {
|
|
39
|
+
public:
|
|
40
|
+
struct OpenResult {
|
|
41
|
+
int32_t fd;
|
|
42
|
+
int32_t error;
|
|
43
|
+
};
|
|
44
|
+
using OpenCallback = std::function<void(OpenResult)>;
|
|
45
|
+
struct OpenTask {
|
|
46
|
+
BlockId id;
|
|
47
|
+
int32_t flags;
|
|
48
|
+
OpenCallback callback;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
BlockOpener(const SpaceLayout* layout, const size_t nOpenWorker)
|
|
52
|
+
{
|
|
53
|
+
layout_ = layout;
|
|
54
|
+
for (size_t i = 0; i < nOpenWorker; ++i) {
|
|
55
|
+
workers_.push_back(std::thread{[this] { OpenWorkerLoop(); }});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
~BlockOpener()
|
|
59
|
+
{
|
|
60
|
+
stop_ = true;
|
|
61
|
+
{
|
|
62
|
+
std::lock_guard<std::mutex> lock{openQueue_.mutex};
|
|
63
|
+
openQueue_.cv.notify_all();
|
|
64
|
+
}
|
|
65
|
+
for (auto& worker : workers_) {
|
|
66
|
+
if (worker.joinable()) { worker.join(); }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
void Submit(std::list<OpenTask>&& tasks)
|
|
70
|
+
{
|
|
71
|
+
auto& q = openQueue_;
|
|
72
|
+
std::lock_guard<std::mutex> lock{q.mutex};
|
|
73
|
+
q.queue.splice(q.queue.end(), tasks);
|
|
74
|
+
q.cv.notify_all();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private:
|
|
78
|
+
void OpenWorkerLoop()
|
|
79
|
+
{
|
|
80
|
+
constexpr const auto mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
|
|
81
|
+
for (;;) {
|
|
82
|
+
OpenTask task;
|
|
83
|
+
{
|
|
84
|
+
std::unique_lock<std::mutex> lock{openQueue_.mutex};
|
|
85
|
+
openQueue_.cv.wait(lock, [this] { return stop_ || !openQueue_.queue.empty(); });
|
|
86
|
+
if (stop_) { break; }
|
|
87
|
+
if (openQueue_.queue.empty()) { continue; }
|
|
88
|
+
task = std::move(openQueue_.queue.front());
|
|
89
|
+
openQueue_.queue.pop_front();
|
|
90
|
+
}
|
|
91
|
+
const auto path = layout_->BlockPath(task.id);
|
|
92
|
+
auto fd = ::open(path.c_str(), task.flags, mode);
|
|
93
|
+
auto err = (fd < 0) ? errno : 0;
|
|
94
|
+
if (task.callback) { task.callback(OpenResult{fd, err}); }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
template <class T>
|
|
99
|
+
struct TaskQueue {
|
|
100
|
+
std::list<T> queue;
|
|
101
|
+
std::mutex mutex;
|
|
102
|
+
std::condition_variable cv;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
std::atomic_bool stop_{false};
|
|
106
|
+
const SpaceLayout* layout_;
|
|
107
|
+
std::list<std::thread> workers_;
|
|
108
|
+
TaskQueue<OpenTask> openQueue_;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
} // namespace aio
|
|
112
|
+
|
|
113
|
+
#endif
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Mag1c.H
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
* */
|
|
24
|
+
#ifndef AIO_BLOCK_TYPE_H
|
|
25
|
+
#define AIO_BLOCK_TYPE_H
|
|
26
|
+
|
|
27
|
+
#include <array>
|
|
28
|
+
#include <fmt/ranges.h>
|
|
29
|
+
|
|
30
|
+
namespace aio {
|
|
31
|
+
|
|
32
|
+
using BlockId = std::array<std::byte, 16>;
|
|
33
|
+
struct BlockIdHasher {
|
|
34
|
+
size_t operator()(const BlockId& blockId) const noexcept
|
|
35
|
+
{
|
|
36
|
+
std::string_view sv(reinterpret_cast<const char*>(blockId.data()), blockId.size());
|
|
37
|
+
return std::hash<std::string_view>{}(sv);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace aio
|
|
42
|
+
|
|
43
|
+
template <>
|
|
44
|
+
struct fmt::formatter<aio::BlockId> : fmt::formatter<std::string> {
|
|
45
|
+
auto format(aio::BlockId blockId, format_context& ctx) const -> decltype(ctx.out())
|
|
46
|
+
{
|
|
47
|
+
return fmt::format_to(ctx.out(), "{:02x}", fmt::join(blockId, ""));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
#endif
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Mag1c.H
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
* */
|
|
24
|
+
#ifndef AIO_ERROR_HANDLE_H
|
|
25
|
+
#define AIO_ERROR_HANDLE_H
|
|
26
|
+
|
|
27
|
+
#include <cerrno>
|
|
28
|
+
#include <cstdio>
|
|
29
|
+
|
|
30
|
+
#define AIO_ASSERT(expr) \
|
|
31
|
+
do { \
|
|
32
|
+
if (!(expr)) { \
|
|
33
|
+
fprintf(stderr, "Assertion failed(%d): %s, at %s:%d\n", errno, #expr, __FILE__, \
|
|
34
|
+
__LINE__); \
|
|
35
|
+
exit(EXIT_FAILURE); \
|
|
36
|
+
} \
|
|
37
|
+
} while (0)
|
|
38
|
+
|
|
39
|
+
#endif // AIO_ERROR_HANDLE_H
|