Permalink
Browse files

Merge branch 'ta-master-track'

* ta-master-track: (40 commits)
  pass LAPACK_LIBRARIES to Elemental
  Minor elemental.cmake cleanup
  added missing header
  madness-config finds non-embedded elemental compiled as part of MADNESS correctly in build and install locations
  updated madness-config to relax checking for source and build dirs in case we are in install location already
  cherry-picked 598c366
  check for popping empty stack; and don't pop empty stack
  amended 43cf3ce
  no message
  minimal changes to fix tensor tests discussed at 16ba1bf#diff-03848e5ab4089951b670606a957c6418R273
  Introduced DependencyInterface::register_final_callback; cannot register additional callbacks after that.
  amended 8058323
  updated DependencyInterface::register_callback to prevent multiple callback invokation cycles
  ocd
  amended 711b768 to use static constexpr flag to control debug printing
  updated comments to point out the race and why original WorldTaskQueue::add() is now safe
  commented out debug printing
  reverting 5e4aa80 again, but this time fixed DependencyInterface::dec and dec_debug to commit changes to ndepend after the last use of the object. This should avoid the race in WorldTaskQueue::add
  re-reverting 21d2b38, with comments. Appears to be a real race.
  reverted 21d2b38 which only hid a race
  ...

# Conflicts:
#	src/madness/world/dependency_interface.h
#	src/madness/world/future.h
  • Loading branch information...
evaleev committed Nov 28, 2017
2 parents c6240b7 + 80d971d commit d42674fcf22ee3a495b11a458ac0e563dc0a5d8b
Showing with 21 additions and 15 deletions.
  1. +9 −5 cmake/madness-config.cmake.in
  2. +10 −10 external/elemental.cmake
  3. +2 −0 src/madness/tensor/elem.h
@@ -76,20 +76,24 @@ set(MADNESS_INSTALL_INCLUDE_DIRS "@PACKAGE_MADNESS_INSTALL_INCLUDEDIR@"
if (MADNESS_HAS_ELEMENTAL)
if(MADNESS_HAS_ELEMENTAL_EMBEDDED)
set_and_check(Elemental_SOURCE_DIR "@Elemental_SOURCE_DIR@")
set_and_check(Elemental_BINARY_DIR "@Elemental_BINARY_DIR@")
set(Elemental_SOURCE_DIR "@Elemental_SOURCE_DIR@")
set(Elemental_BINARY_DIR "@Elemental_BINARY_DIR@")
list(APPEND MADNESS_BUILD_INCLUDE_DIRS
"${Elemental_SOURCE_DIR}/include" "${Elemental_BINARY_DIR}/include"
"${Elemental_SOURCE_DIR}/external/pmrrr/include"
"${Elemental_BINARY_DIR}/external/pmrrr/include")
else(MADNESS_HAS_ELEMENTAL_EMBEDDED)
set_and_check(Elemental_SOURCE_DIR "@ELEMENTAL_SOURCE_DIR@")
set_and_check(Elemental_BINARY_DIR "@ELEMENTAL_BINARY_DIR@")
set(Elemental_SOURCE_DIR "@ELEMENTAL_SOURCE_DIR@")
set(Elemental_BINARY_DIR "@ELEMENTAL_BINARY_DIR@")
# elemental package and component name depends on version
set(ELEMENTAL_PACKAGE_NAME @ELEMENTAL_PACKAGE_NAME@)
set(ELEMENTAL_CONFIGURE_NAME @ELEMENTAL_CONFIG_NAME@)
# where to look for elemental cmake config file
#set(${ELEMENTAL_PACKAGE_NAME}_DIR "${Elemental_BINARY_DIR}")
if(CMAKE_CURRENT_LIST_DIR EQUAL MADNESS_BINARY_DIR)
set(Elemental_DIR "${Elemental_BINARY_DIR}")
else()
set(Elemental_DIR "${PACKAGE_PREFIX_DIR}/CMake/elemental")
endif()
find_package(${ELEMENTAL_CONFIGURE_NAME} REQUIRED
COMPONENTS REQUIRED ${ELEMENTAL_PACKAGE_NAME})
list(APPEND MADNESS_BUILD_INCLUDE_DIRS
View
@@ -40,14 +40,23 @@ if(ENABLE_ELEMENTAL AND DEFINED ELEMENTAL_TAG)
if (NOT DEFINED ELEMENTAL_CMAKE_BUILD_TYPE)
set(ELEMENTAL_CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
endif (NOT DEFINED ELEMENTAL_CMAKE_BUILD_TYPE)
if (${ELEMENTAL_CMAKE_BUILD_TYPE} STREQUAL "Debug")
message(WARNING "Compiling Elemental with in Debug mode will make many calls non-reentrant! Set ELEMENTAL_CMAKE_BUILD_TYPE=Release to avoid")
endif()
# Set the configuration variables used by elemental
if((ENABLE_SPINLOCKS OR NOT ENABLE_NEVER_SPIN) AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(ELEMENTAL_HAVE_SPINLOCKS ON)
else()
set(ELEMENTAL_HAVE_SPINLOCKS OFF)
endif()
# Override BLAS+LAPACK selection by Elemental
# unless ELEMENTAL_MATH_LIBS is given by the user, use LAPACK_LIBRARIES as the default value for Elemental's MATH_LIBS
if (NOT ELEMENTAL_MATH_LIBS)
string(REPLACE ";" " " ELEMENTAL_MATH_LIBS "${LAPACK_LIBRARIES}")
endif()
#
# Obtain Elemental source **only** if needed (that's why not using ExternalProject)
#
@@ -170,15 +179,6 @@ if(ENABLE_ELEMENTAL AND DEFINED ELEMENTAL_TAG)
file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/CMake)
# execute_process(
# COMMAND cp
# ElementalTargets.cmake
# ${ELEMENTAL_INSTALL_DIR}/CMake
# WORKING_DIRECTORY "${ELEMENTAL_BINARY_DIR}"
# RESULT_VARIABLE error_code)
file(COPY ${ELEMENTAL_BINARY_DIR}/ElementalTargets.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/CMake)
find_package(${ELEMENTAL_CONFIG_NAME} REQUIRED PATHS ${CMAKE_INSTALL_PREFIX}
COMPONENTS REQUIRED ${ELEMENTAL_PACKAGE_NAME} pmrrr ElSuiteSparse)
set(ELEMENTAL_FOUND 1)
@@ -508,6 +508,8 @@ namespace madness {
#else
#include <madness/tensor/tensor_lapack.h>
namespace madness {
// sequential fall back code
template <typename T>

0 comments on commit d42674f

Please sign in to comment.