Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into pr-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fbischoff committed Jul 7, 2024
2 parents 2c4874a + ede1667 commit a879d67
Show file tree
Hide file tree
Showing 329 changed files with 329,901 additions and 18,788 deletions.
148 changes: 148 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Generated from CLion Inspection settings
---
Checks: '-*,
bugprone-argument-comment,
bugprone-assert-side-effect,
bugprone-bad-signal-to-kill-thread,
bugprone-branch-clone,
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-forwarding-reference-overload,
bugprone-inaccurate-erase,
bugprone-incorrect-roundings,
bugprone-integer-division,
bugprone-lambda-function-name,
bugprone-macro-parentheses,
bugprone-macro-repeated-side-effects,
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-move-forwarding-reference,
bugprone-multiple-statement-macro,
bugprone-no-escape,
bugprone-not-null-terminated-result,
bugprone-parent-virtual-call,
bugprone-posix-return,
bugprone-reserved-identifier,
bugprone-sizeof-container,
bugprone-sizeof-expression,
bugprone-spuriously-wake-up-functions,
bugprone-string-constructor,
bugprone-string-integer-assignment,
bugprone-string-literal-with-embedded-nul,
bugprone-suspicious-enum-usage,
bugprone-suspicious-include,
bugprone-suspicious-memset-usage,
bugprone-suspicious-missing-comma,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-suspicious-memory-comparison,
bugprone-suspicious-realloc-usage,
bugprone-swapped-arguments,
bugprone-terminating-continue,
bugprone-throw-keyword-missing,
bugprone-too-small-loop-variable,
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
bugprone-unhandled-self-assignment,
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-use-after-move,
bugprone-virtual-near-miss,
cert-dcl21-cpp,
cert-dcl58-cpp,
cert-err34-c,
cert-err52-cpp,
cert-err60-cpp,
cert-flp30-c,
cert-msc50-cpp,
cert-msc51-cpp,
cert-str34-c,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing,
google-default-arguments,
google-explicit-constructor,
google-runtime-operator,
hicpp-exception-baseclass,
hicpp-multiway-paths-covered,
misc-misplaced-const,
misc-new-delete-overloads,
misc-no-recursion,
misc-non-copyable-objects,
misc-throw-by-value-catch-by-reference,
misc-unconventional-assign-operator,
misc-uniqueptr-reset-release,
modernize-avoid-bind,
modernize-concat-nested-namespaces,
modernize-deprecated-headers,
modernize-deprecated-ios-base-aliases,
modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
modernize-pass-by-value,
modernize-raw-string-literal,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-disallow-copy-and-assign-macro,
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
modernize-shrink-to-fit,
modernize-unary-static-assert,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-nodiscard,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
modernize-use-transparent-functors,
modernize-use-uncaught-exceptions,
mpi-buffer-deref,
mpi-type-mismatch,
openmp-use-default-none,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-no-automatic-move,
performance-noexcept-move-constructor,
performance-trivially-destructible,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
portability-simd-intrinsics,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-size-empty,
readability-convert-member-functions-to-static,
readability-delete-null-pointer,
readability-deleted-default,
readability-inconsistent-declaration-parameter-name,
readability-make-member-function-const,
readability-misleading-indentation,
readability-misplaced-array-index,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-redundant-string-init,
readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release,
readability-use-anyofallof'
24 changes: 23 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ jobs:
CTEST_OUTPUT_ON_FAILURE : 1
BUILD_CONFIG : >
-G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
-DCMAKE_PREFIX_PATH=/usr/local/opt/bison
-DBUILD_SHARED_LIBS=OFF
-DMPIEXEC_PREFLAGS='--bind-to;none;--allow-run-as-root'
-DBUILD_TESTING=ON
-DMADNESS_ENABLE_CEREAL=ON
-DMADNESS_BUILD_MADWORLD_ONLY=${{ matrix.task_backend != 'Threads' }}
-DMADNESS_BUILD_LIBRARIES_ONLY=${{ matrix.build_type != 'Debug' }}
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -66,7 +69,7 @@ jobs:
- name: Install prerequisite MacOS packages
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install ninja gcc@10 boost eigen open-mpi bison ccache
brew install ninja boost eigen open-mpi bison ccache
if [ "X${{ matrix.task_backend }}" = "XLegacyTBB" ]; then
brew install tbb@2020
echo "TBBROOT=/usr/local/opt/tbb@2020" >> $GITHUB_ENV
Expand Down Expand Up @@ -129,3 +132,22 @@ jobs:
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --target check-short-madness

- name: Install
if: matrix.build_type != 'Debug'
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --target install

- name: Test Install Tree
if: matrix.build_type != 'Debug'
working-directory: ${{github.workspace}}/build
shell: bash
run: |
cmake -S $GITHUB_WORKSPACE/doc/tutorial -B test_install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install
cmake --build test_install
test_install/test_runtime
# if built more than just MADWorld run the HF test
if [ "X${{ matrix.task_backend }}" = "XThreads" ]; then
test_install/simple_hf
fi
2 changes: 1 addition & 1 deletion .github/workflows/make_doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install prerequisites Ubuntu packages
run: |
sudo apt-get update
sudo apt-get install ninja-build g++-9 liblapack-dev openmpi-bin libopenmpi-dev libtbb-dev doxygen
sudo apt-get install ninja-build g++-9 liblapack-dev openmpi-bin libopenmpi-dev libtbb-dev doxygen doxygen-latex graphviz
- name: configure
shell: bash
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build*
cmake-build-debug*
.history*

# Compiled Object files
*.slo
Expand Down Expand Up @@ -61,3 +62,6 @@ compile_commands.json
*.idx
.clang-format
/cmake-build-debug/.ninja_deps
compile_commands
.history/src/apps/molresponse/global_functions_20230530165227.cc
.history/src/apps/molresponse/global_functions_20230530165428.cc
90 changes: 65 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
cmake_minimum_required (VERSION 3.11.0)
cmake_minimum_required (VERSION 3.12.0) # for FindPython

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

## I know this is obnoxious but I don't know any other way to keep
## things clean. Make the build verbose so that people see the warning
## messages and fix the issues --- some of them are real
#set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")

# safety net for dev workflow: accidental install will not affect FindOrFetch*
if (NOT DEFINED CACHE{CMAKE_FIND_NO_INSTALL_PREFIX})
set(CMAKE_FIND_NO_INSTALL_PREFIX ON CACHE BOOL "Whether find_* commands will search CMAKE_INSTALL_PREFIX and CMAKE_STAGING_PREFIX; see https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_NO_INSTALL_PREFIX.html#variable:CMAKE_FIND_NO_INSTALL_PREFIX")
Expand Down Expand Up @@ -66,24 +71,26 @@ set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Whether to use extensions of C++ ISO St
add_options(CXX ALL_BUILDS ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION})

# Set install paths ============================================================

set(MADNESS_INSTALL_BINDIR "bin"
CACHE PATH "MADNESS binary install directory")
set(MADNESS_INSTALL_INCLUDEDIR "include"
include(GNUInstallDirs)
set(MADNESS_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}"
CACHE PATH "MADNESS BIN install directory")
set(MADNESS_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}"
CACHE PATH "MADNESS INCLUDE install directory")
set(MADNESS_INSTALL_LIBDIR "lib"
set(MADNESS_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}"
CACHE PATH "MADNESS LIB install directory")
set(MADNESS_INSTALL_DATADIR "share/madness/${MADNESS_VERSION}/data"
set(MADNESS_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}/madness/${MADNESS_VERSION}/data"
CACHE PATH "MADNESS DATA install directory")
# TODO this matches Automake value, should be adjusted to the convention: share/madness/${MADNESS_VERSION}/doc
set(MADNESS_INSTALL_DOCDIR "share/doc/madness"
set(MADNESS_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/madness/${MADNESS_VERSION}/doc"
CACHE PATH "MADNESS DOC install directory")
set(MADNESS_INSTALL_CMAKEDIR "lib/cmake/madness"
set(MADNESS_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/madness"
CACHE PATH "MADNESS CMAKE install directory")

# Build options ==============================================================

redefaultable_option(MADNESS_BUILD_MADWORLD_ONLY "Build only MADWorld runtime (excluding BLAS/LAPACK interfaces)" OFF)
redefaultable_option(MADNESS_BUILD_LIBRARIES_ONLY "Build only MADNESS libraries" OFF)
if (NOT MADNESS_BUILD_LIBRARIES_ONLY)
redefaultable_option(MADNESS_BUILD_MADWORLD_ONLY "Build only MADWorld runtime (excluding BLAS/LAPACK interfaces)" OFF)
endif()
redefaultable_option(MADNESS_ENABLE_CEREAL "Support use of Cereal archives as backends for MADNESS serialization" OFF)

# Enable optional libraries ====================================================
Expand All @@ -107,8 +114,23 @@ option(ENABLE_LIBUNWIND
option(ENABLE_PAPI "Enables use of PAPI" OFF)
option(ENABLE_LIBXC "Enables use of the libxc library of density functionals" ON)
option(ENABLE_PCM "Enables use of the polarizable continuum model library" ON)
option(ENABLE_INTEGRATORXX "Enables use of the IntegratorXX for building DFT quadrature grids" ON)

####### preferred task backend
set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
check_cxx_source_compiles(
"
namespace madness {
template <typename T>
void mTxmq(long dimi, long dimj, long dimk,
T* __restrict__ c, const T* a, const T* b, long ldb=-1);
template <>
void mTxmq(long dimi, long dimj, long dimk, double* __restrict__ c, const double* a, const double* b, long ldb);
}
int main() { double a[1], b[1], c[1]; madness::mTxmq(1,1,1,c,a,b,1); return 0; }
" HAVE_MTXMQ)

####### preferred task backend
set(MADNESS_TASK_VALID_BACKENDS Pthreads TBB PaRSEC)
set(MADNESS_TASK_BACKEND Pthreads CACHE STRING "The backend to use for dispatching tasks")
set_property(CACHE MADNESS_TASK_BACKEND PROPERTY STRINGS ${MADNESS_TASK_VALID_BACKENDS})
Expand Down Expand Up @@ -226,8 +248,7 @@ add_feature_info(DQ_PREBUF ENABLE_DQ_PREBUF
set(MADNESS_DQ_USE_PREBUF ${ENABLE_DQ_PREBUF} CACHE BOOL
"Enables thread-local buffer for task aggregation to reduce lock contention")

set(MADNESS_DQ_PREBUF_SIZE 20 CACHE STRING "Numberof entries in the thread-pool prebuffer for task aggregation to reduce lock contention")
#set(MADNESS_DQ_PREBUF_SZ ${MADNESS_DQ_PREBUF_SIZE} CACHE STRING "Numberof entries in the thread-pool prebuffer for task aggregation to reduce lock contention")
set(MADNESS_DQ_PREBUF_SIZE 20 CACHE STRING "Number of entries in the thread-pool prebuffer for task aggregation to reduce lock contention")

option(ENABLE_BSEND_ACKS
"Use MPI Send instead of MPI Bsend for huge message acknowledgements" ON)
Expand All @@ -247,6 +268,12 @@ add_feature_info(TASK_DEBUG_TRACE ENABLE_TASK_DEBUG_TRACE "supports debug trace
set(MADNESS_TASK_DEBUG_TRACE ${ENABLE_TASK_DEBUG_TRACE} CACHE BOOL
"Enable task debug tracing.")

option(ENABLE_WORLDOBJECT_FUTURE_TRACE
"Enable tracing of futures assicuated with WorldObjects." OFF)
add_feature_info(WORLDOBJECT_FUTURE_TRACE ENABLE_WORLDOBJECT_FUTURE_TRACE "supports tracing of futures associated with WorldObjects")
set(MADNESS_WORLDOBJECT_FUTURE_TRACE ${ENABLE_WORLDOBJECT_FUTURE_TRACE} CACHE BOOL
"Enable tracing of futures assicuated with WorldObjects.")

set(FORTRAN_INTEGER_SIZE 4 CACHE STRING "The fortran integer size (4 or 8 bytes) used for BLAS and LAPACK function calls")
if(NOT (FORTRAN_INTEGER_SIZE EQUAL 4 OR FORTRAN_INTEGER_SIZE EQUAL 8))
message(FATAL_ERROR "Incorrect fortran integer size '${FORTRAN_INTEGER_SIZE}'\n"
Expand Down Expand Up @@ -351,7 +378,7 @@ if (NOT DEFINED MADNESS_CONFIGURATION_DATE)
set(MADNESS_CONFIGURATION_DATE "${madness_configuration_date}" CACHE INTERNAL "")
endif (NOT DEFINED MADNESS_CONFIGURATION_DATE)

set(MAD_BIND_DEFAULT "-1 -1 -1" CACHE STRING "The default binding for threads")
set(MAD_BIND_DEFAULT "OFF" CACHE STRING "The default binding for threads")

# Check if the target platform is CRAY XE
check_cxx_source_compiles(
Expand Down Expand Up @@ -640,11 +667,12 @@ include(external/gperftools.cmake)
include(external/tbb.cmake)
include(external/parsec.cmake)
include(external/boost.cmake)
if (NOT MADNESS_BUILD_MADWORLD_ONLY)
if (NOT MADNESS_BUILD_MADWORLD_ONLY OR MADNESS_BUILD_LIBRARIES_ONLY)
include(external/lapack.cmake)
include(external/libxc.cmake)
include(external/pcm.cmake)
endif (NOT MADNESS_BUILD_MADWORLD_ONLY)
include(external/integratorxx.cmake)
endif ()

if (DEFINED ELEMENTAL_TAG)
include(external/elemental.cmake)
Expand All @@ -656,7 +684,7 @@ endif (DEFINED ELEMENTAL_TAG)
add_custom_target(everything)
add_dependencies(everything madness)

if(NOT MADNESS_BUILD_MADWORLD_ONLY AND LAPACK_FOUND)
if(NOT (MADNESS_BUILD_MADWORLD_ONLY OR MADNESS_BUILD_LIBRARIES_ONLY) AND LAPACK_FOUND)
add_custom_target_subproject(madness numerical-examples)
add_custom_target_subproject(madness applications)
endif()
Expand Down Expand Up @@ -699,6 +727,25 @@ CONFIGURE_FILE(
${PROJECT_BINARY_DIR}/config/MADNESS.pc
)

CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/admin/conda/Makefile.in
${PROJECT_BINARY_DIR}/admin/conda/Makefile
@ONLY
)

CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/admin/conda/recipe/build.sh.in
${PROJECT_BINARY_DIR}/admin/conda/recipe/build.sh
@ONLY
)

CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/admin/conda/recipe/meta.yaml.in
${PROJECT_BINARY_DIR}/admin/conda/recipe/meta.yaml
@ONLY
)


# install config files
install(FILES ${PROJECT_BINARY_DIR}/config/MADNESS.pc
DESTINATION lib/pkgconfig)
Expand All @@ -709,13 +756,6 @@ install(FILES
DESTINATION "${MADNESS_INSTALL_CMAKEDIR}/modules"
COMPONENT madness-config)

# sample CMakeLists.txt
configure_file(
${PROJECT_SOURCE_DIR}/doc/devsamp/CMakeLists.txt.sample.in
${PROJECT_BINARY_DIR}/doc/devsamp/CMakeLists.txt.sample
@ONLY
)

# Create the version file
write_basic_package_version_file(madness-config-version.cmake
VERSION ${MADNESS_VERSION} COMPATIBILITY AnyNewerVersion)
Expand Down
Loading

0 comments on commit a879d67

Please sign in to comment.