Skip to content

Commit

Permalink
updated int_am to use "new" component names
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Jan 14, 2022
1 parent e886334 commit d3694ca
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions cmake/modules/int_am.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ if (_ntokens GREATER 1)
set(_max_am 0)
math(EXPR _max_deriv "${_ntokens} - 1")
foreach(_d RANGE 0 ${_max_deriv})
list(GET WITH_MAX_AM ${_d} _candidate0_d${_d})
if (${_candidate0_d${_d}} GREATER _max_am)
set(_max_am ${_candidate0_d${_d}})
list(GET WITH_MAX_AM ${_d} _max_am_default_d${_d})
if (${_max_am_default_d${_d}} GREATER _max_am)
set(_max_am ${_max_am_default_d${_d}})
endif()
endforeach()

list(JOIN WITH_MAX_AM "," _sam)
set(LIBINT_MAX_AM_LIST ${_sam})
set(LIBINT_MAX_AM ${_max_am}) # only overall LIBINT, not specific integrals classes, sets both MAX_AM & MAX_AM_LIST
set(_max_LIBINT_MAX_AM ${LIBINT_MAX_AM})
else()
set(_given_max_am_list FALSE)
set(_candidate0_d0 ${WITH_MAX_AM})
set(_max_am_default ${WITH_MAX_AM})

set(LIBINT_MAX_AM_LIST "")
set(LIBINT_MAX_AM ${WITH_MAX_AM})
Expand Down Expand Up @@ -81,6 +82,7 @@ if (_ntokens GREATER 1)
else()
set(LIBINT_OPT_AM_LIST "")
message(STATUS "WITH_OPT_AM=${WITH_OPT_AM}")
message(STATUS "_max_LIBINT_MAX_AM=${_max_LIBINT_MAX_AM}")
if (WITH_OPT_AM EQUAL -1)
math(EXPR LIBINT_OPT_AM "${_max_LIBINT_MAX_AM}/2 + 1")
#math(EXPR LIBINT_OPT_AM "${_max_LIBINT_MAX_AM}/2 + ${_max_LIBINT_MAX_AM}%2")
Expand All @@ -100,7 +102,6 @@ message(STATUS "LIBINT_OPT_AM_LIST=${LIBINT_OPT_AM_LIST} LIBINT_OPT_AM=${LIBINT_
macro(process_integrals_class class)
if (ENABLE_${class} GREATER_EQUAL 0)
set(INCLUDE_${class} ${ENABLE_${class}})
set(_candidate0_${class}_d${INCLUDE_${class}} ${_candidate0_d${INCLUDE_${class}}})
set(LIBINT_SUPPORTS_${class} yes)
set(LIBINT_${class}_DERIV ${INCLUDE_${class}})
message(STATUS "Enabling integrals class ${class} to derivative ${INCLUDE_${class}}")
Expand All @@ -116,7 +117,7 @@ macro(process_integrals_class class)
if (_ntokens GREATER 1)
math(EXPR _max_deriv "${_ntokens} - 1")
foreach(_d RANGE 0 ${_max_deriv})
list(GET WITH_${class}_MAX_AM _d _candidate_${class}_d${_d})
list(GET WITH_${class}_MAX_AM _d _max_am_${class}_d${_d})
endforeach()

list(JOIN WITH_${class}_MAX_AM "," _sam)
Expand All @@ -126,21 +127,13 @@ macro(process_integrals_class class)
set(${class}_MAX_AM_LIST "")
if (WITH_${class}_MAX_AM EQUAL -1)

set(_candidate_${class}_E ${_candidate0_${class}_E})
if (${INCLUDE_${class}} GREATER_EQUAL 1)
if (${_candidate0_${class}_G} EQUAL -1)
set(_candidate_${class}_G ${_candidate0_${class}_E})
foreach(_d RANGE 0 ${INCLUDE_${class}})
if (DEFINED _max_am_default_d${_d})
set(_candidate_max_am_${class}_d${_d} ${_max_am_default_d${_d}})
else()
set(_candidate_${class}_G ${_candidate0_${class}_G})
set(_candidate_max_am_${class}_d${_d} ${_max_am_default})
endif()
endif()
if (${INCLUDE_${class}} GREATER_EQUAL 2)
if (${_candidate0_${class}_H} EQUAL -1)
set(_candidate_${class}_H ${_candidate0_${class}_E})
else()
set(_candidate_${class}_H ${_candidate0_${class}_H})
endif()
endif()
endforeach()

if (${INCLUDE_${class}} GREATER_EQUAL 0)
set(${class}_MAX_AM ${LIBINT_MAX_AM})
Expand Down Expand Up @@ -211,7 +204,7 @@ foreach(_cls ERI2;ERI3;ERI4)
set(_lbl "${_lbl}_")

foreach (_deriv RANGE 0 ${INCLUDE_${_cls}})
foreach(_l RANGE 0 ${_candidate_${_cls}_d${_deriv}})
foreach(_l RANGE 0 ${_max_am_${_cls}_d${_deriv}})
list(APPEND Libint2_ERI_COMPONENTS "${_lbl}_d${_deriv}_l${_l}")
endforeach()
endforeach()
Expand Down

0 comments on commit d3694ca

Please sign in to comment.