pax_global_header 0000666 0000000 0000000 00000000064 14172016224 0014511 g ustar 00root root 0000000 0000000 52 comment=334d29808f697956bd9f4eb00889c810442487e2
gekkofs-uc3m_test/ 0000775 0000000 0000000 00000000000 14172016224 0014412 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/.clang-format 0000664 0000000 0000000 00000004033 14172016224 0016765 0 ustar 00root root 0000000 0000000 BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveMacros: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: All
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: false
ColumnLimit: 80
CompactNamespaces: false
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
FixNamespaceComments: true
# IncludeBlocks? TODO
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 4
UseTab: Never
gekkofs-uc3m_test/.dockerignore 0000664 0000000 0000000 00000000057 14172016224 0017070 0 ustar 00root root 0000000 0000000 .git
.gitignore
build
/archive_old_fs_versions
gekkofs-uc3m_test/.gitignore 0000664 0000000 0000000 00000001347 14172016224 0016407 0 ustar 00root root 0000000 0000000 # ---> C++
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
#*.out
*.app
# ---> C
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
#*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
# .idea
*.idea/
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# fuse files
cmake-build-*
playground
.fuse_hidden*
# python stuff
*.pyc
.hidden_playground/
test/build/
build/
.run/
gekkofs-uc3m_test/.gitlab-ci.yml 0000664 0000000 0000000 00000016725 14172016224 0017061 0 ustar 00root root 0000000 0000000 stages:
- lint
- build
- test
- report
variables:
SCRIPTS_DIR: "${CI_PROJECT_DIR}/scripts"
CI_SCRIPTS_DIR: "${CI_PROJECT_DIR}/scripts/ci"
BUILD_PATH: "${CI_PROJECT_DIR}/gkfs/build"
INSTALL_PATH: "${CI_PROJECT_DIR}/gkfs/install"
INTEGRATION_TESTS_BIN_PATH: "${CI_PROJECT_DIR}/gkfs/install/share/gkfs/tests/integration"
COVERAGE_PATH: "${CI_PROJECT_DIR}/gkfs/build/.coverage"
PYTEST: "${CI_PROJECT_DIR}/gkfs/install/share/gkfs/tests/integration/pytest-venv/bin/py.test"
BATS: "${CI_PROJECT_DIR}/tests/scripts/bats/bin/bats"
LD_LIBRARY_PATH: "${CI_PROJECT_DIR}/deps/install/lib:${CI_PROJECT_DIR}/deps/install/lib64"
# Configuration variables
GKFS_LOG_LEVEL: "100"
GKFS_DAEMON_LOG_PATH: "${CI_PROJECT_DIR}/logs/daemon.log"
LIBGKFS_LOG: "all"
LIBGKFS_LOG_OUTPUT: "${CI_PROJECT_DIR}/logs/gkfs_client.log"
GIT_SUBMODULE_STRATEGY: recursive
# base image
image: gekkofs/core:0.9.0
################################################################################
## Validating
################################################################################
check format:
stage: lint
image: gekkofs/linter:0.9.0
needs: []
script:
- ${SCRIPTS_DIR}/check_format.sh
-s "${CI_PROJECT_DIR}/src"
-i "${CI_PROJECT_DIR}/include"
-v
################################################################################
## Building
################################################################################
gkfs:
stage: build
image: gekkofs/deps:0.9.0
interruptible: true
needs: []
script:
- mkdir -p ${BUILD_PATH} && cd ${BUILD_PATH}
- cmake
-Wdev
-Wdeprecate
-DCMAKE_BUILD_TYPE=Debug
-DGKFS_ENABLE_CODE_COVERAGE:BOOL=ON
-DGKFS_BUILD_TESTS:BOOL=ON
-DGKFS_INSTALL_TESTS:BOOL=ON
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}
${CI_PROJECT_DIR}
- make -j$(nproc) install
# reduce artifacts size
- ${CI_SCRIPTS_DIR}/trim_build_artifacts.sh ${BUILD_PATH}
artifacts:
paths:
- ${BUILD_PATH}
- ${INSTALL_PATH}
expire_in: 1 week
gkfwd:
stage: build
image: gekkofs/deps:0.9.0
interruptible: true
needs: []
script:
- mkdir -p ${BUILD_PATH} && cd ${BUILD_PATH}
- cmake
-Wdev
-Wdeprecate
-DCMAKE_BUILD_TYPE=Debug
-DGKFS_ENABLE_CODE_COVERAGE:BOOL=ON
-DGKFS_BUILD_TESTS:BOOL=ON
-DGKFS_INSTALL_TESTS:BOOL=ON
-DGKFS_ENABLE_FORWARDING:BOOL=ON
-DGKFS_ENABLE_AGIOS:BOOL=ON
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}
${CI_PROJECT_DIR}
- make -j$(nproc) install
# reduce artifacts size
- ${CI_SCRIPTS_DIR}/trim_build_artifacts.sh ${BUILD_PATH}
artifacts:
paths:
- ${BUILD_PATH}
- ${INSTALL_PATH}
expire_in: 1 week
################################################################################
## Testing
################################################################################
## == tests for scripts ====================
scripts:
stage: test
image: gekkofs/testing:0.9.0
needs: []
parallel:
matrix:
- SUBTEST: [ dl_dep.sh, compile_dep.sh ]
script:
- mkdir -p ${BUILD_PATH}/tests/scripts
- cd ${BUILD_PATH}/tests/scripts
- ${BATS} -r ${CI_PROJECT_DIR}/tests/scripts/${SUBTEST} --formatter junit > report.xml
artifacts:
expire_in: 1 week
reports:
junit: ${BUILD_PATH}/tests/scripts/report.xml
## == integration tests for gkfs ===========
gkfs:integration:
stage: test
image: gekkofs/testing:0.9.0
interruptible: true
needs: ['gkfs']
parallel:
matrix:
- SUBTEST: [ data, directories, operations, position, shell, status ]
script:
## run tests
- mkdir -p ${BUILD_PATH}/tests/run
- cd ${BUILD_PATH}/tests/integration
- ${PYTEST} -v -n $(nproc)
${INTEGRATION_TESTS_BIN_PATH}/${SUBTEST}
--basetemp=${BUILD_PATH}/tests/run/${SUBTEST}
--junit-xml=report.xml
## capture coverage information
- cd ${BUILD_PATH}
- ${CI_SCRIPTS_DIR}/coverage.sh
--verbose
--capture integration_${SUBTEST}
--root-dir ${CI_PROJECT_DIR}
--build-dir ${BUILD_PATH}
--exclusions "${CI_SCRIPTS_DIR}/.coverage-exclusions"
--log-file "${COVERAGE_PATH}/partial/integration_${SUBTEST}/capture.log"
# fix relative paths so that GitLab can find the correct files
after_script:
- perl -i.orig
-pe 's%file="(.*?)"%file="tests/integration/$1"%;'
-pe 's%(../)+install/share/gkfs/%%g;'
${BUILD_PATH}/tests/integration/report.xml
artifacts:
expire_in: 1 week
when: always
paths:
- ${BUILD_PATH}
reports:
junit: ${BUILD_PATH}/tests/integration/report.xml
## == integration tests for gkfwd ==========
gkfwd:integration:
stage: test
image: gekkofs/testing:0.9.0
interruptible: true
needs: ['gkfwd']
parallel:
matrix:
- SUBTEST: [ forwarding ]
script:
## run tests
- mkdir -p ${BUILD_PATH}/tests/run
- cd ${BUILD_PATH}/tests/integration
- ${PYTEST} -v -n $(nproc)
${INTEGRATION_TESTS_BIN_PATH}/${SUBTEST}
--basetemp=${BUILD_PATH}/tests/run/${SUBTEST}
--junit-xml=report.xml
## capture coverage information
- cd ${BUILD_PATH}
- ${CI_SCRIPTS_DIR}/coverage.sh
--verbose
--capture integration_${SUBTEST}
--root-dir ${CI_PROJECT_DIR}
--build-dir ${BUILD_PATH}
--exclusions "${CI_SCRIPTS_DIR}/.coverage-exclusions"
--log-file "${COVERAGE_PATH}/partial/integration_${SUBTEST}/capture.log"
# fix relative paths so that GitLab can find the correct files
after_script:
- perl -i.orig
-pe 's%file="(.*?)"%file="tests/integration/$1"%;'
-pe 's%(../)+install/share/gkfs/%%g;'
${BUILD_PATH}/tests/integration/report.xml
artifacts:
expire_in: 1 week
when: always
paths:
- ${BUILD_PATH}
reports:
junit: ${BUILD_PATH}/tests/integration/report.xml
## == unit tests for gkfs ==================
gkfs:unit:
stage: test
image: gekkofs/testing:0.9.0
needs: ['gkfs']
script:
## run actual tests
- cd ${BUILD_PATH}/tests/unit
- ctest -j $(nproc) -L unit::all --output-junit report.xml
## capture coverage information
- ${CI_SCRIPTS_DIR}/coverage.sh
--verbose
--capture unit
--root-dir ${CI_PROJECT_DIR}
--build-dir ${BUILD_PATH}
--exclusions "${CI_SCRIPTS_DIR}/.coverage-exclusions"
--log-file "${COVERAGE_PATH}/partial/unit/capture.log"
artifacts:
expire_in: 1 week
paths:
- ${BUILD_PATH}
reports:
junit: ${BUILD_PATH}/tests/unit/report.xml
################################################################################
## Generation of code coverage reports
################################################################################
coverage:
stage: report
image: gekkofs/coverage:0.9.0
needs: [ 'gkfs:integration', 'gkfwd:integration', 'gkfs:unit' ]
script:
- cd ${BUILD_PATH}
## merge the partial coverage files from each test in the pipeline
- ${CI_SCRIPTS_DIR}/coverage.sh
--verbose
--merge
--root-dir ${CI_PROJECT_DIR}
--build-dir ${BUILD_PATH}
artifacts:
reports:
cobertura: ${BUILD_PATH}/.coverage/coverage-cobertura.xml
paths:
- ${BUILD_PATH}/.coverage
expire_in: 2 weeks
gekkofs-uc3m_test/.gitmodules 0000664 0000000 0000000 00000001315 14172016224 0016567 0 ustar 00root root 0000000 0000000 [submodule "external/hermes"]
path = external/hermes
url = https://github.com/marcvef/hermes.git
[submodule "external/fmt"]
path = external/fmt
url = https://github.com/fmtlib/fmt
[submodule "tests/scripts/bats"]
path = tests/scripts/bats
url = https://github.com/bats-core/bats-core.git
[submodule "tests/scripts/helpers/bats-assert"]
path = tests/scripts/helpers/bats-assert
url = https://github.com/bats-core/bats-assert.git
[submodule "tests/scripts/helpers/bats-support"]
path = tests/scripts/helpers/bats-support
url = https://github.com/bats-core/bats-support.git
[submodule "tests/scripts/helpers/bats-file"]
path = tests/scripts/helpers/bats-file
url = https://github.com/bats-core/bats-file.git
gekkofs-uc3m_test/CHANGELOG.md 0000664 0000000 0000000 00000015273 14172016224 0016233 0 ustar 00root root 0000000 0000000 # Changelog
All notable changes to GekkoFS project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
- Added dirents_extended function and a find substitution proposal.
- Created a Guided Distributor using a mapping file to map chunks to specific
nodes.
## [0.8.0] - 2020-09-15
## New
- Both client library and daemon have been extended to support the ofi+verbs
protocol.
- A new Python testing harness has been implemented to support integration
tests. The end goal is to increase the robustness of the code in the mid- to
long-term.
- The RPC protocol and the usage of shared memory for intra-node communication
no longer need to be activated on compile time. New arguments
`-P|--rpc-protocol` and `--auto-sm` have been added to the daemon to this
effect. This configuration options are propagated to clients when they
initialize and contact daemons.
- Native support for the Omni-Path network protocol by choosing the `ofi+psm2`
RPC protocol. Note that this requires `libfabric`'s version to be greater
than `1.8` as well as `psm2` to be installed in the system. Clients must set
`FI_PSM2_DISCONNECT=1` to be able to reconnect once the client is shut down
once.
*Known limitations:* Client reconnect doesn't always work. Apparently, if
clients reconnect too fast the servers won't accept the connections. Also,
currently more than 16 clients per node are not supported.
- A new execution mode called `GekkoFWD` that allows GekkoFS to run as
a user-level I/O forwarding infrastructure for applications. In this mode,
I/O operations from an application are intercepted and forwarded to a single
GekkoFS daemon that is chosen according to a pre-defined distribution. In the
daemons, the requests are scheduled using the AGIOS scheduling library before
they are dispatched to the shared backend parallel file system.
- The `fsync()` system call is now fully supported.
## Improved
- Argobots tasks in the daemon are now wrapped in a dedicated class,
effectively removing the dependency. This lays ground work for future
non-Argobots I/O implementations.
- The `readdir()` implementation has been refactored and improved.
- Improvements on how to the installation scripts manage dependencies.
## Fixed
- The server sometimes crashed due to uncaught system errors in the storage
backend. This has now been fixed.
- Fixed a bug that broke `ls` on some architectures.
- Fixed a bug that leaked internal errors from the interception library to
client applications via `errno` propagation.
## [0.7.0] - 2020-02-05
## Added
- Adedd support for `eventfd()`and `eventfd2()` system calls.
## Changed
- Replaced Margo with Mercury in the client library in order to increase
application compatibility: the Argobots ULTs used by Margo to send and
process RPCs clashed at times with applications using pthreads.
- Renamed environment variables to better distinguish which variables affect
the client library (`LIBGKFS_*`) and which affect the daemon
(`GKFS_DAEMON_*`).
- Replaced spdlog in the client with a bespoke logging infrastructure:
spdlog's internal threads and exception management often had issues with the
system call interception infrastructure. The current logging infrastructure
is designed around the syscall interception mechanism, and is therefore more
stable.
- Due to the new logging infrastructure, there have been significant changes
to the environment variables controlling logging output. The desired log
module is now set with `LIBGKFS_LOG`, while the desired output channel is
controlled with `LIBGKFS_LOG_OUTPUT`. Additional options such as
`LIBGKFS_LOG_OUTPUT_TRUNC`, `LOG_SYSCALL_FILTER` and `LOG_DEBUG_VERBOSITY`
can be used to further control messages. Run the client with
`LIBGKFS_LOG=help` for more details.
- Improved dependency management in CMake.
## Fixed
- Relocate internal file descriptors to a private range to avoid interfering
with client application file descriptors.
- Handle internal file descriptors created by `fcntl()`.
- Handle internal file descriptors passed to processes using `CMSG_DATA` in
`recvmsg()`.
## [0.6.2] - 2019-10-07
## Added
- Paths inside kernel pseudo filesystems (`/sys`, `/proc`) are forwarded directly to the kernel and internal path resolution will be skipped. Be aware that also paths like `/sys/../tmp/gkfs_mountpoint/asd` will be forwarded to the kernel
- Added new Cmake flag `CREATE_CHECK_PARENTS` to controls if the existance of the parent node needs to be checked during the creation of a child node.
## Changed
- Daemon logs for RPC handlers have been polished
- Updated Margo, Mercury and Libfabric dependencies
## Fixed
- mk_node RPC wasn't propagating errors correctly from daemons
- README has been improoved and got some minor fixes
- fix wrong path in log call for mk_symlink function
## [0.6.1] - 2019-09-17
## Added
- Added new Cmake flag `LOG_SYSCALLS` to enable/disable syscall logging.
- Intercept the 64 bit version of `getdents`.
- Added debian-based docker image.
## Changed
- Disable syscalls logging by default
- Update Mercury, RocksDB and Libfabric dependencies
## Fixed
- Fix read at the end of file.
- Don't create log file when using `--version`/`--help` cli flags.
- On some systems LD_PRELOAD used on /bin/bash binary was not working.
- Missing definition of `loff_t` on new version of GCC.
## [0.6.0] - 2019-07-26
## Added
- Add compile time option to disable shared memory communication `-DUSE_SHM:BOOL=OFF`
## Changed
- Deamons does not store anymore information about the others deamons.
- Improoved error handling on deamon initialization
- Decreased RPC timeout 3min -> 3sec
- Update 3rd party dependencies
## Removed
- PID file is not used anymore, we use only the new `hosts file` for out of bound communication
- Dropped CCI plugin support
- Dropped hostname-suffix cli option
- Dropped port cli option (use `--listen` instead)
- It is not needed anymore to pass hosts information to deamons, thus the `--hosts` cli have been removed
## Fixed
- Errors on get_dirents RPC are now reported back to clients
- Write errors happenig on deamons are now reported back to clients
- number overflow on lseek didn't allow to use seek on huge files
## [0.5.0] - 2019-04-29
## Changed
- Intercept I/O syscalls instead of GlibC function using [syscall intercept library](https://github.com/pmem/syscall_intercept)
## [0.4.0] - 2019-04-18
First GekkoFS public release
This version provides a client library that uses GLibC I/O function interception.
## [0.3.1] - 2018-03-04
### Changed
- Read-write process improved. @Marc vef
- Improved Filemap. @Marc Vef
gekkofs-uc3m_test/CMake/ 0000775 0000000 0000000 00000000000 14172016224 0015372 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/CMake/FindAGIOS.cmake 0000664 0000000 0000000 00000004772 14172016224 0020051 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
find_path(AGIOS_INCLUDE_DIR
NAMES agios.h
)
find_library(AGIOS_LIBRARY
NAMES agios
)
set(AGIOS_INCLUDE_DIRS ${AGIOS_INCLUDE_DIR})
set(AGIOS_LIBRARIES ${AGIOS_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AGIOS DEFAULT_MSG AGIOS_LIBRARIES AGIOS_INCLUDE_DIRS)
mark_as_advanced(
AGIOS_LIBRARY
AGIOS_INCLUDE_DIR
) gekkofs-uc3m_test/CMake/FindAbt.cmake 0000664 0000000 0000000 00000004750 14172016224 0017711 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
find_path(ABT_INCLUDE_DIR
NAMES abt.h
)
find_library(ABT_LIBRARY
NAMES abt
)
set(ABT_INCLUDE_DIRS ${ABT_INCLUDE_DIR})
set(ABT_LIBRARIES ${ABT_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Abt DEFAULT_MSG ABT_LIBRARIES ABT_INCLUDE_DIRS)
mark_as_advanced(
ABT_LIBRARY
ABT_INCLUDE_DIR
) gekkofs-uc3m_test/CMake/FindBoost_preprocessor.cmake 0000664 0000000 0000000 00000004741 14172016224 0023077 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
find_path(BOOST_PREPROCESSOR_INCLUDE_DIR
NAMES boost/preprocessor.hpp
)
set(BOOST_PREPROCESSOR_INCLUDE_DIRS ${BOOST_PREPROCESSOR_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Boost_preprocessor DEFAULT_MSG BOOST_PREPROCESSOR_INCLUDE_DIRS)
mark_as_advanced(
BOOST_PREPROCESSOR_INCLUDE_DIR
) gekkofs-uc3m_test/CMake/FindDate.cmake 0000664 0000000 0000000 00000005716 14172016224 0020063 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
find_path(DATE_INCLUDE_DIR
NAMES date/date.h
)
find_path(TZ_INCLUDE_DIR
NAMES date/tz.h
)
find_library(TZ_LIBRARY
NAMES tz
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( Date
DEFAULT_MSG
DATE_INCLUDE_DIR
TZ_INCLUDE_DIR
TZ_LIBRARY
)
if(Date_FOUND)
set(DATE_INCLUDE_DIRS ${DATE_INCLUDE_DIR})
set(TZ_INCLUDE_DIRS ${TZ_INCLUDE_DIR})
set(TZ_LIBRARIES ${TZ_LIBRARY})
if(NOT TARGET Date::TZ)
add_library(Date::TZ UNKNOWN IMPORTED)
set_target_properties(Date::TZ PROPERTIES
IMPORTED_LOCATION "${TZ_LIBRARY}"
INTERFACE_COMPILE_DEFINITIONS "USE_OS_TZDB=1"
INTERFACE_INCLUDE_DIRECTORIES "${TZ_INCLUDE_DIR}"
)
endif()
endif()
mark_as_advanced(
DATE_INCLUDE_DIR
TZ_INCLUDE_DIR
TZ_LIBRARY
)
gekkofs-uc3m_test/CMake/FindFilesystem.cmake 0000664 0000000 0000000 00000017624 14172016224 0021333 0 ustar 00root root 0000000 0000000 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindFilesystem
##############
This module supports the C++17 standard library's filesystem utilities. Use the
:imp-target:`std::filesystem` imported target to
Options
*******
The ``COMPONENTS`` argument to this module supports the following values:
.. find-component:: Experimental
:name: fs.Experimental
Allows the module to find the "experimental" Filesystem TS version of the
Filesystem library. This is the library that should be used with the
``std::experimental::filesystem`` namespace.
.. find-component:: Final
:name: fs.Final
Finds the final C++17 standard version of the filesystem library.
If no components are provided, behaves as if the
:find-component:`fs.Final` component was specified.
If both :find-component:`fs.Experimental` and :find-component:`fs.Final` are
provided, first looks for ``Final``, and falls back to ``Experimental`` in case
of failure. If ``Final`` is found, :imp-target:`std::filesystem` and all
:ref:`variables ` will refer to the ``Final`` version.
Imported Targets
****************
.. imp-target:: std::filesystem
The ``std::filesystem`` imported target is defined when any requested
version of the C++ filesystem library has been found, whether it is
*Experimental* or *Final*.
If no version of the filesystem library is available, this target will not
be defined.
.. note::
This target has ``cxx_std_17`` as an ``INTERFACE``
:ref:`compile language standard feature `. Linking
to this target will automatically enable C++17 if no later standard
version is already required on the linking target.
.. _fs.variables:
Variables
*********
.. variable:: CXX_FILESYSTEM_IS_EXPERIMENTAL
Set to ``TRUE`` when the :find-component:`fs.Experimental` version of C++
filesystem library was found, otherwise ``FALSE``.
.. variable:: CXX_FILESYSTEM_HAVE_FS
Set to ``TRUE`` when a filesystem header was found.
.. variable:: CXX_FILESYSTEM_HEADER
Set to either ``filesystem`` or ``experimental/filesystem`` depending on
whether :find-component:`fs.Final` or :find-component:`fs.Experimental` was
found.
.. variable:: CXX_FILESYSTEM_NAMESPACE
Set to either ``std::filesystem`` or ``std::experimental::filesystem``
depending on whether :find-component:`fs.Final` or
:find-component:`fs.Experimental` was found.
Examples
********
Using `find_package(Filesystem)` with no component arguments:
.. code-block:: cmake
find_package(Filesystem REQUIRED)
add_executable(my-program main.cpp)
target_link_libraries(my-program PRIVATE std::filesystem)
#]=======================================================================]
if(TARGET std::filesystem)
# This module has already been processed. Don't do it again.
return()
endif()
cmake_minimum_required(VERSION 3.10)
include(CMakePushCheckState)
include(CheckIncludeFileCXX)
# If we're not cross-compiling, try to run test executables.
# Otherwise, assume that compile + link is a sufficient check.
if(CMAKE_CROSSCOMPILING)
include(CheckCXXSourceCompiles)
macro(_cmcm_check_cxx_source code var)
check_cxx_source_compiles("${code}" ${var})
endmacro()
else()
include(CheckCXXSourceRuns)
macro(_cmcm_check_cxx_source code var)
check_cxx_source_runs("${code}" ${var})
endmacro()
endif()
cmake_push_check_state()
set(CMAKE_REQUIRED_QUIET ${Filesystem_FIND_QUIETLY})
# All of our tests required C++17 or later
set(CMAKE_CXX_STANDARD 17)
# Normalize and check the component list we were given
set(want_components ${Filesystem_FIND_COMPONENTS})
if(Filesystem_FIND_COMPONENTS STREQUAL "")
set(want_components Final)
endif()
# Warn on any unrecognized components
set(extra_components ${want_components})
list(REMOVE_ITEM extra_components Final Experimental)
foreach(component IN LISTS extra_components)
message(WARNING "Extraneous find_package component for Filesystem: ${component}")
endforeach()
# Detect which of Experimental and Final we should look for
set(find_experimental TRUE)
set(find_final TRUE)
if(NOT "Final" IN_LIST want_components)
set(find_final FALSE)
endif()
if(NOT "Experimental" IN_LIST want_components)
set(find_experimental FALSE)
endif()
if(find_final)
check_include_file_cxx("filesystem" _CXX_FILESYSTEM_HAVE_HEADER)
mark_as_advanced(_CXX_FILESYSTEM_HAVE_HEADER)
if(_CXX_FILESYSTEM_HAVE_HEADER)
# We found the non-experimental header. Don't bother looking for the
# experimental one.
set(find_experimental FALSE)
endif()
else()
set(_CXX_FILESYSTEM_HAVE_HEADER FALSE)
endif()
if(find_experimental)
check_include_file_cxx("experimental/filesystem" _CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
mark_as_advanced(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
else()
set(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER FALSE)
endif()
if(_CXX_FILESYSTEM_HAVE_HEADER)
set(_have_fs TRUE)
set(_fs_header filesystem)
set(_fs_namespace std::filesystem)
set(_is_experimental FALSE)
elseif(_CXX_FILESYSTEM_HAVE_EXPERIMENTAL_HEADER)
set(_have_fs TRUE)
set(_fs_header experimental/filesystem)
set(_fs_namespace std::experimental::filesystem)
set(_is_experimental TRUE)
else()
set(_have_fs FALSE)
endif()
set(CXX_FILESYSTEM_HAVE_FS ${_have_fs} CACHE BOOL "TRUE if we have the C++ filesystem headers")
set(CXX_FILESYSTEM_HEADER ${_fs_header} CACHE STRING "The header that should be included to obtain the filesystem APIs")
set(CXX_FILESYSTEM_NAMESPACE ${_fs_namespace} CACHE STRING "The C++ namespace that contains the filesystem APIs")
set(CXX_FILESYSTEM_IS_EXPERIMENTAL ${_is_experimental} CACHE BOOL "TRUE if the C++ filesystem library is the experimental version")
set(_found FALSE)
if(CXX_FILESYSTEM_HAVE_FS)
# We have some filesystem library available. Do link checks
string(CONFIGURE [[
#include
#include <@CXX_FILESYSTEM_HEADER@>
int main() {
auto cwd = @CXX_FILESYSTEM_NAMESPACE@::current_path();
printf("%s", cwd.c_str());
return EXIT_SUCCESS;
}
]] code @ONLY)
# Check a simple filesystem program without any linker flags
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_NO_LINK_NEEDED)
set(can_link ${CXX_FILESYSTEM_NO_LINK_NEEDED})
if(NOT CXX_FILESYSTEM_NO_LINK_NEEDED)
set(prev_libraries ${CMAKE_REQUIRED_LIBRARIES})
# Add the libstdc++ flag
set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lstdc++fs)
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_STDCPPFS_NEEDED)
set(can_link ${CXX_FILESYSTEM_STDCPPFS_NEEDED})
if(NOT CXX_FILESYSTEM_STDCPPFS_NEEDED)
# Try the libc++ flag
set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lc++fs)
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_CPPFS_NEEDED)
set(can_link ${CXX_FILESYSTEM_CPPFS_NEEDED})
endif()
endif()
if(can_link)
add_library(std::filesystem INTERFACE IMPORTED)
set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17)
set(_found TRUE)
if(CXX_FILESYSTEM_NO_LINK_NEEDED)
# Nothing to add...
elseif(CXX_FILESYSTEM_STDCPPFS_NEEDED)
set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_LINK_LIBRARIES -lstdc++fs)
elseif(CXX_FILESYSTEM_CPPFS_NEEDED)
set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_LINK_LIBRARIES -lc++fs)
endif()
endif()
endif()
cmake_pop_check_state()
set(Filesystem_FOUND ${_found} CACHE BOOL "TRUE if we can run a program using std::filesystem" FORCE)
if(Filesystem_FIND_REQUIRED AND NOT Filesystem_FOUND)
message(FATAL_ERROR "Cannot run simple program using std::filesystem")
endif() gekkofs-uc3m_test/CMake/FindJeMalloc.cmake 0000664 0000000 0000000 00000006422 14172016224 0020667 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
# - Try to find jemalloc headers and libraries.
#
# Usage of this module as follows:
#
# find_package(JeMalloc)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# JEMALLOC_ROOT_DIR Set this variable to the root installation of
# jemalloc if the module has problems finding
# the proper installation path.
#
# Variables defined by this module:
#
# JEMALLOC_FOUND System has jemalloc libs/headers
# JEMALLOC_LIBRARIES The jemalloc library/libraries
# JEMALLOC_INCLUDE_DIR The location of jemalloc headers
find_library(JEMALLOC_LIBRARY
NAMES jemalloc
HINTS ${JEMALLOC_ROOT_DIR}/lib
)
find_path(JEMALLOC_INCLUDE_DIR
NAMES jemalloc/jemalloc.h
HINTS ${JEMALLOC_ROOT_DIR}/include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JeMalloc DEFAULT_MSG
JEMALLOC_LIBRARY
JEMALLOC_INCLUDE_DIR
)
mark_as_advanced(
JEMALLOC_LIBRARY
JEMALLOC_INCLUDE_DIR
)
set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR}) gekkofs-uc3m_test/CMake/FindLZ4.cmake 0000664 0000000 0000000 00000005243 14172016224 0017612 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
# - Find Lz4
# Find the lz4 compression library and includes
#
# LZ4_FOUND - True if lz4 found.
# LZ4_LIBRARIES - List of libraries when using lz4.
# LZ4_INCLUDE_DIR - where to find lz4.h, etc.
find_path(LZ4_INCLUDE_DIR
NAMES lz4.h
)
find_library(LZ4_LIBRARY
NAMES lz4
)
set(LZ4_LIBRARIES ${LZ4_LIBRARY} )
set(LZ4_INCLUDE_DIRS ${LZ4_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR)
mark_as_advanced(
LZ4_LIBRARY
LZ4_INCLUDE_DIR
)
gekkofs-uc3m_test/CMake/FindMargo.cmake 0000664 0000000 0000000 00000006205 14172016224 0020245 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
# Try to find Margo headers and library.
#
# Usage of this module as follows:
#
# find_package(Margo)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# MARGO_ROOT_DIR Set this variable to the root installation of
# Margo if the module has problems finding the
# proper installation path.
#
# Variables defined by this module:
#
# MARGO_FOUND System has Margo library/headers.
# MARGO_LIBRARIES The Margo library.
# MARGO_INCLUDE_DIRS The location of Margo headers.
find_path(MARGO_INCLUDE_DIR
NAMES margo.h
)
find_library(MARGO_LIBRARY
NAMES margo
)
set(MARGO_INCLUDE_DIRS ${MARGO_INCLUDE_DIR})
set(MARGO_LIBRARIES ${MARGO_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Margo DEFAULT_MSG MARGO_LIBRARY MARGO_INCLUDE_DIR)
mark_as_advanced(
MARGO_LIBRARY
MARGO_INCLUDE_DIR
) gekkofs-uc3m_test/CMake/FindRocksDB.cmake 0000664 0000000 0000000 00000005553 14172016224 0020474 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
# Try to find RocksDB headers and library.
#
# Usage of this module as follows:
#
# find_package(RocksDB)
#
# Variables defined by this module:
#
# ROCKSDB_FOUND System has RocksDB library/headers.
# ROCKSDB_LIBRARIES The RocksDB library.
# ROCKSDB_INCLUDE_DIRS The location of RocksDB headers.
find_library(ROCKSDB_LIBRARY
NAMES rocksdb
)
find_path(ROCKSDB_INCLUDE_DIR
NAMES rocksdb/db.h
)
set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY})
set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RocksDB DEFAULT_MSG
ROCKSDB_LIBRARY
ROCKSDB_INCLUDE_DIR
)
mark_as_advanced(
ROCKSDB_LIBRARY
ROCKSDB_INCLUDE_DIR
) gekkofs-uc3m_test/CMake/FindSnappy.cmake 0000664 0000000 0000000 00000005022 14172016224 0020446 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
find_library(Snappy_LIBRARY
NAMES snappy
)
find_path(Snappy_INCLUDE_DIR
NAMES snappy.h
)
set(Snappy_LIBRARIES ${Snappy_LIBRARY})
set(Snappy_INCLUDE_DIRS ${Snappy_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Snappy DEFAULT_MSG Snappy_LIBRARY Snappy_INCLUDE_DIR)
mark_as_advanced(
Snappy_LIBRARY
Snappy_INCLUDE_DIR
)
gekkofs-uc3m_test/CMake/FindSyscall_intercept.cmake 0000664 0000000 0000000 00000006524 14172016224 0022673 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
find_package(PkgConfig)
pkg_check_modules(PC_Syscall_intercept QUIET libsyscall_intercept)
find_path(Syscall_intercept_INCLUDE_DIR
NAMES libsyscall_intercept_hook_point.h
PATHS ${PC_Syscall_intercept_INCLUDE_DIRS}
)
find_library(Syscall_intercept_LIBRARY
NAMES syscall_intercept
PATHS ${PC_Syscall_intercept_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Syscall_intercept
DEFAULT_MSG
Syscall_intercept_INCLUDE_DIR
Syscall_intercept_LIBRARY
)
if(Syscall_intercept_FOUND)
set(Syscall_intercept_LIBRARIES ${Syscall_intercept_LIBRARY})
set(Syscall_intercept_INCLUDE_DIRS ${Syscall_intercept_INCLUDE_DIR})
set(Syscall_intercept_DEFINITIONS ${PC_Syscall_intercept_CFLAGS_OTHER})
if(NOT TARGET Syscall_intercept::Syscall_intercept)
add_library(Syscall_intercept::Syscall_intercept UNKNOWN IMPORTED)
set_target_properties(Syscall_intercept::Syscall_intercept PROPERTIES
IMPORTED_LOCATION "${Syscall_intercept_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_Syscall_intercept_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${Syscall_intercept_INCLUDE_DIR}"
)
endif()
endif()
mark_as_advanced(
Syscall_intercept_INCLUDE_DIR
Syscall_intercept_LIBRARY
)
gekkofs-uc3m_test/CMake/FindZStd.cmake 0000664 0000000 0000000 00000005153 14172016224 0020065 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
#
# - Try to find Facebook zstd library
# This will define
# ZStd_FOUND
# ZStd_INCLUDE_DIR
# ZStd_LIBRARIES
#
find_path(ZStd_INCLUDE_DIR
NAMES zstd.h
)
find_library(ZStd_LIBRARY
NAMES zstd
)
set(ZStd_LIBRARIES ${ZStd_LIBRARY})
set(ZStd_INCLUDE_DIRS ${ZStd_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZStd
DEFAULT_MSG ZStd_LIBRARY ZStd_INCLUDE_DIR
)
mark_as_advanced(
ZStd_LIBRARY
ZStd_INCLUDE_DIR
) gekkofs-uc3m_test/CMake/GkfsPythonTesting.cmake 0000664 0000000 0000000 00000026220 14172016224 0022030 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
include(CMakeParseArguments)
function(gkfs_enable_python_testing)
# Parse arguments
set(MULTI BINARY_DIRECTORIES LIBRARY_PREFIX_DIRECTORIES)
cmake_parse_arguments(PYTEST "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN})
if(PYTEST_UNPARSED_ARGUMENTS)
message(WARNING "Unparsed arguments in gkfs_enable_python_testing: This often indicates typos!")
endif()
if(PYTEST_BINARY_DIRECTORIES)
set(GKFS_PYTEST_BINARY_DIRECTORIES ${PYTEST_BINARY_DIRECTORIES} PARENT_SCOPE)
endif()
if(PYTEST_LIBRARY_PREFIX_DIRECTORIES)
set(GKFS_PYTEST_LIBRARY_PREFIX_DIRECTORIES ${PYTEST_LIBRARY_PREFIX_DIRECTORIES} PARENT_SCOPE)
endif()
set(PYTEST_BINDIR_ARGS, "")
if(PYTEST_BINARY_DIRECTORIES)
foreach(dir IN LISTS PYTEST_BINARY_DIRECTORIES)
list(APPEND PYTEST_BINDIR_ARGS "--bin-dir=${dir}")
endforeach()
endif()
set(PYTEST_LIBDIR_ARGS, "")
if(PYTEST_LIBRARY_PREFIX_DIRECTORIES)
foreach(dir IN LISTS PYTEST_LIBRARY_PREFIX_DIRECTORIES)
if(NOT IS_ABSOLUTE ${dir})
set(dir ${CMAKE_BINARY_DIR}/${dir})
endif()
file(TO_CMAKE_PATH "${dir}/lib" libdir)
file(TO_CMAKE_PATH "${dir}/lib64" lib64dir)
if(EXISTS ${libdir})
list(APPEND PYTEST_LIBDIR_ARGS "--lib-dir=${libdir}")
endif()
if(EXISTS ${lib64dir})
list(APPEND PYTEST_LIBDIR_ARGS "--lib-dir=${lib64dir}")
endif()
endforeach()
endif()
# convert path lists to space separated arguments
string(REPLACE ";" " " PYTEST_BINDIR_ARGS "${PYTEST_BINDIR_ARGS}")
string(REPLACE ";" " " PYTEST_BINDIR_ARGS "${PYTEST_BINDIR_ARGS}")
configure_file(pytest.ini.in pytest.ini @ONLY)
configure_file(conftest.py.in conftest.py @ONLY)
configure_file(harness/cli.py harness/cli.py COPYONLY)
if(GKFS_INSTALL_TESTS)
configure_file(pytest.install.ini.in pytest.install.ini @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pytest.install.ini
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gkfs/tests/integration
RENAME pytest.ini
)
install(FILES conftest.py
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gkfs/tests/integration
)
if(NOT PYTEST_VIRTUALENV)
set(PYTEST_VIRTUALENV ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gkfs/tests/integration/pytest-venv)
endif()
# Python's virtual environments are not relocatable, we need to
# recreate the virtualenv at the appropriate install location
# find an appropriate python interpreter
find_package(Python3
3.6
REQUIRED
COMPONENTS Interpreter)
if(NOT Python3_FOUND)
message(FATAL_ERROR "Unable to find Python 3")
endif()
install(
CODE "message(\"Install pytest virtual environment...\")"
CODE "message(\"-- Create virtual environment: ${PYTEST_VIRTUALENV}\")"
CODE "execute_process(
COMMAND ${Python3_EXECUTABLE} -m venv ${PYTEST_VIRTUALENV}
RESULT_VARIABLE STATUS
OUTPUT_VARIABLE CMD_OUT
ERROR_VARIABLE CMD_ERR
OUTPUT_FILE install_stdout.log
ERROR_FILE install_stderr.log)"
CODE "if(STATUS AND NOT STATUS EQUAL 0)
message(FATAL_ERROR \"Creation of pytest virtual environment failed. Check 'cmake_install_stdout.log' and 'cmake_install_stderr.log' for details\")
endif()"
)
install(
CODE "message(\"-- Installing packages...\")"
CODE "execute_process(
COMMAND ${PYTEST_VIRTUALENV}/bin/pip install --upgrade pip -v
RESULT_VARIABLE STATUS
OUTPUT_VARIABLE CMD_OUT
ERROR_VARIABLE CMD_ERR
OUTPUT_FILE install_stdout.log
ERROR_FILE install_stderr.log)"
CODE "if(STATUS AND NOT STATUS EQUAL 0)
message(FATAL_ERROR \"Installation of pytest dependencies failed. Check 'cmake_install_stdout.log' and 'cmake_install_stderr.log' for details\")
endif()"
CODE "execute_process(
COMMAND ${PYTEST_VIRTUALENV}/bin/pip install -r ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt --upgrade -v
RESULT_VARIABLE STATUS
OUTPUT_VARIABLE CMD_OUT
ERROR_VARIABLE CMD_ERR
OUTPUT_FILE install_stdout.log
ERROR_FILE install_stderr.log)"
CODE "if(STATUS AND NOT STATUS EQUAL 0)
message(FATAL_ERROR \"Installation of pytest dependencies failed. Check 'cmake_install_stdout.log' and 'cmake_install_stderr.log' for details\")
endif()"
)
endif()
# enable testing
set(GKFS_PYTHON_TESTING_ENABLED ON PARENT_SCOPE)
endfunction()
function(gkfs_add_python_test)
# ignore call if testing is not enabled
if(NOT CMAKE_TESTING_ENABLED OR NOT GKFS_PYTHON_TESTING_ENABLED)
return()
endif()
# Parse arguments
set(OPTION)
set(SINGLE NAME PYTHON_VERSION WORKING_DIRECTORY VIRTUALENV)
set(MULTI SOURCE BINARY_DIRECTORIES LIBRARY_PREFIX_DIRECTORIES)
cmake_parse_arguments(PYTEST "${OPTION}" "${SINGLE}" "${MULTI}" ${ARGN})
if(PYTEST_UNPARSED_ARGUMENTS)
message(WARNING "Unparsed arguments in gkfs_add_python_test: This often indicates typos!")
endif()
if(NOT PYTEST_NAME)
message(FATAL_ERROR "gkfs_add_python_test requires a NAME argument")
endif()
# set default values for arguments not provided
if(NOT PYTEST_PYTHON_VERSION)
set(PYTEST_PYTHON_VERSION 3.0)
endif()
if(NOT PYTEST_WORKING_DIRECTORY)
set(PYTEST_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
if(NOT PYTEST_VIRTUALENV)
set(PYTEST_VIRTUALENV ${CMAKE_CURRENT_BINARY_DIR}/pytest-venv)
endif()
# if the test doesn't provide a list of binary or library prefix
# directories, use the one set on gkfs_enable_python_testing()
if(NOT PYTEST_BINARY_DIRECTORIES)
set(PYTEST_BINARY_DIRECTORIES ${GKFS_PYTEST_BINARY_DIRECTORIES})
endif()
if(NOT PYTEST_LIBRARY_PREFIX_DIRECTORIES)
set(PYTEST_LIBRARY_PREFIX_DIRECTORIES ${GKFS_PYTEST_LIBRARY_PREFIX_DIRECTORIES})
endif()
set(PYTEST_COMMAND_ARGS, "")
if(PYTEST_BINARY_DIRECTORIES)
foreach(dir IN LISTS PYTEST_BINARY_DIRECTORIES)
list(APPEND PYTEST_COMMAND_ARGS "--bin-dir=${dir}")
endforeach()
endif()
if(PYTEST_LIBRARY_PREFIX_DIRECTORIES)
foreach(dir IN LISTS PYTEST_LIBRARY_PREFIX_DIRECTORIES)
if(NOT IS_ABSOLUTE ${dir})
set(dir ${CMAKE_BINARY_DIR}/${dir})
endif()
file(TO_CMAKE_PATH "${dir}/lib" libdir)
file(TO_CMAKE_PATH "${dir}/lib64" lib64dir)
if(EXISTS "${dir}/lib")
list(APPEND PYTEST_COMMAND_ARGS "--lib-dir=${libdir}")
endif()
if(EXISTS "${dir}/lib64")
list(APPEND PYTEST_COMMAND_ARGS "--lib-dir=${lib64dir}")
endif()
endforeach()
endif()
# Extend the given virtualenv to be a full path.
if(NOT IS_ABSOLUTE ${PYTEST_VIRTUALENV})
set(PYTEST_VIRTUALENV ${CMAKE_BINARY_DIR}/${PYTEST_VIRTUALENV})
endif()
# find an appropriate python interpreter
find_package(Python3
${PYTEST_PYTHON_VERSION}
REQUIRED
COMPONENTS Interpreter)
set(PYTEST_VIRTUALENV_PIP ${PYTEST_VIRTUALENV}/bin/pip)
set(PYTEST_VIRTUALENV_INTERPRETER ${PYTEST_VIRTUALENV}/bin/python)
# create a virtual environment to run the test
configure_file(requirements.txt.in requirements.txt @ONLY)
add_custom_command(
OUTPUT ${PYTEST_VIRTUALENV}
COMMENT "Creating virtual environment ${PYTEST_VIRTUALENV}"
COMMAND Python3::Interpreter -m venv "${PYTEST_VIRTUALENV}"
COMMAND ${PYTEST_VIRTUALENV_PIP} install --upgrade pip -q
COMMAND ${PYTEST_VIRTUALENV_PIP} install -r requirements.txt --upgrade -q
)
if(NOT TARGET venv)
# ensure that the virtual environment is created by the build process
# (this is required because we can't add dependencies between
# "test targets" and "normal targets"
add_custom_target(venv
ALL
DEPENDS ${PYTEST_VIRTUALENV}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt)
endif()
add_test(NAME ${PYTEST_NAME}
COMMAND ${PYTEST_VIRTUALENV_INTERPRETER}
-m pytest -v -s
${PYTEST_COMMAND_ARGS}
${PYTEST_SOURCE}
WORKING_DIRECTORY ${PYTEST_WORKING_DIRECTORY})
# instruct Python to not create __pycache__ directories,
# otherwise they will pollute ${PYTEST_WORKING_DIRECTORY} which
# is typically ${PROJECT_SOURCE_DIR}
set_tests_properties(${PYTEST_NAME} PROPERTIES
ENVIRONMENT PYTHONDONTWRITEBYTECODE=1)
endfunction()
gekkofs-uc3m_test/CMake/gkfs-code-coverage.cmake 0000664 0000000 0000000 00000011737 14172016224 0022040 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
# Variables
option(GKFS_ENABLE_CODE_COVERAGE
"Builds GekkoFS targets with code coverage instrumentation."
OFF
)
# Common initialization/checks
if(GKFS_ENABLE_CODE_COVERAGE AND NOT GKFS_CODE_COVERAGE_ADDED)
set(GKFS_CODE_COVERAGE_ADDED ON)
if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang"
OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
message(STATUS "[gekkofs] Building with LLVM Code Coverage Tools")
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
"GNU")
message(STATUS "[gekkofs] Building with GCC Code Coverage Tools")
if(CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} upper_build_type)
if(NOT ${upper_build_type} STREQUAL "DEBUG")
message(
WARNING
"Code coverage results with an optimized (non-Debug) build may be misleading"
)
endif()
else()
message(
WARNING
"Code coverage results with an optimized (non-Debug) build may be misleading"
)
endif()
else()
message(FATAL_ERROR "Code coverage requires Clang or GCC. Aborting.")
endif()
endif()
# Adds code coverage instrumentation to libraries and executable targets.
# ~~~
# Required:
# TARGET_NAME - Name of the target to generate code coverage for.
# Optional:
# PUBLIC - Sets the visibility for added compile options to targets to PUBLIC
# instead of the default of PRIVATE.
# PRIVATE - Sets the visibility for added compile options to targets to
# INTERFACE instead of the default of PRIVATE.
# ~~~
function(target_code_coverage TARGET_NAME)
# Argument parsing
set(options PUBLIC INTERFACE)
cmake_parse_arguments(target_code_coverage "${options}" "" "" ${ARGN})
# Set the visibility of target functions to PUBLIC, INTERFACE or default to
# PRIVATE.
if(target_code_coverage_PUBLIC)
set(TARGET_VISIBILITY PUBLIC)
elseif(target_code_coverage_INTERFACE)
set(TARGET_VISIBILITY INTERFACE)
else()
set(TARGET_VISIBILITY PRIVATE)
endif()
if(GKFS_ENABLE_CODE_COVERAGE)
# Add code coverage instrumentation to the target's linker command
if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang"
OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY}
-fprofile-instr-generate -fcoverage-mapping)
target_link_options(${TARGET_NAME} ${TARGET_VISIBILITY}
-fprofile-instr-generate -fcoverage-mapping)
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
"GNU")
target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY} -fprofile-arcs
-ftest-coverage)
target_link_libraries(${TARGET_NAME} ${TARGET_VISIBILITY} gcov)
endif()
endif()
endfunction()
gekkofs-uc3m_test/CMakeLists.txt 0000664 0000000 0000000 00000027000 14172016224 0017151 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
cmake_minimum_required(VERSION 3.6)
project(
GekkoFS
VERSION 0.8.0
)
enable_testing()
if (NOT CMAKE_COMPILER_IS_GNUCC)
message(FATAL_ERROR "The choosen C compiler is not gcc and is not supported")
endif ()
if (NOT CMAKE_COMPILER_IS_GNUCXX)
message(FATAL_ERROR "The choosen C++ compiler is not g++ and is not supported")
endif ()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build: Debug Release Memcheck" FORCE)
ENDIF (NOT CMAKE_BUILD_TYPE)
message(STATUS "[gekkofs] Build type: ${CMAKE_BUILD_TYPE}")
# Compiler flags for various cmake build types
set(WARNINGS_FLAGS "-Wall -Wextra --pedantic -Wno-unused-parameter -Wno-missing-field-initializers")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${WARNINGS_FLAGS} -g -O0 -DGKFS_DEBUG_BUILD -DHERMES_DEBUG_BUILD")
set(CMAKE_CXX_FLAGS_MEMCHECK "${WARNINGS_FLAGS} -g -O0 -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_MAINTAINER "${WARNINGS_FLAGS} -g -O0 -pg -no-pie")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG -O3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${WARNINGS_FLAGS} -g -O0 -DGKFS_DEBUG_BUILD")
set(CMAKE_C_FLAGS_MEMCHECK "${WARNINGS_FLAGS} -g -O0 -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_MAINTAINER "${WARNINGS_FLAGS} -g -O0 -pg -no-pie")
mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER)
# CMake and general includes
include(CheckCXXSourceCompiles)
include(CMakeDependentOption)
include(GNUInstallDirs)
# Project version
set(GIT_VERSION_FOUND FALSE)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
find_package(Git)
if (Git_FOUND)
execute_process(COMMAND /bin/bash -c "${GIT_EXECUTABLE} describe --tags --match='v*.*.*' --long --dirty"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_RET
OUTPUT_VARIABLE GIT_VERSION
ERROR_VARIABLE GIT_ERR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if ("${GIT_RET}" STREQUAL "0")
string(REGEX MATCH
"^v([0-9]+)\.([0-9]+)\.([0-9]+)-([0-9]+)-(.*)$"
DROP ${GIT_VERSION})
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})
set(PROJECT_VERSION_MINOR ${CMAKE_MATCH_2})
set(PROJECT_VERSION_PATCH ${CMAKE_MATCH_3})
set(GKFS_COMMIT_GAP ${CMAKE_MATCH_4})
set(GKFS_COMMIT_HASH ${CMAKE_MATCH_5})
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-snapshot+${GKFS_COMMIT_GAP}-${GKFS_COMMIT_HASH}")
set(GIT_VERSION_FOUND TRUE)
else ()
message(WARNING "Failed to run `git describe`: [${GIT_RET}] '${GIT_ERR}'")
endif ()
endif ()
endif ()
message(STATUS "[gekkofs] Project version: ${PROJECT_VERSION}")
set(GKFS_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(GKFS_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(GKFS_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(GKFS_VERSION_STRING ${PROJECT_VERSION})
configure_file(include/version.hpp.in include/version.hpp)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
################################################################################
## Coverage generation support:
## ============================
##
## The `gkfs-code-coverage' module enables the GKFS_ENABLE_CODE_COVERAGE option
## as well as the target_code_coverage() function.
################################################################################
include(gkfs-code-coverage)
set(CMAKE_EXPORT_COMPILE_COMMANDS 0)
# Rocksdb dependencies
find_package(LZ4 REQUIRED)
find_package(JeMalloc) # required if rocksdb has been build with jemalloc
find_package(RocksDB REQUIRED)
# margo dependencies
find_package(Mercury REQUIRED)
find_package(Abt REQUIRED)
find_package(Margo REQUIRED)
find_package(Syscall_intercept REQUIRED)
find_package(Threads REQUIRED)
# some compilers need extra flags for std::filesystem, such as -lstdc++fs, this
# produces a std::filesystem imported target that takes care of all these
# details transparently
find_package(Filesystem REQUIRED)
find_package(Date REQUIRED)
option(CREATE_CHECK_PARENTS "Check parent directory existance before creating child node" ON)
message(STATUS "[gekkofs] Create checks parents: ${CREATE_CHECK_PARENTS}")
option(SYMLINK_SUPPORT "Compile with support for symlinks" ON)
if (SYMLINK_SUPPORT)
add_definitions(-DHAS_SYMLINKS)
endif ()
message(STATUS "[gekkofs] Symlink support: ${SYMLINK_SUPPORT}")
set(MAX_INTERNAL_FDS 256 CACHE STRING "Number of file descriptors reserved for internal use")
add_definitions(-DMAX_INTERNAL_FDS=${MAX_INTERNAL_FDS})
message(STATUS "[gekkofs] File descriptors reserved for internal use: ${MAX_INTERNAL_FDS}")
execute_process(COMMAND getconf OPEN_MAX
OUTPUT_VARIABLE GETCONF_MAX_FDS
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if (NOT GETCONF_MAX_FDS)
set(GETCONF_MAX_FDS=512)
endif ()
add_definitions(-DMAX_OPEN_FDS=${GETCONF_MAX_FDS})
option(ENABLE_CLIENT_LOG "Enable logging messages" ON)
if (ENABLE_CLIENT_LOG)
add_definitions(-DGKFS_ENABLE_LOGGING)
endif ()
message(STATUS "[gekkofs] Client logging output: ${ENABLE_CLIENT_LOG}")
option(GKFS_ENABLE_FORWARDING "Enable forwarding mode" OFF)
option(GKFS_ENABLE_AGIOS "Enable AGIOS scheduling library" OFF)
if (GKFS_ENABLE_AGIOS)
find_package(AGIOS REQUIRED)
endif ()
set(CLIENT_LOG_MESSAGE_SIZE 1024 CACHE STRING "Maximum size of a log message in the client library")
add_definitions(-DLIBGKFS_LOG_MESSAGE_SIZE=${CLIENT_LOG_MESSAGE_SIZE})
message(STATUS "[gekkofs] Maximum log message size in the client library: ${CLIENT_LOG_MESSAGE_SIZE}")
mark_as_advanced(CLIENT_LOG_MESSAGE_SIZE)
option(GKFS_USE_GUIDED_DISTRIBUTION "Use guided data distributor " OFF)
message(STATUS "[gekkofs] Guided data distributor: ${GKFS_USE_GUIDED_DISTRIBUTION}")
set(GKFS_USE_GUIDED_DISTRIBUTION_PATH "/tmp/guided.txt" CACHE STRING "File Path for guided distributor")
set_property(CACHE GKFS_USE_GUIDED_DISTRIBUTION_PATH PROPERTY STRINGS)
message(STATUS "[gekkofs] Guided data distributor input file path: ${GKFS_USE_GUIDED_DISTRIBUTION_PATH}")
configure_file(include/common/cmake_configure.hpp.in include/common/cmake_configure.hpp)
# Imported target
add_library(RocksDB INTERFACE IMPORTED GLOBAL)
target_link_libraries(RocksDB
INTERFACE
${ROCKSDB_LIBRARIES}
# rocksdb libs
${LZ4_LIBRARIES}
)
if (${JeMalloc_FOUND})
target_link_libraries(RocksDB
INTERFACE
${JEMALLOC_LIBRARIES}
)
endif ()
# we cannot use target_include_directories with CMake < 3.11
set_target_properties(RocksDB
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${ROCKSDB_INCLUDE_DIRS}
)
add_library(spdlog INTERFACE)
# we cannot use target_include_directories with CMake < 3.11
set_target_properties(spdlog
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/external"
)
add_library(CLI11 INTERFACE)
# we cannot use target_include_directories with CMake < 3.11
set_target_properties(CLI11
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/external"
)
add_subdirectory(external/fmt)
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
if (ENABLE_CLIENT_LOG)
option(HERMES_LOGGING "" ON)
option(HERMES_LOGGING_FMT_USE_BUNDLED "" OFF)
option(HERMES_LOGGING_FMT_HEADER_ONLY "" OFF)
endif ()
option(HERMES_MARGO_COMPATIBLE_RPCS "" ON)
add_subdirectory(external/hermes)
target_compile_definitions(hermes INTERFACE)
set(INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
# define include directories that are relevant for all targets
include_directories(
${INCLUDE_DIR}
${CMAKE_BINARY_DIR}/include
)
# Common components
add_subdirectory(src/common)
# Daemon
add_subdirectory(src/daemon)
# Client library
add_subdirectory(src/client)
option(GKFS_BUILD_TESTS "Build GekkoFS self tests" OFF)
cmake_dependent_option(GKFS_INSTALL_TESTS "Install GekkoFS self tests" OFF "GKFS_BUILD_TESTS" OFF)
if (GKFS_BUILD_TESTS)
# Boost preprocessor header-only is supplied by the Mercury installation
find_package(Boost_preprocessor REQUIRED)
# check symbols exists doesn't work for statx. This is a workaround
check_cxx_source_compiles("
#include
#include
int main() {
struct statx buf;
statx(AT_FDCWD, \"/foo\", AT_EMPTY_PATH, STATX_BASIC_STATS, &buf);
return 0;
}
" GLIBC_HAS_STATX)
# STATX_TYPE must be set for c++17 for statx() to be found for tests
if (GLIBC_HAS_STATX)
add_definitions(-DSTATX_TYPE=1)
endif ()
message(STATUS "[gekkofs] Preparing tests...")
set(GKFS_TESTS_INTERFACE "lo" CACHE STRING "Network interface to use when running tests (default: lo)")
message(STATUS "[gekkofs] Network interface for tests: ${GKFS_TESTS_INTERFACE}")
message(STATUS "[gekkofs] Check for forwarding tests...")
if (GKFS_ENABLE_FORWARDING)
set(GKFS_TESTS_FORWARDING "ON" CACHE STRING "Enable I/O forwarding tests (default: OFF)")
else ()
set(GKFS_TESTS_FORWARDING "OFF" CACHE STRING "Enable I/O forwarding tests (default: OFF)")
endif ()
message(STATUS "[gekkofs] Forwarding tests: ${GKFS_TESTS_FORWARDING}")
add_subdirectory(tests)
add_subdirectory(examples/gfind)
else()
unset(GKFS_TESTS_INTERFACE CACHE)
endif()
gekkofs-uc3m_test/COPYING 0000664 0000000 0000000 00000104515 14172016224 0015453 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
gekkofs-uc3m_test/COPYING.LESSER 0000664 0000000 0000000 00000016744 14172016224 0016455 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
gekkofs-uc3m_test/README.md 0000664 0000000 0000000 00000030207 14172016224 0015673 0 ustar 00root root 0000000 0000000 # GekkoFS
[![License: GPL3](https://img.shields.io/badge/License-GPL3-blue.svg)](https://opensource.org/licenses/GPL-3.0)
[![pipeline status](https://storage.bsc.es/gitlab/hpc/gekkofs/badges/master/pipeline.svg)](https://storage.bsc.es/gitlab/hpc/gekkofs/commits/master)
[![coverage report](https://storage.bsc.es/gitlab/hpc/gekkofs/badges/master/coverage.svg)](https://storage.bsc.es/gitlab/hpc/gekkofs/-/commits/master)
GekkoFS is a file system capable of aggregating the local I/O capacity and performance of each compute node
in a HPC cluster to produce a high-performance storage space that can be accessed in a distributed manner.
This storage space allows HPC applications and simulations to run in isolation from each other with regards
to I/O, which reduces interferences and improves performance.
# Dependencies
- \>gcc-8 (including g++) for C++11 support
- General build tools: Git, Curl, CMake >3.6 (>3.11 for GekkoFS testing), Autoconf, Automake
- Miscellaneous: Libtool, Libconfig
### Debian/Ubuntu
GekkoFS base dependencies: `apt install git curl cmake autoconf automake libtool libconfig-dev`
GekkoFS testing support: `apt install python3-dev python3 python3-venv`
With testing
### CentOS/Red Hat
GekkoFS base dependencies: `yum install gcc-c++ git curl cmake autoconf automake libtool libconfig`
GekkoFS testing support: `python38-devel` (**>Python-3.6 required**)
# Step-by-step installation
1. Make sure the above listed dependencies are available on your machine
2. Clone GekkoFS: `git clone --recurse-submodules https://storage.bsc.es/gitlab/hpc/gekkofs.git`
3. Set up the necessary environment variables where the compiled direct GekkoFS dependencies will be installed at (we assume the path `/home/foo/gekkofs_deps/install` in the following)
- `export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/foo/gekkofs_deps/install/lib:/home/foo/gekkofs_deps/install/lib64`
4. Download and compile the direct dependencies, e.g.,
- Download example: `gekkofs/scripts/dl_dep.sh /home/foo/gekkofs_deps/git`
- Compilation example: `gekkofs/scripts/compile_dep.sh /home/foo/gekkofs_deps/git /home/foo/gekkofs_deps/install`
- Consult `-h` for additional arguments for each script
5. Compile GekkoFS and run optional tests
- Create build directory: `mkdir gekkofs/build && cd gekkofs/build`
- Configure GekkoFS: `cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/foo/gekkofs_deps/install ..`
- add `-DCMAKE_INSTALL_PREFIX=` where the GekkoFS client library and server executable should be available
- add `-DGKFS_BUILD_TESTS=ON` if tests should be build
- Build and install GekkoFS: `make -j8 install`
- Run tests: `make test`
GekkoFS is now available at:
- GekkoFS daemon (server): `/bin/gkfs_daemon`
- GekkoFS client interception library: `/lib64/libgkfs_intercept.so`
# Run GekkoFS
## General
On each node a daemon (`gkfs_daemon` binary) has to be started. Other tools can be used to execute
the binary on many nodes, e.g., `srun`, `mpiexec/mpirun`, `pdsh`, or `pssh`.
You need to decide what Mercury NA plugin you want to use for network communication. `ofi+sockets` is the default.
The `-P` argument is used for setting another RPC protocol. See below.
- `ofi+sockets` for using the libfabric plugin with TCP (stable)
- `ofi+tcp` for using the libfabric plugin with TCP (slower than sockets)
- `ofi+verbs` for using the libfabric plugin with Infiniband verbs (reasonably stable)
- `ofi+psm2` for using the libfabric plugin with Intel Omni-Path (unstable)
## The GekkoFS hostsfile
Each GekkoFS daemon needs to register itself in a shared file (*hostsfile*) which needs to be accessible to _all_ GekkoFS clients and daemons.
Therefore, the hostsfile describes a file system and which node is part of that specific GekkoFS file system instance.
In a typical cluster environment this hostsfile should be placed within a POSIX-compliant parallel file system, such as GPFS or Lustre.
*Note: NFS is not strongly consistent and cannot be used for the hosts file!*
## GekkoFS daemon start and shut down
tl;dr example: `/bin/gkfs_daemon -r -m -H `
Run the GekkoFS daemon on each node specifying its locally used directory where the file system data and metadata is stored (`-r/--rootdir `), e.g., the node-local SSD;
2. the pseudo mount directory used by clients to access GekkoFS (`-m/--mountdir `); and
3. the hostsfile path (`-H/--hostsfile `).
Further options are available:
```bash
Allowed options
Usage: bin/gkfs_daemon [OPTIONS]
Options:
-h,--help Print this help message and exit
-m,--mountdir TEXT REQUIRED Virtual mounting directory where GekkoFS is available.
-r,--rootdir TEXT REQUIRED Local data directory where GekkoFS data for this daemon is stored.
-i,--metadir TEXT Metadata directory where GekkoFS RocksDB data directory is located. If not set, rootdir is used.
-l,--listen TEXT Address or interface to bind the daemon to. Default: local hostname.
When used with ofi+verbs the FI_VERBS_IFACE environment variable is set accordingly which associates the verbs device with the network interface. In case FI_VERBS_IFACE is already defined, the argument is ignored. Default 'ib'.
-H,--hosts-file TEXT Shared file used by deamons to register their endpoints. (default './gkfs_hosts.txt')
-P,--rpc-protocol TEXT Used RPC protocol for inter-node communication.
Available: {ofi+sockets, ofi+verbs, ofi+psm2} for TCP, Infiniband, and Omni-Path, respectively. (Default ofi+sockets)
Libfabric must have enabled support verbs or psm2.
--auto-sm Enables intra-node communication (IPCs) via the `na+sm` (shared memory) protocol, instead of using the RPC protocol. (Default off)
--clean-rootdir Cleans Rootdir >before< launching the deamon
--version Print version and exit.
```
Shut it down by gracefully killing the process (SIGTERM).
## Use the GekkoFS client library
tl;dr example:
```bash
export LIBGKFS_ HOSTS_FILE=
LD_PRELOAD=/lib64/libgkfs_intercept.so cp ~/some_input_data /some_input_data
LD_PRELOAD=/lib64/libgkfs_intercept.so md5sum ~/some_input_data /some_input_data
```
Clients read the hostsfile to determine which daemons are part of the GekkoFS instance.
Because the client is an interposition library that is loaded within the context of the application, this information is passed via the environment variable `LIBGKFS_HOSTS_FILE` pointing to the hostsfile path.
The client library itself is loaded for each application process via the `LD_PRELOAD` environment variable intercepting file system related calls.
If they are within (or hierarchically under) the GekkoFS mount directory they are processed in the library, otherwise they are passed to the kernel.
Note, if `LD_PRELOAD` is not pointing to the library and, hence the client is not loaded, the mounting directory appear to be empty.
For MPI application, the `LD_PRELOAD` variable can be passed with the `-x` argument for `mpirun/mpiexec`.
### Logging
The following environment variables can be used to enable logging in the client
library: `LIBGKFS_LOG=` and `LIBGKFS_LOG_OUTPUT=` to
configure the output module and set the path to the log file of the client
library. If not path is specified in `LIBGKFS_LOG_OUTPUT`, the client library
will send log messages to `/tmp/gkfs_client.log`.
The following modules are available:
- `none`: don't print any messages
- `syscalls`: Trace system calls: print the name of each system call, its
arguments, and its return value. All system calls are printed after being
executed save for those that may not return, such as `execve()`,
`execve_at()`, `exit()`, and `exit_group()`. This module will only be
available if the client library is built in `Debug` mode.
- `syscalls_at_entry`: Trace system calls: print the name of each system call
and its arguments. All system calls are printed before being executed and
therefore their return values are not available in the log. This module will
only be available if the client library is built in `Debug` mode.
- `info`: Print information messages.
- `critical`: Print critical errors.
- `errors`: Print errors.
- `warnings`: Print warnings.
- `mercury`: Print Mercury messages.
- `debug`: Print debug messages. This module will only be available if the
client library is built in `Debug` mode.
- `most`: All previous options combined except `syscalls_at_entry`. This
module will only be available if the client library is built in `Debug`
mode.
- `all`: All previous options combined.
- `trace_reads`: Generate log line with extra information in read operations for guided distributor
- `help`: Print a help message and exit.
When tracing sytem calls, specific syscalls can be removed from log messages by
setting the `LIBGKFS_LOG_SYSCALL_FILTER` environment variable. For instance,
setting it to `LIBGKFS_LOG_SYSCALL_FILTER=epoll_wait,epoll_create` will filter
out any log entries from the `epoll_wait()` and `epoll_create()` system calls.
Additionally, setting the `LIBGKFS_LOG_OUTPUT_TRUNC` environment variable with
a value different from `0` will instruct the logging subsystem to truncate
the file used for logging, rather than append to it.
For the daemon, the `GKFS_DAEMON_LOG_PATH=` environment variable
can be provided to set the path to the log file, and the log module can be
selected with the `GKFS_LOG_LEVEL={off,critical,err,warn,info,debug,trace}`
environment variable.
# Miscellaneous
## External functions
GekkoFS allows to use external functions on your client code, via LD_PRELOAD.
Source code needs to be compiled with -fPIC. We include a pfind io500 substitution,
`examples/gfind/gfind.cpp` and a non-mpi version `examples/gfind/sfind.cpp`
## Data distributors
The data distribution can be selected at compilation time, we have 2 distributors available:
### Simple Hash (Default)
Chunks are distributed randomly to the different GekkoFS servers.
### Guided Distributor
Guided distributor distributes chunks using a shared file with the next format:
` `
Moreover, when a path is prepended with `#` (e.g., `#/mdt-hard 0 0`) , all the data from that path goes to the same place as the metadata.
Specifically, defined paths (without `#`) are the priority.
When using `#`, GekkoFS stores data and metadata on the same server. The server will still be random (0 0 has no meaning, yet).
Chunks not specified, are distributed using the Simple Hash distributor.
To generate such file we need to follow a first execution, using the trace_reads log option
This will enable a `TRACE_READS` level log at the clients offering several lines that can be used to generate the input file.
In this stage, each node should generate a separated file this can be done in SLURM using the next line :
`srun -N 10 -n 320 --export="ALL" /bin/bash -c "export LIBGKFS_LOG_OUTPUT=${HOME}/test/GLOBAL.txt;LD_PRELOAD=${GKFS_PRLD} "`
Then, use the `examples/distributors/guided/generate.py` to create the output file.
* `python examples/distributors/guided/generate.py ~/test/GLOBAL.txt >> guided.txt`
This should work if the nodes are sorted in alphabetical order, which is the usual scenario. Users should take care of multi-server configurations.
Finally, enable the distributor using the next compilation flags:
* `GKFS_USE_GUIDED_DISTRIBUTION` ON
* `GKFS_USE_GUIDED_DISTRIBUTION_PATH` ``
### Acknowledgment
This software was partially supported by the EC H2020 funded NEXTGenIO project (Project ID: 671951, www.nextgenio.eu).
This software was partially supported by the ADA-FS project under the SPPEXA project (http://www.sppexa.de/) funded by the DFG.
This software is partially supported by the FIDIUM project funded by the DFG.
This software is partially supported by the ADMIRE project (https://www.admire-eurohpc.eu/) funded by the European Union’s Horizon 2020 JTI-EuroHPC Research and Innovation Programme (Grant 956748). gekkofs-uc3m_test/config/ 0000775 0000000 0000000 00000000000 14172016224 0015657 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/config/GekkoFWD/ 0000775 0000000 0000000 00000000000 14172016224 0017260 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/config/GekkoFWD/agios/ 0000775 0000000 0000000 00000000000 14172016224 0020362 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/config/GekkoFWD/agios/access_times.func 0000664 0000000 0000000 00000000241 14172016224 0023676 0 ustar 00root root 0000000 0000000 2
8 64
566.8405 6784.471
238.2483 1173.456
145.6056 1018.143
187.2437 -201.8793
64 128
571.2364 -740.0433
234.6933 41.99119
218.3765 -6295.179
113.1743 2235.442
gekkofs-uc3m_test/config/GekkoFWD/agios/agios.conf 0000664 0000000 0000000 00000016077 14172016224 0022346 0 ustar 00root root 0000000 0000000 library_options:
{ #ATTENTION: with my most recent modification on statistics, the prediction module is NOT WORKING, DO NOT USE IT.
#should we generate trace files during execution?
trace = false ;
#should we trace predicted requests? (for debug purposes, this trace will not be useful for future executions)
trace_predict = false ;
#should we make a complete trace, with all scheduler's operations, such as waiting times? (for debug purposes)
trace_full = false ;
#should the prediction module read trace files? (if false, the Prediction Module is useless)
predict_read_traces = false ;
#should the prediction module try to predict aggregations? (requires predict_read_traces = true)
predict_request_aggregation = false ;
#should the prediction module create simplified traces with information (the metrics) it obtained from the real traces?
predict_write_simplified_traces = false;
#the tolerance for arrival times difference when checking if two predicted requests are the same (in %)
prediction_time_error = 10
#this parameter gives the frequency with which the prediction module will redo its predicted aggregations (in number of requests that must be processed between refreshs). This is necessary because these predictions use a factor that represents the ability to overlap waiting times with processing of other requests. At initialization, this factor will be calculated from the provided trace files, but during execution it can be recalculated using measurements for this ability during the actual scheduling. If the parameter is set to -1, aggregations will not be recalculated during execution. (in number of requests)
prediction_recalculate_alpha_period = -1
#prefix and sufix for trace files (with path). Their names must be trace_file_prefix+"."+number+"."+trace_file_sufix, with ordered numbers (no holes)
trace_file_prefix = "/tmp/agios_tracefile"
trace_file_sufix = "out"
#prefix for simple trace files (with path). Their names will be prefix+"."+number+"."+trace_file_sufix
simple_trace_prefix = "/tmp/agios_simpletracefile"
#parameters used by aIOLi and MLF
waiting_time = 900000
aioli_quantum = 65536
mlf_quantum = 8192
#parameter used by TW (ms)
time_window_size = 1000 #the paper proposing TW recommends 1000 for HDD and 250 for SSD.
#file (with path) with access times functions (generated by SeRRa - http://serratoool.bitbucket.org/). Used by aIOLi to quantum assignment and by the mechanism that automatically selects the best scheduling algorithm to use. If you are using a static algorithm which is not aIOLi, this does not matter, but you need to provide it anyway. In this case, you can use the one provided as example with the library source code
access_times_func_file = "/tmp/access_times.func"
#to how many scheduling algorithms the performance module keeps measurements. When we are changing scheduling algorithms, we may observe new measurements (through the agios_release_request function) to the previous algorithms, so we could update information we have for them. It makes no sense to have a big value for performance_values if we don't change algorithms too often
performance_values = 5
#how many scheduling algorithms changes we register in the stats file?
proc_algs = 1000
#default I/O scheduling algorithm to use (the one to be used if the previous value was set to false)
#existing algorithms (case sensitive): "MLF", "aIOLi", "SJF", "TO", "TO-agg", "SRTF", "TW", "NOOP", "DYN_TREE", "ARMED_BANDIT" (case sensitive)
# SRTF it's experimental and uses information from trace files (don't use it if these are not available)
# NOOP is the NO operation scheduling algorithm, you should not observe performance improvements by using this one
# TW only makes sense if the user is providing AGIOS correct application id for each request. Don't use it otherwise
# DYN_TREE is a dynamic scheduling algorithm which selects the best (among MLF, AIOLI, SFJ, TO, TO-AGG, and NOOP) according to a decision tree. Use it only when using AGIOS to schedule requests to parallel file system' servers.
# ARMED_BANDIT is another dynamic algorithm which periodically selects between MLF, aIOLi, SJF, TO, TO-agg, and NOOP. It keeps performance measurements for these algorithms and gives more probability to the better ones.
default_algorithm = "TO";
# TWINS window size, in us
twins_window_duration = 1000;
dynamic_twins = false;
# time between window size adaptation, in ms
dynamic_twins_period = 1000;
dynamic_twins_clients = 32;
dynamic_twins_processes = 128;
# Only relevant if default_algorithm is a dynamic one. this parameter gives the frequency with which the automatic scheduling algorithm selection will recalculate the scheduling algorithm. This selection will be done using the access pattern from this period. If -1 is provided, then the selection will be done at the beginning of execution only (using information from traces for DYN_TREE). The next parameter gives the minimum number of requests which need to happen in this period for the selection to be done (otherwise we will wait longer before recalculating). (in msec). Notice that it makes no sense to use ARMED_BANDIT without setting period and min_reqnumber, as it needs to be iteractive.
select_algorithm_period = 1000
select_algorithm_min_reqnumber=1
#also for dynamic algorithms. says if TW should be one of the options considered by the dynamic scheduler. TW requires identifying requests according to the applications they come from. If this is not possible, don't use TW!
enable_TW = false ;
#if default_algorithm is a dynamic algorithm, you need to indicate which static algorithm to use at first (before automatically selecting the next one). Only relevant if you are using ARMED_BANDIT
starting_algorithm = "SJF" ;
# ARMED_BANDIT parameters - only relevant if default_algorithm is ARMED_BANDIT, but need to be provided anyway. min_ab_probability gives the minimum probability given to scheduling algorithms which performed poorly. The algorithm needs to maintain some probability to accomodate changes in the access pattern. validity_window is the period of time (in msec) for which performance measurements are still valid, after this time period we discard them (so we adapt to new situations). performance_window determines how many performance measurements the ARMED_BANDIT algorithms keeps for each scheduling algorithm option (taking the average of them). Keeping a huge window takes more memory. Moreover, it is related with validity_window and select_algorithm_period as if we discard measurements too often, we will never fill the whole window.
min_ab_probability = 3
validity_window = 360000
performance_window = 10
};
user_info:
{
#stripe size used by the library's users (in bytes). This is used for detecting the access pattern at a parallel file system server. Useless for other uses.
stripe_size = 32768 ;
#maximum buffer size used for storing trace parts (in KB). Having a buffer avoids generating requests to the local file system, which interfere in performance. On the other hand, having a large buffer can affect performance and decrease available space for data buffer.
max_trace_buffer_size = 32768 ;
};
gekkofs-uc3m_test/docker/ 0000775 0000000 0000000 00000000000 14172016224 0015661 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.8.0/ 0000775 0000000 0000000 00000000000 14172016224 0016324 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.8.0/core/ 0000775 0000000 0000000 00000000000 14172016224 0017254 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.8.0/core/Dockerfile 0000664 0000000 0000000 00000002164 14172016224 0021251 0 ustar 00root root 0000000 0000000 FROM debian:buster-slim
LABEL Description="Debian-based environment suitable to build GekkoFS and its dependencies"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
libtool \
pkg-config \
make \
automake \
gcc \
g++ \
# AGIOS dependencies
libconfig-dev \
# Mercury dependencies
libltdl-dev \
lbzip2 \
# RocksDB dependencies
libsnappy-dev \
liblz4-dev \
libzstd-dev \
libbz2-dev \
zlib1g-dev \
# syscall_intercept dependencies
libcapstone-dev \
# GekkoFS dependencies
libboost-filesystem-dev \
libboost-program-options-dev \
uuid-dev && \
# install cmake 3.14 since it's needed for some dependencies
curl -OL https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5-Linux-x86_64.sh && \
chmod u+x ./cmake-3.14.5-Linux-x86_64.sh && \
./cmake-3.14.5-Linux-x86_64.sh --skip-license --prefix=/usr && \
# Clean apt cache to reduce image layer size
rm -rf /var/lib/apt/lists/* && \
# Clean apt caches of packages
apt-get clean && apt-get autoclean && \
rm ./cmake-3.14.5-Linux-x86_64.sh
gekkofs-uc3m_test/docker/0.8.0/core/Makefile 0000664 0000000 0000000 00000000070 14172016224 0020711 0 ustar 00root root 0000000 0000000 .PHONY: all
all:
docker build -t gekkofs/core:0.8.0 .
gekkofs-uc3m_test/docker/0.8.0/coverage/ 0000775 0000000 0000000 00000000000 14172016224 0020117 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.8.0/coverage/Dockerfile 0000664 0000000 0000000 00000000747 14172016224 0022121 0 ustar 00root root 0000000 0000000 FROM debian:buster-slim
LABEL Description="Environment to generate coverage reports in GekkoFS"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
git \
cmake \
gcc \
g++ \
lcov \
python3 \
python3-pip \
python3-setuptools && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
apt-get autoclean && \
python3 -m pip install --upgrade pip && \
pip3 install gcovr
gekkofs-uc3m_test/docker/0.8.0/coverage/Makefile 0000664 0000000 0000000 00000000074 14172016224 0021560 0 ustar 00root root 0000000 0000000 .PHONY: all
all:
docker build -t gekkofs/coverage:0.8.0 .
gekkofs-uc3m_test/docker/0.8.0/deps/ 0000775 0000000 0000000 00000000000 14172016224 0017257 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.8.0/deps/Dockerfile 0000664 0000000 0000000 00000002035 14172016224 0021251 0 ustar 00root root 0000000 0000000 FROM gekkofs/core:0.8.0
LABEL Description="Debian-based environment to build GekkoFS"
ENV GKFS_PATH /opt/gkfs
ENV GKFS_VERSION 0.8.0
ENV SCRIPTS_PATH ${GKFS_PATH}/scripts
ENV DEPS_SRC_PATH ${GKFS_PATH}/deps_src
ENV INSTALL_PATH /usr/local
COPY scripts/dl_dep.sh ${SCRIPTS_PATH}/
COPY scripts/compile_dep.sh ${SCRIPTS_PATH}/
COPY scripts/patches ${SCRIPTS_PATH}/patches
COPY scripts/profiles ${SCRIPTS_PATH}/profiles
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev \
python3-venv \
python3-setuptools && \
python3 -m pip install --upgrade pip && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && apt-get autoclean
# Download and build dependencies
RUN cd ${SCRIPTS_PATH} && \
/bin/bash ./dl_dep.sh -p ci:${GKFS_VERSION} ${DEPS_SRC_PATH} && \
/bin/bash ./compile_dep.sh -j 8 -p ci:${GKFS_VERSION} ${DEPS_SRC_PATH} ${INSTALL_PATH} && \
rm -rf ${DEPS_SRC_PATH} && \
rm -rf ${SCRIPTS_PATH} && \
rmdir ${GKFS_PATH} && \
ldconfig
gekkofs-uc3m_test/docker/0.8.0/deps/Makefile 0000664 0000000 0000000 00000000564 14172016224 0020724 0 ustar 00root root 0000000 0000000 CWD:=$(shell pwd)
GIT_ROOT:=$(shell git rev-parse --show-toplevel)
.PHONY: all build mount-scripts umount-scripts
all: build mount-scripts umount-scripts
mount-scripts:
mkdir -p $(CWD)/scripts
mount --bind $(GIT_ROOT)/scripts $(CWD)/scripts
build: mount-scripts
docker build -t gekkofs/deps:0.8.0 .
umount-scripts:
- umount $(CWD)/scripts
- rmdir $(CWD)/scripts
gekkofs-uc3m_test/docker/0.8.0/linter/ 0000775 0000000 0000000 00000000000 14172016224 0017621 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.8.0/linter/Dockerfile 0000664 0000000 0000000 00000001275 14172016224 0021620 0 ustar 00root root 0000000 0000000 FROM gekkofs/core:0.8.0
LABEL Description="Debian-based environment to check the formatting of GekkoFS code"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
# clang 10 deps for clang-format
lsb-release \
wget \
software-properties-common \
gnupg2 && \
# add clang-10 repos
wget https://apt.llvm.org/llvm.sh -P /tmp && chmod +x /tmp/llvm.sh && /tmp/llvm.sh 10 && \
# install clang-format
apt-get update && apt-get install -y --no-install-recommends clang-format-10 && \
# Clean apt cache to reduce image layer size
rm -rf /var/lib/apt/lists/* && rm /tmp/llvm.sh && \
# Clean apt caches of packages
apt-get clean && apt-get autoclean
gekkofs-uc3m_test/docker/0.8.0/linter/Makefile 0000664 0000000 0000000 00000000072 14172016224 0021260 0 ustar 00root root 0000000 0000000 .PHONY: all
all:
docker build -t gekkofs/linter:0.8.0 .
gekkofs-uc3m_test/docker/0.8.0/testing/ 0000775 0000000 0000000 00000000000 14172016224 0020001 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.8.0/testing/Dockerfile 0000664 0000000 0000000 00000001043 14172016224 0021771 0 ustar 00root root 0000000 0000000 FROM gekkofs/deps:0.8.0
LABEL Description="Debian-based environment to test GekkoFS"
RUN \
# install cmake 3.21 since we need to produce JUnit XML files
curl -OL https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.sh && \
chmod u+x ./cmake-3.21.1-linux-x86_64.sh && \
./cmake-3.21.1-linux-x86_64.sh --skip-license --prefix=/usr && \
# install gcovr
# (required for partial coverage reports in parallel runs)
pip3 install gcovr && \
# cleanup
rm ./cmake-3.21.1-linux-x86_64.sh
gekkofs-uc3m_test/docker/0.8.0/testing/Makefile 0000664 0000000 0000000 00000000073 14172016224 0021441 0 ustar 00root root 0000000 0000000 .PHONY: all
all:
docker build -t gekkofs/testing:0.8.0 .
gekkofs-uc3m_test/docker/0.9.0/ 0000775 0000000 0000000 00000000000 14172016224 0016325 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.9.0/core/ 0000775 0000000 0000000 00000000000 14172016224 0017255 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.9.0/core/Dockerfile 0000664 0000000 0000000 00000002121 14172016224 0021243 0 ustar 00root root 0000000 0000000 FROM debian:bullseye-slim
LABEL Description="Debian-based environment suitable to build GekkoFS and its dependencies"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
libtool \
pkg-config \
make \
automake \
gcc \
g++ \
# AGIOS dependencies
libconfig-dev \
# Mercury dependencies
libltdl-dev \
lbzip2 \
# Margo dependencies \
libjson-c-dev \
# RocksDB dependencies
liblz4-dev \
# syscall_intercept dependencies
libcapstone-dev \
# GekkoFS dependencies
libboost-program-options-dev \
uuid-dev && \
# install cmake 3.14 since it's needed for some dependencies
curl -OL https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5-Linux-x86_64.sh && \
chmod u+x ./cmake-3.14.5-Linux-x86_64.sh && \
./cmake-3.14.5-Linux-x86_64.sh --skip-license --prefix=/usr && \
# Clean apt cache to reduce image layer size
rm -rf /var/lib/apt/lists/* && \
# Clean apt caches of packages
apt-get clean && apt-get autoclean && \
rm ./cmake-3.14.5-Linux-x86_64.sh
gekkofs-uc3m_test/docker/0.9.0/core/Makefile 0000664 0000000 0000000 00000000272 14172016224 0020716 0 ustar 00root root 0000000 0000000 .PHONY: all
amd64:
docker build --platform amd64 -t gekkofs/core:0.9.0 .
aarch64:
docker build --platform aarch64 -t gekkofs/core:0.9.0 .
all:
docker build -t gekkofs/core:0.9.0 .
gekkofs-uc3m_test/docker/0.9.0/coverage/ 0000775 0000000 0000000 00000000000 14172016224 0020120 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.9.0/coverage/Dockerfile 0000664 0000000 0000000 00000000751 14172016224 0022115 0 ustar 00root root 0000000 0000000 FROM debian:bullseye-slim
LABEL Description="Environment to generate coverage reports in GekkoFS"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
git \
cmake \
gcc \
g++ \
lcov \
python3 \
python3-pip \
python3-setuptools && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
apt-get autoclean && \
python3 -m pip install --upgrade pip && \
pip3 install gcovr
gekkofs-uc3m_test/docker/0.9.0/coverage/Makefile 0000664 0000000 0000000 00000000305 14172016224 0021556 0 ustar 00root root 0000000 0000000 .PHONY: all
amd64:
docker build --platform amd64 -t gekkofs/coverage:0.9.0 .
aarch64:
docker build --platform aarch64 -t gekkofs/coverage:0.9.0 .
all:
docker build -t gekkofs/coverage:0.9.0 . gekkofs-uc3m_test/docker/0.9.0/deps/ 0000775 0000000 0000000 00000000000 14172016224 0017260 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.9.0/deps/Dockerfile 0000664 0000000 0000000 00000002035 14172016224 0021252 0 ustar 00root root 0000000 0000000 FROM gekkofs/core:0.9.0
LABEL Description="Debian-based environment to build GekkoFS"
ENV GKFS_PATH /opt/gkfs
ENV GKFS_VERSION 0.9.0
ENV SCRIPTS_PATH ${GKFS_PATH}/scripts
ENV DEPS_SRC_PATH ${GKFS_PATH}/deps_src
ENV INSTALL_PATH /usr/local
COPY scripts/dl_dep.sh ${SCRIPTS_PATH}/
COPY scripts/compile_dep.sh ${SCRIPTS_PATH}/
COPY scripts/patches ${SCRIPTS_PATH}/patches
COPY scripts/profiles ${SCRIPTS_PATH}/profiles
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev \
python3-venv \
python3-setuptools && \
python3 -m pip install --upgrade pip && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && apt-get autoclean
# Download and build dependencies
RUN cd ${SCRIPTS_PATH} && \
/bin/bash ./dl_dep.sh -p ci:${GKFS_VERSION} ${DEPS_SRC_PATH} && \
/bin/bash ./compile_dep.sh -j 8 -p ci:${GKFS_VERSION} ${DEPS_SRC_PATH} ${INSTALL_PATH} && \
rm -rf ${DEPS_SRC_PATH} && \
rm -rf ${SCRIPTS_PATH} && \
rmdir ${GKFS_PATH} && \
ldconfig
gekkofs-uc3m_test/docker/0.9.0/deps/Makefile 0000664 0000000 0000000 00000001106 14172016224 0020716 0 ustar 00root root 0000000 0000000 CWD:=$(shell pwd)
GIT_ROOT:=$(shell git rev-parse --show-toplevel)
.PHONY: all build mount-scripts umount-scripts
all: build mount-scripts remove-scripts
amd64: build-amd64 mount-scripts remove-scripts
aarch64: build-aarch64 mount-scripts remove-scripts
copy-scripts:
cp -R $(GIT_ROOT)/scripts $(CWD)/scripts
build: copy-scripts
docker build -t gekkofs/deps:0.9.0 .
build-amd64: copy-scripts
docker build --platform amd64 -t gekkofs/deps:0.9.0 .
build-aarch64: copy-scripts
docker build --platform aarch64 -t gekkofs/deps:0.9.0 .
remove-scripts:
- rm -rf $(CWD)/scripts
gekkofs-uc3m_test/docker/0.9.0/linter/ 0000775 0000000 0000000 00000000000 14172016224 0017622 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.9.0/linter/Dockerfile 0000664 0000000 0000000 00000001275 14172016224 0021621 0 ustar 00root root 0000000 0000000 FROM gekkofs/core:0.9.0
LABEL Description="Debian-based environment to check the formatting of GekkoFS code"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
# clang 10 deps for clang-format
lsb-release \
wget \
software-properties-common \
gnupg2 && \
# add clang-10 repos
wget https://apt.llvm.org/llvm.sh -P /tmp && chmod +x /tmp/llvm.sh && /tmp/llvm.sh 11 && \
# install clang-format
apt-get update && apt-get install -y --no-install-recommends clang-format-11 && \
# Clean apt cache to reduce image layer size
rm -rf /var/lib/apt/lists/* && rm /tmp/llvm.sh && \
# Clean apt caches of packages
apt-get clean && apt-get autoclean
gekkofs-uc3m_test/docker/0.9.0/linter/Makefile 0000664 0000000 0000000 00000000300 14172016224 0021253 0 ustar 00root root 0000000 0000000 .PHONY: all
amd64:
docker build --platform amd64 -t gekkofs/linter:0.9.0 .
aarch64:
docker build --platform aarch64 -t gekkofs/linter:0.9.0 .
all:
docker build -t gekkofs/linter:0.9.0 .
gekkofs-uc3m_test/docker/0.9.0/testing/ 0000775 0000000 0000000 00000000000 14172016224 0020002 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/docker/0.9.0/testing/Dockerfile 0000664 0000000 0000000 00000001043 14172016224 0021772 0 ustar 00root root 0000000 0000000 FROM gekkofs/deps:0.9.0
LABEL Description="Debian-based environment to test GekkoFS"
RUN \
# install cmake 3.21 since we need to produce JUnit XML files
curl -OL https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.sh && \
chmod u+x ./cmake-3.21.1-linux-x86_64.sh && \
./cmake-3.21.1-linux-x86_64.sh --skip-license --prefix=/usr && \
# install gcovr
# (required for partial coverage reports in parallel runs)
pip3 install gcovr && \
# cleanup
rm ./cmake-3.21.1-linux-x86_64.sh
gekkofs-uc3m_test/docker/0.9.0/testing/Makefile 0000664 0000000 0000000 00000000302 14172016224 0021435 0 ustar 00root root 0000000 0000000 .PHONY: all
amd64:
docker build --platform amd64 -t gekkofs/testing:0.9.0 .
aarch64:
docker build --platform aarch64 -t gekkofs/testing:0.9.0 .
all:
docker build -t gekkofs/testing:0.9.0 . gekkofs-uc3m_test/docker/build_env.docker 0000664 0000000 0000000 00000004177 14172016224 0021032 0 ustar 00root root 0000000 0000000 FROM centos:7 as builder
ENV GKFS_PATH /opt/gkfs
ENV SCRIPTS_PATH ${GKFS_PATH}/scripts
ENV DEPS_SRC_PATH ${GKFS_PATH}/deps_src
ENV INSTALL_PATH ${GKFS_PATH}/build_deps
# Enable epel and scl repository
RUN yum -y -q update && yum -y -q install \
epel-release \
centos-release-scl \
&& yum -y -q clean all
# Install compile script dependencies
RUN yum -y -q update && yum -y -q install \
git \
wget \
make \
automake \
cmake \
cmake3 \
gcc \
gcc-c++ \
openssl-devel \
libconfig-devel \
# Mercury dependencies
libtool \
libtool-ltdl-devel \
boost-devel \
# RocksDB
which \
snappy-devel \
libzstd-devel \
lz4-devel \
bzip2 \
bzip2-devel \
# ada-fs requires C++ 14
devtoolset-8-gcc \
devtoolset-8-gcc-c++ \
libuuid-devel \
# syscall_intercept
capstone \
capstone-devel \
&& yum -y -q clean all
# Enable gcc/g++ 8.x
ENV CC "/opt/rh/devtoolset-8/root/usr/bin/gcc"
ENV CXX "/opt/rh/devtoolset-8/root/usr/bin/g++"
# Download dependencies source
COPY scripts/dl_dep.sh $SCRIPTS_PATH/
RUN /bin/bash $SCRIPTS_PATH/dl_dep.sh $DEPS_SRC_PATH all
# Compile dependencies
COPY scripts/compile_dep.sh $SCRIPTS_PATH/
COPY scripts/patches $SCRIPTS_PATH/patches
RUN /bin/bash $SCRIPTS_PATH/compile_dep.sh $DEPS_SRC_PATH $INSTALL_PATH
FROM centos:7
ENV GKFS_PATH /opt/gkfs
ENV INSTALL_PATH ${GKFS_PATH}/build_deps
# Enable epel and scl repository
RUN yum -y -q update && yum -y -q install \
epel-release \
centos-release-scl \
&& yum -y -q clean all
# Install compile script dependencies
RUN yum -y -q update && yum -y -q install \
git \
wget \
make \
automake \
cmake \
cmake3 \
gcc \
gcc-c++ \
openssl-devel \
libconfig-devel \
# Mercury dependencies
libtool \
libtool-ltdl-devel \
boost-devel \
# RocksDB
which \
snappy-devel \
libzstd-devel \
lz4-devel \
bzip2 \
bzip2-devel \
# ada-fs requires C++ 14
devtoolset-8-gcc \
devtoolset-8-gcc-c++ \
libuuid-devel \
# syscall_intercept
capstone \
capstone-devel \
&& yum -y -q clean all
# Enable gcc/g++ 8.x
ENV CC "/opt/rh/devtoolset-8/root/usr/bin/gcc"
ENV CXX "/opt/rh/devtoolset-8/root/usr/bin/g++"
COPY --from=builder ${INSTALL_PATH} ${INSTALL_PATH}
gekkofs-uc3m_test/docker/latest 0000777 0000000 0000000 00000000000 14172016224 0017461 20.8.0 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/examples/ 0000775 0000000 0000000 00000000000 14172016224 0016230 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/examples/distributors/ 0000775 0000000 0000000 00000000000 14172016224 0020765 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/examples/distributors/guided/ 0000775 0000000 0000000 00000000000 14172016224 0022226 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/examples/distributors/guided/generate.py 0000664 0000000 0000000 00000002075 14172016224 0024376 0 ustar 00root root 0000000 0000000 ###
# Copyright 2018-2020, Barcelona Supercomputing Center (BSC), Spain
# Copyright 2015-2020, Johannes Gutenberg Universitaet Mainz, Germany
# This software was partially supported by the
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).
# This software was partially supported by the
# ADA-FS project under the SPPEXA project funded by the DFG.
# SPDX-License-Identifier: MIT
###
#!/usr/bin/python3
import re
import sys
import collections
file = sys.argv[1]
pattern = re.compile(r".+(read\ )(.*)( host: )(\d+).+(path: )(.+),.+(chunk_start: )(\d+).+(chunk_end: )(\d+)")
d = collections.OrderedDict()
with open(file) as f:
for line in f:
result = pattern.match(line)
if result:
d[result.group(2)] = 1
keys = sorted(d.keys())
i = 0
for key in keys:
d[key] = i
i = i + 1
with open(file) as f:
for line in f:
result = pattern.match(line)
if result:
for i in range(int(result.group(8)), int(result.group(10))+1):
print (result.group(6), i, d[result.group(2)])
gekkofs-uc3m_test/examples/gfind/ 0000775 0000000 0000000 00000000000 14172016224 0017317 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/examples/gfind/CMakeLists.txt 0000664 0000000 0000000 00000004465 14172016224 0022070 0 ustar 00root root 0000000 0000000 ################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
set (CMAKE_CXX_STANDARD 14)
add_executable(sfind sfind.cpp)
if(GKFS_INSTALL_TESTS)
install(TARGETS sfind
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
gekkofs-uc3m_test/examples/gfind/gfind.cpp 0000664 0000000 0000000 00000036575 14172016224 0021132 0 ustar 00root root 0000000 0000000 /*
Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain
Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany
This software was partially supported by the
EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).
This software was partially supported by the
ADA-FS project under the SPPEXA project funded by the DFG.
This file is part of GekkoFS.
GekkoFS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GekkoFS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GekkoFS. If not, see .
SPDX-License-Identifier: GPL-3.0-or-later
*/
/* Based on pfind from ior500 */
/* https://github.com/VI4IO/pfind/ */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
/* Minimal struct needed for io500 find */
/* We could also do the filtering on the server */
struct dirent_extended {
size_t size;
time_t ctime;
unsigned short d_reclen;
unsigned char d_type;
char d_name[1];
};
/* Function exported from GekkoFS LD_PRELOAD, code needs to be compiled with
* -fPIC, if not will segfault */
extern "C" int gkfs_getsingleserverdir(const char *path,
struct dirent_extended *dirp,
unsigned int count, int server)
__attribute__((weak));
/* PFIND OPTIONS EXTENDED We need to add the GekkoFS mount dir and the number of
* servers */
typedef struct {
std::string workdir{};
int just_count;
int print_by_process;
char *results_dir;
int stonewall_timer;
int print_rates;
char *timestamp_file;
char *name_pattern;
regex_t name_regex;
uint64_t size;
int num_servers;
char *mountdir;
// optimizing parameters NOT USED
int queue_length;
int max_entries_per_iter;
int steal_from_next; // if true, then steal from the next process
int parallel_single_dir_access; // if 1, use hashing to parallelize single
// directory access, if 2 sequential increment
int verbosity;
} pfind_options_t;
typedef struct {
uint64_t ctime_min;
double stonewall_endtime;
FILE *logfile;
int needs_stat;
} pfind_runtime_options_t;
static pfind_runtime_options_t runtime;
int pfind_rank;
static pfind_options_t *opt;
void pfind_abort(const string str) {
printf("%s", str.c_str());
exit(1);
}
static void pfind_print_help(pfind_options_t *res) {
printf("pfind \nSynopsis:\n"
"pfind [-newer ] [-size c] [-name "
"] [-regex ] [-S ] [-M ]\n"
"\tworkdir = \"%s\"\n"
"\t-newer = \"%s\"\n"
"\t-name|-regex = \"%s\"\n"
"\t-S: num servers = \"%s\"\n"
"\t-M: mountdir = \"%s\"\n"
"Optional flags\n"
"\t-h: prints the help\n"
"\t--help: prints the help without initializing MPI\n",
res->workdir, res->timestamp_file, res->name_pattern, res->num_servers,
res->mountdir);
}
MPI_Comm pfind_com;
int pfind_size;
pfind_options_t *pfind_parse_args(int argc, char **argv, int force_print_help,
MPI_Comm com) {
MPI_Comm_rank(com, &pfind_rank);
MPI_Comm_size(com, &pfind_size);
pfind_com = com;
pfind_options_t *res = (pfind_options_t *)malloc(sizeof(pfind_options_t));
memset(res, 0, sizeof(pfind_options_t));
int print_help = force_print_help;
res->workdir = "./";
res->results_dir = nullptr;
res->verbosity = 0;
res->timestamp_file = nullptr;
res->name_pattern = nullptr;
res->size = std::numeric_limits::max();
res->queue_length = 100000;
res->max_entries_per_iter = 1000;
char *firstarg = nullptr;
// when we find special args, we process them
// but we need to replace them with 0 so that getopt will ignore them
// and getopt will continue to process beyond them
for (auto i = 1; i < argc - 1; i++) {
if (strcmp(argv[i], "-newer") == 0) {
res->timestamp_file = strdup(argv[i + 1]);
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (strcmp(argv[i], "-size") == 0) {
char *str = argv[i + 1];
char extension = str[strlen(str) - 1];
str[strlen(str) - 1] = 0;
res->size = atoll(str);
switch (extension) {
case 'c':
break;
default:
pfind_abort("Unsupported exension for -size\n");
}
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (strcmp(argv[i], "-name") == 0) {
res->name_pattern = (char *)malloc(strlen(argv[i + 1]) * 4 + 100);
// transform a traditional name pattern to a regex:
char *str = argv[i + 1];
char *out = res->name_pattern;
int pos = 0;
for (unsigned i = 0; i < strlen(str); i++) {
if (str[i] == '*') {
pos += sprintf(out + pos, ".*");
} else if (str[i] == '.') {
pos += sprintf(out + pos, "[.]");
} else if (str[i] == '"' || str[i] == '\"') {
// erase the "
} else {
out[pos] = str[i];
pos++;
}
}
out[pos] = 0;
auto ret = regcomp(&res->name_regex, res->name_pattern, 0);
if (ret) {
pfind_abort("Invalid regex for name given\n");
}
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (strcmp(argv[i], "-regex") == 0) {
res->name_pattern = strdup(argv[i + 1]);
auto ret = regcomp(&res->name_regex, res->name_pattern, 0);
if (ret) {
pfind_abort("Invalid regex for name given\n");
}
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (!firstarg) {
firstarg = strdup(argv[i]);
argv[i][0] = 0;
}
}
if (argc == 2) {
firstarg = strdup(argv[1]);
}
int c;
while ((c = getopt(argc, argv, "CPs:r:vhD:xq:H:NM:S:")) != -1) {
if (c == -1) {
break;
}
switch (c) {
case 'H':
res->parallel_single_dir_access = atoi(optarg);
break;
case 'N':
res->steal_from_next = 1;
break;
case 'x':
/* ignore fake arg that we added when we processed the extra args */
break;
case 'P':
res->print_by_process = 1;
break;
case 'C':
res->just_count = 1;
break;
case 'D':
if (strcmp(optarg, "rates") == 0) {
res->print_rates = 1;
} else {
pfind_abort("Unsupported debug flag\n");
}
break;
case 'h':
print_help = 1;
break;
case 'r':
res->results_dir = strdup(optarg);
break;
case 'q':
res->queue_length = atoi(optarg);
break;
if (res->queue_length < 10) {
pfind_abort("Queue must be at least 10 elements!\n");
}
break;
case 's':
res->stonewall_timer = atol(optarg);
break;
case 'S':
res->num_servers = atoi(optarg);
break;
case 'M':
res->mountdir = strdup(optarg);
break;
case 'v':
res->verbosity++;
break;
case 0:
break;
}
}
if (res->verbosity > 2 && pfind_rank == 0) {
printf("Regex: %s\n", res->name_pattern);
}
if (print_help) {
if (pfind_rank == 0)
pfind_print_help(res);
int init;
MPI_Initialized(&init);
if (init) {
MPI_Finalize();
}
exit(0);
}
if (!firstarg) {
pfind_abort("Error: pfind \n");
}
res->workdir = firstarg;
return res;
}
/* Master send a new path to the workers */
void send_newPath(string path) {
auto count = path.size() + 1;
MPI_Bcast(&count, 1, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Bcast((void *)path.c_str(), count, MPI_CHAR, 0, MPI_COMM_WORLD);
}
/* Clients get a new path, getting a "0" size char means there is no new path*/
string recv_newPath() {
int count;
MPI_Bcast(&count, 1, MPI_INT, 0, MPI_COMM_WORLD);
if (count == 0)
return "Terminate";
char buf[count];
MPI_Bcast(buf, count, MPI_CHAR, 0, MPI_COMM_WORLD);
return buf;
}
/* Client Processing a path.
* We increment local checked/found based on the filters
* Each client sends the request to a subset of GekkoFS servers.
* We use 102400 (plus space from 255 chars paths) so it is nearly 1M files per
* server, which is enough for most cases
*
*/
void dirProcess(const string path, unsigned long long &checked,
unsigned long long &found, queue &dirs,
unsigned int world_rank, unsigned int world_size,
pfind_options_t *opt) {
struct dirent_extended *getdir = (struct dirent_extended *)malloc(
(sizeof(struct dirent_extended) + 255) * 1024 * 100);
memset(getdir, 0, (sizeof(struct dirent_extended) + 255) * 1024 * 100);
// cout << "PROCESSING " << world_rank << "/"<< world_size << " = " << path <<
// endl;
int servers_per_node = ceil(opt->num_servers / (world_size - 1));
if (servers_per_node == 0)
servers_per_node++;
for (int it = 0; it < servers_per_node; it++) {
auto server = (world_rank - 1) * servers_per_node + it;
if (server >= opt->num_servers)
break;
unsigned long long total_size = 0;
auto n = gkfs_getsingleserverdir(
path.c_str(), getdir,
(sizeof(struct dirent_extended) + 255) * 1024 * 100, server);
struct dirent_extended *temp = getdir;
while (total_size < n) {
if (strlen(temp->d_name) == 0)
break;
total_size += temp->d_reclen;
/* Queue directory to process */
if (temp->d_type == 1) {
string slash;
if (path[path.size() - 1] != '/')
slash = "/";
checked++;
dirs.push(path + slash + temp->d_name);
temp = reinterpret_cast(reinterpret_cast(temp) +
temp->d_reclen);
continue;
}
/* Find filtering */
auto timeOK = true;
if (opt->timestamp_file) {
if ((uint64_t)temp->ctime < runtime.ctime_min)
timeOK = false;
}
if (timeOK and (temp->size == opt->size or opt->size == std::numeric_limits::max()))
if (!(opt->name_pattern &&
regexec(&opt->name_regex, temp->d_name, 0, nullptr, 0)))
found++;
checked++;
temp =
reinterpret_cast(reinterpret_cast(temp) + temp->d_reclen);
}
}
}
int process(char *processor_name, int world_rank, int world_size,
pfind_options_t *opt) {
// Print off a hello world message
// INIT PFIND
memset(&runtime, 0, sizeof(pfind_runtime_options_t));
int ret;
/* Get timestamp file */
if (opt->timestamp_file) {
if (pfind_rank == 0) {
static struct stat timer_file{};
if (lstat(opt->timestamp_file, &timer_file) != 0) {
printf("Could not open: \"%s\", error: %s", opt->timestamp_file,
strerror(errno));
pfind_abort("\n");
}
runtime.ctime_min = timer_file.st_ctime;
}
MPI_Bcast(&runtime.ctime_min, 1, MPI_INT, 0, pfind_com);
}
auto iterations = 0;
if (world_rank == 0) {
queue dirs;
string workdir = opt->workdir;
workdir = workdir.substr(strlen(opt->mountdir), workdir.size());
if (workdir.size() == 0)
workdir = "/";
dirs.push(workdir);
do {
string processpath = dirs.front();
dirs.pop();
// DISTRIBUTE WORK
send_newPath(processpath);
auto received_strings = true;
// We need to gather new directories found (we use send-recv)
for (auto i = 1; i < world_size; i++) {
received_strings = true;
while (received_strings) {
received_strings = false;
// cout << " Checking from " << i << endl;
MPI_Status mpistatus;
MPI_Probe(i, 0, MPI_COMM_WORLD, &mpistatus);
int count;
MPI_Get_count(&mpistatus, MPI_CHAR, &count);
char buf[count];
MPI_Recv(&buf, count, MPI_CHAR, i, 0, MPI_COMM_WORLD, &mpistatus);
if (count == 0) {
continue;
}
// cout << " Receiving from " << i << " ---- " << buf << endl;
string s = buf;
dirs.push(s);
received_strings = true;
}
}
// cout << "NO more paths " << dirs.size() << endl;
} while (!dirs.empty());
auto count = 0;
MPI_Bcast(&count, 1, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
unsigned long long *Array_checked =
(unsigned long long *)malloc(sizeof(unsigned long long) * world_size);
unsigned long long *Array_found =
(unsigned long long *)malloc(sizeof(unsigned long long) * world_size);
unsigned long long checked = 0;
unsigned long long found = 0;
MPI_Gather(&checked, 1, MPI_UNSIGNED_LONG_LONG, Array_checked, 1,
MPI_UNSIGNED_LONG_LONG, 0, MPI_COMM_WORLD);
MPI_Gather(&found, 1, MPI_UNSIGNED_LONG_LONG, Array_found, 1,
MPI_UNSIGNED_LONG_LONG, 0, MPI_COMM_WORLD);
for (int i = 0; i < world_size; i++) {
checked += Array_checked[i];
found += Array_found[i];
}
cout << "MATCHED " << found << "/" << checked << endl;
}
else {
unsigned long long checked = 0;
unsigned long long found = 0;
while (1) {
string toProcess = recv_newPath();
if (toProcess == "Terminate") {
break;
}
// cout << "REceived " << toProcess << " --- " << world_rank << endl;
queue dirs;
dirProcess(toProcess, checked, found, dirs, world_rank, world_size, opt);
// Send NEW DIRS to master
while (!dirs.empty()) {
string s = dirs.front();
dirs.pop();
// cout << world_rank << " --> Sending " << s << endl;
MPI_Send((void *)s.c_str(), (s.size() + 1), MPI_CHAR, 0, 0,
MPI_COMM_WORLD);
}
// cout << world_rank << " --> Sending 0 " << endl;
MPI_Send((void *)0, 0, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
}
MPI_Barrier(MPI_COMM_WORLD);
MPI_Gather(&checked, 1, MPI_UNSIGNED_LONG_LONG, nullptr, 1,
MPI_UNSIGNED_LONG_LONG, 0, MPI_COMM_WORLD);
MPI_Gather(&found, 1, MPI_UNSIGNED_LONG_LONG, nullptr, 1,
MPI_UNSIGNED_LONG_LONG, 0, MPI_COMM_WORLD);
}
return 0;
}
int main(int argc, char **argv) {
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0) {
argv[i][0] = 0;
pfind_rank = 0;
pfind_parse_args(argc, argv, 1, MPI_COMM_SELF);
exit(0);
}
}
// Initialize the MPI environment
MPI_Init(&argc, &argv);
// Get the number of processes
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
// Get the rank of the process
int world_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
opt = pfind_parse_args(argc, argv, 0, MPI_COMM_WORLD);
// cout << opt->num_servers << " -- " << opt->mountdir << endl;
// Get the name of the processor
char processor_name[MPI_MAX_PROCESSOR_NAME];
int name_len;
MPI_Get_processor_name(processor_name, &name_len);
process(processor_name, world_rank, world_size, opt);
// Finalize the MPI environment.
MPI_Finalize();
}
gekkofs-uc3m_test/examples/gfind/pfind.sh 0000775 0000000 0000000 00000005140 14172016224 0020756 0 ustar 00root root 0000000 0000000 #!/bin/bash
################################################################################
# Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain #
# Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany #
# #
# This software was partially supported by the #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). #
# #
# This software was partially supported by the #
# ADA-FS project under the SPPEXA project funded by the DFG. #
# #
# This file is part of GekkoFS. #
# #
# GekkoFS is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# GekkoFS is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with GekkoFS. If not, see . #
# #
# SPDX-License-Identifier: GPL-3.0-or-later #
################################################################################
# optimal $GKFS_FIND_PROCESS is $GKFS_SERVERS+1 as we align servers and find processes if the $NUM_NODES are the same
# Output is saved to a file, so it can be processed by io500
srun --nvram-options=1LM:1980 -N $NUM_NODES -n $GKFS_FIND_PROCESS --export=ALL,PSM2_DEVICES=self,hfi,shm,PSM2_MULTIRAIL=1,PSM2_MULTI_EP=0,LD_PRELOAD=${GKFS_PRLD} -o find_${SLURM_JOB_ID}.txt $GKFS_FIND $@ -M $GKFS_MNT -S $GKFS_SERVERS
tail -n1 find_${SLURM_JOB_ID}.txt
exit 0
gekkofs-uc3m_test/examples/gfind/sfind.cpp 0000664 0000000 0000000 00000025763 14172016224 0021143 0 ustar 00root root 0000000 0000000 /*
Copyright 2018-2021, Barcelona Supercomputing Center (BSC), Spain
Copyright 2015-2021, Johannes Gutenberg Universitaet Mainz, Germany
This software was partially supported by the
EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).
This software was partially supported by the
ADA-FS project under the SPPEXA project funded by the DFG.
This file is part of GekkoFS.
GekkoFS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GekkoFS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GekkoFS. If not, see .
SPDX-License-Identifier: GPL-3.0-or-later
*/
/* Based on pfind from ior500 */
/* https://github.com/VI4IO/pfind/ */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
/* Minimal struct needed for io500 find */
/* We could also do the filtering on the server */
struct dirent_extended {
size_t size;
time_t ctime;
unsigned short d_reclen;
unsigned char d_type;
char d_name[1];
};
/* Function exported from GekkoFS LD_PRELOAD, code needs to be compiled with
* -fPIC */
extern "C" int gkfs_getsingleserverdir(const char *path,
struct dirent_extended *dirp,
unsigned int count, int server)
__attribute__((weak));
/* PFIND OPTIONS EXTENDED We need to add the GekkoFS mount dir and the number of
* servers */
typedef struct {
std::string workdir{};
int just_count;
int print_by_process;
char *results_dir;
int stonewall_timer;
int print_rates;
char *timestamp_file;
char *name_pattern;
regex_t name_regex;
uint64_t size;
int num_servers;
char *mountdir;
// optimizing parameters NOT USED
int queue_length;
int max_entries_per_iter;
int steal_from_next; // if true, then steal from the next process
int parallel_single_dir_access; // if 1, use hashing to parallelize single
// directory access, if 2 sequential increment
int verbosity;
} pfind_options_t;
typedef struct {
uint64_t ctime_min;
double stonewall_endtime;
FILE *logfile;
int needs_stat;
} pfind_runtime_options_t;
static pfind_runtime_options_t runtime;
int pfind_rank;
static pfind_options_t *opt;
void pfind_abort(const std::string str) {
printf("%s", str.c_str());
exit(1);
}
static void pfind_print_help(pfind_options_t *res) {
printf("pfind \nSynopsis:\n"
"pfind [-newer ] [-size c] [-name "
"] [-regex ] [-S ] [-M ]\n"
"\tworkdir = \"%s\"\n"
"\t-newer = \"%s\"\n"
"\t-name|-regex = \"%s\"\n"
"\t-S: num servers = \"%d\"\n"
"\t-M: mountdir = \"%s\"\n"
"Optional flags\n"
"\t-h: prints the help\n"
"\t--help: prints the help without initializing MPI\n",res->workdir.c_str(),
res->timestamp_file, res->name_pattern, res->num_servers,
res->mountdir );
}
int pfind_size;
pfind_options_t *pfind_parse_args(int argc, char **argv, int force_print_help){
pfind_rank = 0;
pfind_size = 1;
pfind_options_t *res = (pfind_options_t *)malloc(sizeof(pfind_options_t));
memset(res, 0, sizeof(pfind_options_t));
auto print_help = force_print_help;
res->workdir = "./";
res->results_dir = nullptr;
res->verbosity = 0;
res->timestamp_file = nullptr;
res->name_pattern = nullptr;
res->size = std::numeric_limits::max();
res->queue_length = 100000;
res->max_entries_per_iter = 1000;
char *firstarg = nullptr;
// when we find special args, we process them
// but we need to replace them with 0 so that getopt will ignore them
// and getopt will continue to process beyond them
for (auto i = 1; i < argc - 1; i++) {
if (strcmp(argv[i], "-newer") == 0) {
res->timestamp_file = strdup(argv[i + 1]);
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (strcmp(argv[i], "-size") == 0) {
char *str = argv[i + 1];
char extension = str[strlen(str) - 1];
str[strlen(str) - 1] = 0;
res->size = atoll(str);
switch (extension) {
case 'c':
break;
default:
pfind_abort("Unsupported exension for -size\n");
}
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (strcmp(argv[i], "-name") == 0) {
res->name_pattern = (char *)malloc(strlen(argv[i + 1]) * 4 + 100);
// transform a traditional name pattern to a regex:
char *str = argv[i + 1];
char *out = res->name_pattern;
auto pos = 0;
for (auto i = 0; i < strlen(str); i++) {
if (str[i] == '*') {
pos += sprintf(out + pos, ".*");
} else if (str[i] == '.') {
pos += sprintf(out + pos, "[.]");
} else if (str[i] == '"' || str[i] == '\"') {
// erase the "
} else {
out[pos] = str[i];
pos++;
}
}
out[pos] = 0;
int ret = regcomp(&res->name_regex, res->name_pattern, 0);
if (ret) {
pfind_abort("Invalid regex for name given\n");
}
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (strcmp(argv[i], "-regex") == 0) {
res->name_pattern = strdup(argv[i + 1]);
int ret = regcomp(&res->name_regex, res->name_pattern, 0);
if (ret) {
pfind_abort("Invalid regex for name given\n");
}
argv[i][0] = 0;
argv[++i][0] = 0;
} else if (!firstarg) {
firstarg = strdup(argv[i]);
argv[i][0] = 0;
}
}
if (argc == 2) {
firstarg = strdup(argv[1]);
}
int c;
while ((c = getopt(argc, argv, "CPs:r:vhD:xq:H:NM:S:")) != -1) {
if (c == -1) {
break;
}
switch (c) {
case 'H':
res->parallel_single_dir_access = atoi(optarg);
break;
case 'N':
res->steal_from_next = 1;
break;
case 'x':
/* ignore fake arg that we added when we processed the extra args */
break;
case 'P':
res->print_by_process = 1;
break;
case 'C':
res->just_count = 1;
break;
case 'D':
if (strcmp(optarg, "rates") == 0) {
res->print_rates = 1;
} else {
pfind_abort("Unsupported debug flag\n");
}
break;
case 'h':
print_help = 1;
break;
case 'r':
res->results_dir = strdup(optarg);
break;
case 'q':
res->queue_length = atoi(optarg);
break;
if (res->queue_length < 10) {
pfind_abort("Queue must be at least 10 elements!\n");
}
break;
case 's':
res->stonewall_timer = atol(optarg);
break;
case 'S':
res->num_servers = atoi(optarg);
break;
case 'M':
res->mountdir = strdup(optarg);
break;
case 'v':
res->verbosity++;
break;
case 0:
break;
}
}
if (res->verbosity > 2 && pfind_rank == 0) {
printf("Regex: %s\n", res->name_pattern);
}
if (print_help) {
if (pfind_rank == 0)
pfind_print_help(res);
exit(0);
}
if (!firstarg) {
pfind_abort("Error: pfind \n");
}
res->workdir = firstarg;
return res;
}
/* Client Processing a path.
* We increment local checked/found based on the filters
* Each client sends the request to a subset of GekkoFS servers.
* We use 102400 (plus space from 255 chars paths) so it is nearly 1M files per
* server, which is enough for most cases
*
*/
void dirProcess(const string path, unsigned long long &checked,
unsigned long long &found, queue &dirs,
unsigned int world_rank, unsigned int world_size,
pfind_options_t *opt) {
struct dirent_extended *getdir = (struct dirent_extended *)malloc(
(sizeof(struct dirent_extended) + 255) * 1024 * 100);
memset(getdir, 0, (sizeof(struct dirent_extended) + 255) * 1024 * 100);
// cout << "PROCESSING " << world_rank << "/"<< world_size << " = " << path <<
// endl;
for (auto server = 0; server < opt->num_servers; server++) {
unsigned long long total_size = 0;
auto n = gkfs_getsingleserverdir(
path.c_str(), getdir,
(sizeof(struct dirent_extended) + 255) * 1024 * 100, server);
struct dirent_extended *temp = getdir;
while (total_size < n) {
if (strlen(temp->d_name) == 0)
break;
total_size += temp->d_reclen;
/* Queue directory to process */
if (temp->d_type == 1) {
string slash;
if (path[path.size() - 1] != '/')
slash = "/";
checked++;
dirs.push(path + slash + temp->d_name);
temp =
reinterpret_cast(reinterpret_cast(temp) + temp->d_reclen);
continue;
}
/* Find filtering */
auto timeOK = true;
if (opt->timestamp_file) {
if ((uint64_t)temp->ctime < runtime.ctime_min)
timeOK = false;
}
if (timeOK and (temp->size == opt->size or opt->size == std::numeric_limits::max()))
if (!(opt->name_pattern &&
regexec(&opt->name_regex, temp->d_name, 0, nullptr, 0)))
found++;
checked++;
temp = reinterpret_cast(reinterpret_cast(temp) + temp->d_reclen);
}
}
}
int process(pfind_options_t *opt) {
// Print off a hello world message
unsigned long long found,checked;
// INIT PFIND
found = 0;
checked = 0;
memset(&runtime, 0, sizeof(pfind_runtime_options_t));
auto ret = 0;
/* Get timestamp file */
if (opt->timestamp_file) {
if (pfind_rank == 0) {
static struct stat timer_file{};
if (lstat(opt->timestamp_file, &timer_file) != 0) {
printf("Could not open: \"%s\", error: %s", opt->timestamp_file,
strerror(errno));
pfind_abort("\n");
}
runtime.ctime_min = timer_file.st_ctime;
}
}
auto iterations = 0;
queue dirs;
string workdir = opt->workdir;
workdir = workdir.substr(strlen(opt->mountdir), workdir.size());
if (workdir.size() == 0)
workdir = "/";
dirs.push(workdir);
do {
string processpath = dirs.front();
dirs.pop();
dirProcess(processpath, checked, found, dirs, 0, 1, opt);
// cout << "NO more paths " << dirs.size() << endl;
} while (!dirs.empty());
cout << "MATCHED " << found << "/" << checked << endl;
return 0;
}
int main(int argc, char **argv) {
for (auto i = 0; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0) {
argv[i][0] = 0;
pfind_rank = 0;
pfind_parse_args(argc, argv, 1);
exit(0);
}
}
opt = pfind_parse_args(argc, argv, 0);
process(opt);
}
gekkofs-uc3m_test/external/ 0000775 0000000 0000000 00000000000 14172016224 0016234 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/external/CLI11/ 0000775 0000000 0000000 00000000000 14172016224 0017005 5 ustar 00root root 0000000 0000000 gekkofs-uc3m_test/external/CLI11/CLI11.hpp 0000664 0000000 0000000 00001266203 14172016224 0020301 0 ustar 00root root 0000000 0000000 // CLI11: Version 2.1.2
// Originally designed by Henry Schreiner
// https://github.com/CLIUtils/CLI11
//
// This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts
// from: v2.1.2
//
// CLI11 2.1.2 Copyright (c) 2017-2021 University of Cincinnati, developed by Henry
// Schreiner under NSF AWARD 1414736. All rights reserved.
//
// Redistribution and use in source and binary forms of CLI11, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder nor the names of its contributors
// may be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
// Standard combined includes:
#include
#include
#include
#include
#include
#include