Skip to content

Commit

Permalink
Merge branch 'master' into fluxion_with_pfa
Browse files Browse the repository at this point in the history
  • Loading branch information
tpatki authored Jul 1, 2024
2 parents 60d9696 + e5f6754 commit 2527281
Show file tree
Hide file tree
Showing 215 changed files with 4,974 additions and 7,464 deletions.
81 changes: 81 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
BasedOnStyle : google
SpaceBeforeParens : Always
IndentWidth : 4
BreakBeforeBraces : Custom
BraceWrapping :
BeforeElse : false
AfterFunction : true
UseTab: Never
AllowShortIfStatementsOnASingleLine : false
ConstructorInitializerAllOnOneLineOrOnePerLine : true
AllowShortFunctionsOnASingleLine : false
AllowShortLoopsOnASingleLine : false
BinPackParameters : false
BinPackArguments : false
AllowAllParametersOfDeclarationOnNextLine : false
AlignTrailingComments : true
ColumnLimit : 100

# do not put all arguments on one line unless it's the same line as the call
PenaltyBreakBeforeFirstCallParameter : 10000000
PenaltyReturnTypeOnItsOwnLine : 65000
PenaltyBreakString : 10

# preserve formatting of arguments to pack/unpack functions
# found by running: rg --only-matching --no-filename --no-line-number '(flux|json)(_[^ ,()]+)?_(un)?pack' | sort -u
WhitespaceSensitiveMacros :
- flux_conf_unpack
- flux_event_pack
- flux_event_publish_pack
- flux_event_unpack
- flux_job_result_get_unpack
- flux_jobspec1_attr_pack
- flux_jobspec1_attr_unpack
- flux_jobspec_info_unpack
- flux_jobtap_event_post_pack
- flux_kvs_lookup_get_unpack
- flux_kvs_lookup_unpack
- flux_kvs_txn_pack
- flux_lookup_get_unpack
- flux_mrpc_pack
- flux_msg_pack
- flux_msg_unpack
- flux_plugin_arg_pack
- flux_plugin_arg_unpack
- flux_plugin_args_unpack
- flux_plugin_conf_unpack
- flux_request_unpack
- flux_respond_pack
- flux_rpc_get_unpack
- flux_rpc_pack
- flux_shell_getopt_unpack
- flux_shell_info_unpack
- flux_shell_jobspec_info_unpack
- flux_shell_rank_info_unpack
- flux_shell_rpc_pack
- flux_shell_setopt_pack
- flux_shell_setopt_unpack
- flux_shell_task_info_unpack
- json_pack
- json_unpack

# treat foreach macros as for loops
ForEachMacros :
- json_array_foreach
- json_object_foreach

SortIncludes : false
BreakBeforeBinaryOperators : NonAssignment
AlignAfterOpenBracket: Align
AlignOperands : true
BreakBeforeTernaryOperators : true
SpaceBeforeSquareBrackets: false
IndentPPDirectives: None
NamespaceIndentation: None
SpaceAfterTemplateKeyword: false
DerivePointerAlignment: false
PointerAlignment: Right

#
# vi:tabstop=4 shiftwidth=4 expandtab ft=yaml
#
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": [
"ms-vscode.cmake-tools"
"ms-vscode.cmake-tools",
"ms-vscode.cpptools-extension-pack"
]
}
},
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand All @@ -19,18 +19,18 @@ jobs:
spelling:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check Spelling
uses: crate-ci/typos@e477391cc0243daaeeb154a7bfa67cb7d6fc5831 # v1.16.8
uses: crate-ci/typos@bcafd462cb07ef7ba57e34abf458fe20767e808b # v1.19.0

python-format:
name: python format
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand All @@ -43,10 +43,10 @@ jobs:
name: python lint
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand All @@ -62,7 +62,7 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand All @@ -89,7 +89,7 @@ jobs:
fail-fast: false
name: ${{matrix.name}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
Expand All @@ -100,7 +100,7 @@ jobs:
github.ref != 'refs/heads/master'
run: |
# Ensure git-describe works on a tag.
# (checkout@v3 action may have left current tag as
# (checkout@v4 action may have left current tag as
# lightweight instead of annotated. See
# https://github.com/actions/checkout/issues/290)
#
Expand All @@ -120,7 +120,7 @@ jobs:
- name: docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
if: matrix.needs_buildx

- name: setup qemu-user-static
Expand All @@ -133,14 +133,19 @@ jobs:

- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{matrix.name}}-results.xml
path: test-results.xml

- name: coverage report
if: success() && matrix.coverage
run: DOCKER_REPO= bash <(curl -s https://codecov.io/bash)
env:
DOCKER_REPO:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{matrix.coverage_flags}}

- name: docker deploy
if: success() && matrix.docker_tag
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ compile_flags.txt
.vscode
.idea
.clangd
.cache

# Rules to ignore auto-generated test harness scripts
test_*.t
Expand Down
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# do not check testing data
[files]
extend-exclude = [
"cmake/sanitizers-cmake/*",
"config/*",
"m4/*",
"src/common/libutil/json.hpp",
Expand Down
30 changes: 19 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.18)
set(VER_FILE ${CMAKE_BINARY_DIR}/flux-sched.ver)
set(VER_FILE ${CMAKE_SOURCE_DIR}/flux-sched.ver)
if(DEFINED FLUX_SCHED_VER)
# do nothing, user said so
elseif(DEFINED ENV{FLUX_SCHED_VERSION})
Expand All @@ -19,7 +19,7 @@ if(POLICY CMP0140)
cmake_policy(SET CMP0140 NEW)
endif()

set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard to use")
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand All @@ -36,7 +36,6 @@ if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")


# Setting the include directory for the application to find config.h
include_directories( ${CMAKE_BINARY_DIR} )
# Since we have created a config.h add a global define for it
Expand All @@ -46,11 +45,12 @@ add_definitions( "-DPACKAGE_VERSION=\"${FLUX_SCHED_VER}\"" )
# We build a lot of shared libs, build them all with PIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# variable to store paths to add to module path for tests

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/sanitizers-cmake/cmake)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})

include(FindSanitizers)

# external dependencies
find_package(PkgConfig REQUIRED)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
Expand All @@ -59,8 +59,15 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(STATUS "flux core found and no specific prefix specified, using ${FLUX_CORE_PREFIX}")
set(CMAKE_INSTALL_PREFIX ${FLUX_CORE_PREFIX} CACHE PATH "..." FORCE)
endif()
message(STATUS "Forcing libdir to match flux-core (${FLUX_CORE_LIBDIR})")
set(CMAKE_INSTALL_LIBDIR ${FLUX_CORE_LIBDIR} CACHE PATH "..." FORCE)
if("${FLUX_CORE_LIBDIR}" MATCHES "^${FLUX_CORE_PREFIX}/(.+)$")
set(FLUX_CORE_LIBEXT "${CMAKE_MATCH_1}")
else()
set(FLUX_CORE_LIBEXT "${CMAKE_INSTALL_LIBDIR}")
endif()
set(CMAKE_INSTALL_LIBDIR ${FLUX_CORE_LIBEXT} CACHE PATH "..." FORCE)
message(STATUS "Forcing libdir selection to match flux-core: prefix subdir (${FLUX_CORE_LIBEXT})")
message(STATUS " flux-core library path: (${FLUX_CORE_LIBDIR})")
message(STATUS " flux-sched library path: (${CMAKE_INSTALL_PREFIX}/${FLUX_CORE_LIBEXT})")
if(DEFINED ENV{PYTHON})
set(Python_EXECUTABLE $ENV{PYTHON} CACHE FILEPATH "")
endif()
Expand Down Expand Up @@ -91,7 +98,7 @@ message(STATUS "Boost version: ${Boost_VERSION}")

# Install paths
set(FLUX_CMD_DIR "${CMAKE_INSTALL_LIBEXECDIR}/flux/cmd")
set(FLUX_LIB_DIR "${CMAKE_INSTALL_LIBDIR}/flux")
set(FLUX_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/flux")
set(FLUX_MOD_DIR "${FLUX_LIB_DIR}/modules")
set(FLUX_SHELL_PLUGIN_DIR "${FLUX_LIB_DIR}/shell/plugins")
set(FLUX_RC1_DIR "${CMAKE_INSTALL_SYSCONFDIR}/flux/rc1.d")
Expand Down Expand Up @@ -147,6 +154,7 @@ function(flux_add_plugin TargetName PluginType)
)
target_link_options(${TargetName} PRIVATE
"LINKER:--version-script=${CMAKE_SOURCE_DIR}/flux-plugin.map" ${LinkerOpts})
add_sanitizers(${TargetName})
target_link_libraries(${TargetName} PRIVATE flux::core)
if (NOT ARG_NOINSTALL)
install(TARGETS ${TargetName}
Expand Down Expand Up @@ -200,13 +208,13 @@ add_custom_target(installcheck
COMMAND env FLUX_SCHED_TEST_INSTALLED=1 ${CMAKE_CTEST_COMMAND} ${CTEST_COMMON_FLAGS})
add_custom_target(dist
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND echo ${FLUX_SCHED_VER} > flux-sched.ver
COMMAND echo ${FLUX_SCHED_VER} > ${CMAKE_BINARY_DIR}/flux-sched.ver
COMMAND git archive --format=tar.gz
--prefix=flux-sched-${FLUX_SCHED_VER}/
--add-file=flux-sched.ver
--add-file=${CMAKE_BINARY_DIR}/flux-sched.ver
--output=${CMAKE_BINARY_DIR}/flux-sched-${FLUX_SCHED_VER}.tar.gz
HEAD .
COMMAND rm flux-sched.ver
COMMAND rm ${CMAKE_BINARY_DIR}/flux-sched.ver
COMMENT "Generated flux-sched-${FLUX_SCHED_VER}.tar.gz"
)
# run installcheck, if it passes then write out version information and pack up
Expand Down
81 changes: 81 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"include": [
],
"configurePresets": [
{
"name": "default",
"displayName": "Default Config",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"environment": {},
"vendor": {}
},
{
"name": "asan",
"displayName": "Debug with address sanitizer",
"description": "ASAN build using Ninja generator",
"inherits": "default",
"binaryDir": "${sourceDir}/build/asan",
"cacheVariables": {
"SANITIZE_ADDRESS": "ON"
}
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "asan",
"configurePreset": "asan"
}
],
"testPresets": [
{
"name": "default",
"configurePreset": "default",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "Asan",
"configurePreset": "asan",
"output": {
"outputOnFailure": true,
"verbosity": "verbose"
},
"environment": {
"ASAN_OPTIONS": "detect_leaks=0,start_deactivated=true,replace_str=true,verify_asan_link_order=false"
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
}
],
"packagePresets": [
{
"name": "default",
"configurePreset": "default",
"generators": []
}
],
"workflowPresets": [],
"vendor": {}
}
Loading

0 comments on commit 2527281

Please sign in to comment.