|
MADNESS 0.10.1
|
#include <exchangeoperator.h>

Classes | |
| class | MacroTaskExchangeRow |
| class | MacroTaskExchangeSimple |
Public Types | |
| typedef Exchange< T, NDIM >::ExchangeAlgorithm | Algorithm |
Public Member Functions | |
| ExchangeImpl (World &world, const double lo, const double thresh) | |
| default ctor | |
| ExchangeImpl (World &world, const Nemo *nemo, const int ispin) | |
| ctor with a nemo calculation | |
| ExchangeImpl (World &world, const Nemo *nemo, const std::vector< Function< double, NDIM > > &R2mo, const int ispin) | |
| ctor with a nemo calculation whose bra R^2 F is already at hand; neither bra nor ket is copied | |
| ExchangeImpl (World &world, const SCF *calc, const int ispin) | |
| ctor with a conventional calculation | |
| nlohmann::json | gather_statistics () const |
| return some statistics about the current settings | |
| nlohmann::json | gather_timings (World &world) const |
| nlohmann::json | get_statistics () const |
| std::shared_ptr< MacroTaskQ > | get_taskq () const |
| World & | get_world () const |
| std::string | info () const |
| bool | is_symmetric () const |
| vecfuncT | operator() (const vecfuncT &vket) const |
| apply the exchange operator on a vector of functions | |
| void | print_timer (World &world) const |
| ExchangeImpl & | set_accumulation_mode (const int mode) |
| ExchangeImpl & | set_algorithm (const Algorithm &alg) |
| ExchangeImpl & | set_batch_granularity (const long level) |
| void | set_bra_and_ket (const vecfuncT &bra, const vecfuncT &ket) |
| set the bra and ket orbital spaces, and the occupation | |
| ExchangeImpl & | set_cost_aware_assignment (const bool flag) |
| ExchangeImpl & | set_macro_task_info (const MacroTaskInfo &info) |
| ExchangeImpl & | set_macro_task_info (const std::vector< std::string > &info) |
| ExchangeImpl & | set_printlevel (const long &level) |
| ExchangeImpl & | set_taskq (std::shared_ptr< MacroTaskQ > taskq1) |
| ExchangeImpl & | symmetric (const bool flag) |
Static Public Member Functions | |
| static auto | set_poisson (World &world, const double lo, const double econv=FunctionDefaults< 3 >::get_thresh()) |
Public Attributes | |
| Algorithm | algorithm_ = multiworld_efficient_row |
| MacroTaskInfo | macro_task_info = MacroTaskInfo::preset("default") |
Private Types | |
| typedef Function< T, NDIM > | functionT |
| typedef std::vector< functionT > | vecfuncT |
Private Member Functions | |
| vecfuncT | K_large_memory (const vecfuncT &vket, const double mul_tol=0.0) const |
| computing the upper triangle of the double sum (over vket and the K orbitals) | |
| vecfuncT | K_macrotask_efficient (const vecfuncT &vket, const double mul_tol=0.0) const |
| exchange using macrotasks, i.e. apply K on a function in individual worlds | |
| vecfuncT | K_macrotask_efficient_row (const vecfuncT &vket, const double mul_tol=0.0) const |
| exchange using macrotasks, i.e. apply K on a function in individual worlds row-wise | |
| vecfuncT | K_small_memory (const vecfuncT &vket, const double mul_tol=0.0) const |
| computing the full square of the double sum (over vket and the K orbitals) | |
| bool | printdebug () const |
| bool | printprogress () const |
| bool | printtimings () const |
| bool | printtimings_detail () const |
Static Private Member Functions | |
| static vecfuncT | compute_K_tile (World &world, const vecfuncT &mo_bra, const vecfuncT &mo_ket, const vecfuncT &vket, std::shared_ptr< real_convolution_3d > poisson, const bool symmetric, const double mul_tol=0.0) |
| computing the upper triangle of the double sum (over vket and the K orbitals) | |
| static void | reset_timer () |
Private Attributes | |
| int | accumulation_mode_ = 2 |
| long | batch_granularity_ = 1 |
| bool | cost_aware_assign_ = true |
| double | lo = 1.e-4 |
| vecfuncT | mo_bra |
| is the exchange matrix symmetric? K phi_i = \sum_k \phi_k \int \phi_k \phi_i | |
| vecfuncT | mo_ket |
| MOs for bra and ket. | |
| double | mul_tol = FunctionDefaults<NDIM>::get_thresh()*0.1 |
| long | printlevel = 0 |
| nlohmann::json | statistics |
| statistics of the Cloud (timings, memory) and of the parameters of this run | |
| bool | symmetric_ = false |
| std::shared_ptr< MacroTaskQ > | taskq |
| double | thresh = FunctionDefaults<NDIM>::get_thresh() |
| World & | world |
Static Private Attributes | |
| static std::atomic< long > | apply_timer |
| static double | elapsed_time |
| static std::atomic< long > | mul1_timer |
| timing | |
| static std::atomic< long > | mul2_timer |
| typedef Exchange<T,NDIM>::ExchangeAlgorithm madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::Algorithm |
|
private |
|
private |
|
inline |
default ctor
References lo, thresh, and world.
Referenced by ExchangeImpl(), ExchangeImpl(), set_accumulation_mode(), set_algorithm(), set_batch_granularity(), set_cost_aware_assignment(), set_macro_task_info(), set_macro_task_info(), set_printlevel(), set_taskq(), and symmetric().
| madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::ExchangeImpl | ( | World & | world, |
| const SCF * | calc, | ||
| const int | ispin ) |
ctor with a conventional calculation
References madness::SCF::amo, madness::SCF::aocc, madness::SCF::bmo, madness::SCF::bocc, madness::conj(), madness::convert(), lo, MADNESS_CHECK_THROW, madness::mo, mo_bra, mo_ket, param, madness::BaseTensor::size(), symmetric_, and world.
| madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::ExchangeImpl | ( | World & | world, |
| const Nemo * | nemo, | ||
| const int | ispin ) |
ctor with a nemo calculation
References ExchangeImpl(), madness::convert(), mo_bra, mo_ket, madness::mul(), madness::nemo, madness::truncate(), and world.
| madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::ExchangeImpl | ( | World & | world, |
| const Nemo * | nemo, | ||
| const std::vector< Function< double, NDIM > > & | R2mo, | ||
| const int | ispin ) |
ctor with a nemo calculation whose bra R^2 F is already at hand; neither bra nor ket is copied
References ExchangeImpl(), madness::convert(), MADNESS_CHECK_THROW, mo_bra, mo_ket, and world.
|
staticprivate |
computing the upper triangle of the double sum (over vket and the K orbitals)
References madness::apply(), apply_timer, madness::compress(), madness::cpu_time(), ij(), mo_bra, mo_ket, mul1_timer, mul2_timer, madness::mul_sparse(), mul_tol, madness::norm_tree(), madness::reconstruct(), symmetric(), madness::truncate(), world, madness::zero_functions(), and madness::zero_functions_compressed().
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_batch_in_asymmetric_matrix(), and K_large_memory().
|
inline |
return some statistics about the current settings
References algorithm_, gather_timings(), lo, macro_task_info, mul_tol, printlevel, symmetric_, thresh, madness::Exchange< T, NDIM >::to_string(), and world.
Referenced by operator()().
|
inline |
References apply_timer, madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::batch_cache_hits(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::batch_cache_misses(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::batch_prefetch_hits(), elapsed_time, mul1_timer, mul2_timer, and world.
Referenced by gather_statistics(), and print_timer().
|
inline |
References statistics.
|
inline |
References taskq.
|
inline |
References world.
|
inline |
Referenced by set_macro_task_info(), and set_macro_task_info().
|
inline |
References symmetric_.
|
private |
computing the upper triangle of the double sum (over vket and the K orbitals)
References compute_K_tile(), madness::Exchange< T, NDIM >::is_symmetric(), lo, mo_bra, mo_ket, mul_tol, set_poisson(), madness::truncate(), and world.
Referenced by operator()().
|
private |
exchange using macrotasks, i.e. apply K on a function in individual worlds
apply the exchange operator by tiling the exchange matrix
compute the matrix N_{ik} = N \phi_i \phi_k by tiles, with i,k \in batches A,B, do a local reduce within the tiles: K_{iB} = \sum_{k \in batch B} \phi_k N_{ik} and a universe-wide reduce of the tiles: K\phi_i = \sum_{batches B} K_{iB} saving up to half of the cpu time compared to the naive algorithm
| T | number type |
| NDIM | physical dimension of the argument vket |
| vf | argument of the exchange operator |
| mul_tol | cutoff parameter for sparse multiplication |
References accumulation_mode_, batch_granularity_, cost_aware_assign_, madness::exch_force_general_path(), madness::exchange_batch_salt(), madness::exchange_same_operands(), madness::Exchange< T, NDIM >::is_symmetric(), lo, mo_bra, mo_ket, mul_tol, madness::print(), printdebug(), printlevel, symmetric(), and world.
Referenced by operator()().
|
private |
exchange using macrotasks, i.e. apply K on a function in individual worlds row-wise
compute each row of the exchange matrix in different subworlds
References mul_tol.
Referenced by operator()().
|
private |
computing the full square of the double sum (over vket and the K orbitals)
was vtol
was vtol
References madness::apply(), madness::gaxpy(), lo, mo_bra, mo_ket, madness::mul_sparse(), mul_tol, set_poisson(), madness::truncate(), world, and madness::zero_functions_compressed().
Referenced by operator()().
| std::vector< Function< T, NDIM > > madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::operator() | ( | const vecfuncT & | vket | ) | const |
apply the exchange operator on a vector of functions
note that only one spin is used (either alpha or beta orbitals)
| [in] | vket | the orbitals |i> that the operator is applied on |
References algorithm_, elapsed_time, madness::Exchange< T, NDIM >::fetch_compute, gather_statistics(), madness::get_size(), K_large_memory(), K_macrotask_efficient(), K_macrotask_efficient_row(), K_small_memory(), madness::Exchange< T, NDIM >::large_memory, MADNESS_EXCEPTION, mo_bra, mo_ket, mul_tol, madness::Exchange< T, NDIM >::multiworld_efficient, madness::Exchange< T, NDIM >::multiworld_efficient_row, madness::norm_tree(), madness::print(), print_timer(), printdebug(), printtimings_detail(), madness::reconstruct(), reset_timer(), madness::Exchange< T, NDIM >::small_memory, statistics, madness::truncate(), madness::wall_time(), and world.
|
inline |
References gather_timings(), and world.
Referenced by operator()().
|
inlineprivate |
References printlevel.
Referenced by K_macrotask_efficient(), operator()(), printprogress(), and set_macro_task_info().
|
inlineprivate |
References printdebug(), and printlevel.
|
inlineprivate |
References printlevel.
|
inlineprivate |
References printlevel.
Referenced by operator()().
|
inlinestaticprivate |
|
inline |
References ExchangeImpl(), accumulation_mode_, and MADNESS_CHECK_THROW.
|
inline |
References ExchangeImpl(), and algorithm_.
|
inline |
References ExchangeImpl(), batch_granularity_, and MADNESS_CHECK_THROW.
|
inline |
set the bra and ket orbital spaces, and the occupation
| [in] | bra | bra space, must be provided as complex conjugate |
| [in] | ket | ket space |
References madness::copy(), mo_bra, mo_ket, and world.
|
inline |
References ExchangeImpl(), and cost_aware_assign_.
|
inline |
References ExchangeImpl(), info(), and macro_task_info.
|
inline |
References ExchangeImpl(), info(), macro_task_info, madness::print(), printdebug(), and world.
|
inlinestatic |
References madness::CoulombOperatorPtr(), madness::FunctionDefaults< NDIM >::get_thresh(), lo, and world.
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_batch_in_asymmetric_matrix(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_diagonal_batch_in_symmetric_matrix(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_offdiagonal_batch_in_symmetric_matrix(), K_large_memory(), K_small_memory(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row(), and madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row_fetch_compute().
|
inline |
References ExchangeImpl(), and printlevel.
|
inline |
References ExchangeImpl(), and taskq.
|
inline |
References ExchangeImpl(), and symmetric_.
Referenced by compute_K_tile(), and K_macrotask_efficient().
|
private |
how the tile results are gathered: 1 = subworld buffer then universe, 2 = also reduce within a node first (default; degrades to 1 on a single node)
Referenced by K_macrotask_efficient(), and set_accumulation_mode().
| Algorithm madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::algorithm_ = multiworld_efficient_row |
Referenced by gather_statistics(), operator()(), and set_algorithm().
|
inlinestaticprivate |
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_diagonal_batch_in_symmetric_matrix(), compute_K_tile(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_offdiagonal_batch_in_symmetric_matrix(), gather_timings(), reset_timer(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row(), and madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row_fetch_compute().
|
private |
batches per rank in the owner-pinned symmetric partition; 1 is the coarsest split and the one with the lowest peak memory
Referenced by K_macrotask_efficient(), and set_batch_granularity().
|
private |
place tasks by measured cost instead of by counting them; the first two applications still count, having no representative reference to measure against
Referenced by K_macrotask_efficient(), and set_cost_aware_assignment().
|
inlinestaticprivate |
Referenced by gather_timings(), operator()(), and reset_timer().
|
private |
Referenced by ExchangeImpl(), ExchangeImpl(), gather_statistics(), K_large_memory(), K_macrotask_efficient(), K_small_memory(), and set_poisson().
| MacroTaskInfo madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::macro_task_info = MacroTaskInfo::preset("default") |
Referenced by gather_statistics(), set_macro_task_info(), and set_macro_task_info().
|
private |
is the exchange matrix symmetric? K phi_i = \sum_k \phi_k \int \phi_k \phi_i
Referenced by ExchangeImpl(), ExchangeImpl(), ExchangeImpl(), compute_K_tile(), K_large_memory(), K_macrotask_efficient(), K_small_memory(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::operator()(), operator()(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row_fetch_compute(), set_bra_and_ket(), and madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::store_batches().
|
private |
MOs for bra and ket.
Referenced by ExchangeImpl(), ExchangeImpl(), ExchangeImpl(), compute_K_tile(), K_large_memory(), K_macrotask_efficient(), K_small_memory(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::operator()(), operator()(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row_fetch_compute(), set_bra_and_ket(), and madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::store_batches().
|
inlinestaticprivate |
timing
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_diagonal_batch_in_symmetric_matrix(), compute_K_tile(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_offdiagonal_batch_in_symmetric_matrix(), gather_timings(), reset_timer(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row(), and madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row_fetch_compute().
|
inlinestaticprivate |
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_diagonal_batch_in_symmetric_matrix(), compute_K_tile(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_offdiagonal_batch_in_symmetric_matrix(), gather_timings(), reset_timer(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row(), and madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row_fetch_compute().
|
private |
|
private |
Referenced by gather_statistics(), K_macrotask_efficient(), printdebug(), printprogress(), printtimings(), printtimings_detail(), and set_printlevel().
|
mutableprivate |
statistics of the Cloud (timings, memory) and of the parameters of this run
Referenced by get_statistics(), and operator()().
|
private |
Referenced by ExchangeImpl(), gather_statistics(), is_symmetric(), and symmetric().
|
private |
Referenced by get_taskq(), and set_taskq().
|
private |
Referenced by ExchangeImpl(), and gather_statistics().
|
private |
Referenced by ExchangeImpl(), ExchangeImpl(), ExchangeImpl(), ExchangeImpl(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::allocator(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::allocator(), compute_K_tile(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::ensure_cache_world(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::fetch_batch(), gather_statistics(), gather_timings(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::get_node_reducer(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::get_universe_reducer(), get_world(), K_large_memory(), K_macrotask_efficient(), K_small_memory(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::operator()(), operator()(), print_timer(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeRow::row_fetch_compute(), set_bra_and_ket(), set_macro_task_info(), set_poisson(), and madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::store_batches().