ergo
|
Code for computing the Coulomb matrix J. More...
#include <cstring>
#include <cstdio>
#include <cassert>
#include <pthread.h>
#include "integrals_2el_J_kernel.h"
#include "integrals_2el_J.h"
#include "integrals_2el_utils.h"
#include "mm_limit_table.h"
#include "basis_func_pair_list.h"
#include "integrals_2el_repeating.h"
#include "integrals_hermite.h"
#include "integrals_general.h"
#include "utilities.h"
#include "pi.h"
#include "integrals_2el_util_funcs.h"
#include "integrals_2el_J_mm_utils.h"
#include "integrals_2el_J_mm_kernel.h"
Classes | |
struct | job_list_standard_entry_J_struct |
struct | job_list_multipole_entry_J_struct |
struct | J_std_joblist_thread_struct |
struct | JFMMWorkerData |
Functions | |
static int | add_multipole_jobs_for_2_boxes_branches_recursive (int multipoleBoxIndex, int multipoleBranchIndex, const box_struct *boxList, int boxIndex, int branchIndex, int numberOfLevels, int currLevel, job_list_multipole_entry_J_struct *jobList_multipole, int maxNoOfJobs_multipole) |
static int | get_joblists_J_for_two_boxes_recursive (const IntegralInfo &integralInfo, ergo_real threshold, const box_struct *boxList, int numberOfLevels, int currLevel, int boxIndex_1, int boxIndex_2, int branchIndex_1, int branchIndex_2, job_list_standard_entry_J_struct *jobList_standard, int maxNoOfJobs_standard, int *noOfNewJobs_standard, job_list_multipole_entry_J_struct *jobList_multipole, int maxNoOfJobs_multipole, int *noOfNewJobs_multipole) |
static int | get_list_of_labeled_distrs_maxLimitingFactor_linear (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, ergo_real threshold, const basis_func_index_pair_struct *basisFuncIndexPairList, int basisFuncIndexPairCount, ergo_real *resultMaxLimitingFactor) |
static int | get_list_of_labeled_distrs_linear (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, ergo_real threshold, DistributionSpecStructLabeled *resultList, int maxCountDistrs, ergo_real maxLimitingFactor, const basis_func_index_pair_struct *basisFuncIndexPairList, int basisFuncIndexPairCount, const ergo_real *D_list) |
static int | compare_multipole_jobs (const void *p1, const void *p2) |
static void | get_largest_and_smallest_extent_for_list_of_distributions (int n, const DistributionSpecStructLabeled *distrList, ergo_real *result_extent_min, ergo_real *result_extent_max) |
static int | get_branch_splitter_info (ergo_real *branchSplitterList, int maxNoOfBranches, const JK::Params &J_K_params, ergo_real toplevelBoxSize, ergo_real extent_max) |
static int | create_branches (int noOfBranches, const ergo_real *branchSplitterList, int distrCount, DistributionSpecStructLabeled *distrListOrdered, int noOfBoxesTopLevel, box_struct *boxListTopLevel) |
static int | execute_joblist_J_std_serial (int noOfJobs_J_standard, const job_list_standard_entry_J_struct *jobList_J_standard, const IntegralInfo &integralInfo, int maxNoOfMonomials, ergo_real *result_J_list, const box_struct *boxList, ergo_real threshold) |
static void * | execute_joblist_J_std_thread_func (void *arg) |
static int | execute_joblist_J_std_threaded (int noOfThreads, int noOfJobs_J_standard, const job_list_standard_entry_J_struct *jobList_J_standard, const IntegralInfo &integralInfo, int maxNoOfMonomials, ergo_real *result_J_list, int noOfBasisFuncIndexPairs, const box_struct *boxList, ergo_real threshold) |
static int | sort_list_of_multipole_jobs_fixed_boxIndex (job_list_multipole_entry_J_struct *jobList, int n) |
static int | sort_list_of_multipole_jobs (std::vector< job_list_multipole_entry_J_struct > &jobList, int n) |
static int | execute_joblist_J_fmm_shared (int jobIndexLo, int jobIndexHi, const IntegralInfo &integralInfo, const JK::Params &J_K_params, const job_list_multipole_entry_J_struct *jobList_J_multipole, const box_struct *boxList, int maxnoOfMinimalDistrsPerBoxBranch, ergo_real *result_J_list, int *largest_L_used) |
executes given jobList using FMM. More... | |
static int | execute_joblist_J_fmm_serial (const IntegralInfo &integralInfo, const JK::Params &J_K_params, int noOfJobs_J_multipole, const job_list_multipole_entry_J_struct *jobList_J_multipole, const box_struct *boxList, int maxnoOfMinimalDistrsPerBoxBranch, ergo_real *result_J_list) |
static void * | execute_J_fmm_worker (void *arg) |
static int | execute_joblist_J_fmm_thread (int noOfThreads, int noOfBasisFuncIndexPairs, const IntegralInfo &integralInfo, const JK::Params &J_K_params, int noOfJobs_J_multipole, const job_list_multipole_entry_J_struct *jobList_J_multipole, const box_struct *boxList, int maxnoOfMinimalDistrsPerBoxBranch, ergo_real *result_J_list) |
Compute the FMM part of the Coulomb matrix using threads. More... | |
int | compute_J_by_boxes_linear (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const JK::Params &J_K_params, const basis_func_index_pair_struct *basisFuncIndexPairList, int basisFuncIndexPairCount, const ergo_real *D_list, ergo_real *result_J_list, int noOfBasisFuncIndexPairs) |
Computes the Coulomb interaction. More... | |
int | compute_J_by_boxes (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const JK::Params &J_K_params, ergo_real *J, const ergo_real *dens) |
int | compute_J_by_boxes_nosymm (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const JK::Params &J_K_params, ergo_real *J, const ergo_real *dens) |
Variables | |
static const int | HUGE_INTEGER_NUMBER = 2000000000 |
Code for computing the Coulomb matrix J.
|
static |
References box_struct::basicBox, job_list_multipole_entry_J_struct::boxIndex, job_list_multipole_entry_J_struct::branchIndex, do_output(), box_struct_basic::firstChildBoxIndex, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, job_list_multipole_entry_J_struct::multipoleBoxIndex, job_list_multipole_entry_J_struct::multipoleBranchIndex, and box_struct_basic::noOfChildBoxes.
Referenced by get_joblists_J_for_two_boxes_recursive().
|
static |
int compute_J_by_boxes | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const JK::Params & | J_K_params, | ||
ergo_real * | J, | ||
const ergo_real * | dens | ||
) |
References compute_J_by_boxes_linear(), do_output(), get_basis_func_pair_list_2el(), get_max_abs_vector_element(), LOG_AREA_INTEGRALS, LOG_CAT_ERROR, LOG_CAT_INFO, BasisInfoStruct::noOfBasisFuncs, and JK::Params::threshold_J.
Referenced by compute_2e_matrix_coulomb(), and compute_J_by_boxes_nosymm().
int compute_J_by_boxes_linear | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const JK::Params & | J_K_params, | ||
const basis_func_index_pair_struct * | basisFuncIndexPairList, | ||
int | basisFuncIndexPairCount, | ||
const ergo_real * | D_list, | ||
ergo_real * | result_J_list, | ||
int | noOfBasisFuncIndexPairs | ||
) |
Computes the Coulomb interaction.
basisInfo | |
integralInfo | |
J_K_params | the evaluation parameters, thresholds and all. |
basisFuncIndexPairList | |
basisFuncIndexPairCount | the length of basisFuncIndexPairList. |
D_list | basisFuncIndexPairCount elements, with indices matching basisFuncIndexPairList. |
result_J_list | preallocated list that will contain the results. |
noOfBasisFuncIndexPairs | the length of result_J_list. happens to be always equal to basisFuncIndexPairCount |
References box_struct::basicBox, BoxSystem::boxList, box_struct::branchCountListForJ, box_struct::branchIndexListForJ, box_struct::branchListForJ, distr_org_mm_struct::Data::chargeSum, combine_mm_info_for_child_boxes(), compute_extent_for_list_of_distributions(), create_box_system_and_reorder_distrs(), create_branches(), distr_org_mm_struct::data, distr_org_struct::data, do_output(), execute_joblist_J_fmm_serial(), execute_joblist_J_fmm_thread(), execute_joblist_J_std_serial(), execute_joblist_J_std_threaded(), box_struct_basic::firstChildBoxIndex, JK::Params::fmm_box_size, generate_multipoles_for_groups(), get_branch_splitter_info(), get_joblists_J_for_two_boxes_recursive(), get_largest_and_smallest_extent_for_list_of_distributions(), get_list_of_labeled_distrs_linear(), get_list_of_labeled_distrs_maxLimitingFactor_linear(), get_max_abs_vector_element(), get_multipole_pt_for_box(), IntegralInfo::GetMultipolePrep(), distr_org_struct::groupList, HUGE_INTEGER_NUMBER, BoxSystem::levelList, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, LOG_CAT_INFO, MAX_MULTIPOLE_DEGREE, MAX_NO_OF_BRANCHES, distr_org_struct::Data::maxNoOfMonomials, distr_org_struct::minimalDistrList, BasisInfoStruct::noOfBasisFuncs, box_level_struct::noOfBoxes, box_struct_basic::noOfChildBoxes, BoxSystem::noOfLevels, JK::Params::noOfThreads_J, distr_list_description_struct::org, distr_list_description_struct::org_mm, organize_distributions(), output_current_memory_usage(), Util::TimeMeter::print(), sort_list_of_multipole_jobs(), box_level_struct::startIndexInBoxList, JK::Params::threshold_J, BoxSystem::totNoOfBoxes, translate_multipoles_for_box(), JK::Params::use_fmm, and box_struct_basic::width.
Referenced by compute_J_by_boxes(), and compute_J_by_boxes_sparse().
int compute_J_by_boxes_nosymm | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const JK::Params & | J_K_params, | ||
ergo_real * | J, | ||
const ergo_real * | dens | ||
) |
References compute_J_by_boxes(), and BasisInfoStruct::noOfBasisFuncs.
Referenced by ErgoE2Evaluator::transform().
|
static |
References box_struct::basicBox, DistributionSpecStruct::centerCoords, DistributionSpecStructLabeled::distr, do_output(), DistributionSpecStruct::extent, box_struct_basic::firstItemIndex, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, MAX_NO_OF_BRANCHES, box_struct_basic::noOfItems, output_current_memory_usage(), and template_blas_fabs().
Referenced by compute_J_by_boxes_linear().
|
static |
References JFMMWorkerData::boxList, execute_joblist_J_fmm_shared(), JFMMWorkerData::integralInfo, JFMMWorkerData::J_K_params, JFMMWorkerData::jobIndexHi, JFMMWorkerData::jobIndexLo, JFMMWorkerData::jobList_J_multipole, JFMMWorkerData::largest_L_used, JFMMWorkerData::maxnoOfMinimalDistrsPerBoxBranch, JFMMWorkerData::result, and JFMMWorkerData::result_J_list.
Referenced by execute_joblist_J_fmm_thread().
|
static |
References do_output(), execute_joblist_J_fmm_shared(), LOG_AREA_INTEGRALS, LOG_CAT_INFO, and Util::TimeMeter::print().
Referenced by compute_J_by_boxes_linear().
|
static |
executes given jobList using FMM.
jobIndexLo | the first jobindex for which this thread is responsible. |
jobIndexHi | the last jobindex for which this thread is responsible is jobIndexHi-1. |
integralInfo | info needed for evaluation of integrals of Gaussian functions. |
J_K_params | includes various parameters for J and K matrix construction. |
jobList_J_multipole | list of multipole-jobs. |
boxList | list of boxes. |
maxnoOfMinimalDistrsPerBoxBranch | needed to determine size of work buffer. |
result_J_list | the list of matrix elements to be updated. |
largest_L_used | largest L-value used (output). |
References job_list_multipole_entry_J_struct::boxIndex, job_list_multipole_entry_J_struct::branchIndex, box_struct::branchListForJ, create_list_of_multipoles_for_box(), distr_org_mm_struct::data, do_multipole_interaction_between_2_boxes_branches(), do_output(), IntegralInfo::GetMMLimitTable(), IntegralInfo::GetMultipolePrep(), LOG_AREA_INTEGRALS, LOG_CAT_ERROR, LOG_CAT_INFO, MAX_NO_OF_MOMENTS_PER_MULTIPOLE, multipole_struct_large::momentList, distr_org_mm_struct::Data::multipole, JK::Params::multipole_threshold_factor, job_list_multipole_entry_J_struct::multipoleBoxIndex, job_list_multipole_entry_J_struct::multipoleBranchIndex, distr_list_description_struct::org_mm, output_current_memory_usage(), setup_multipole_maxAbsMomentList(), and JK::Params::threshold_J.
Referenced by execute_J_fmm_worker(), and execute_joblist_J_fmm_serial().
|
static |
Compute the FMM part of the Coulomb matrix using threads.
0th thread reuses result_J_list, all the other threads need to have temporary memory allocated.
References do_output(), execute_J_fmm_worker(), LOG_AREA_INTEGRALS, LOG_CAT_ERROR, LOG_CAT_INFO, and Util::TimeMeter::print().
Referenced by compute_J_by_boxes_linear().
|
static |
References allocate_buffers_needed_by_integral_code(), job_list_standard_entry_J_struct::boxIndex_1, job_list_standard_entry_J_struct::boxIndex_2, job_list_standard_entry_J_struct::branchIndex_1, job_list_standard_entry_J_struct::branchIndex_2, do_output(), free_buffers_needed_by_integral_code(), get_J_contribs_from_2_interacting_boxes(), LOG_AREA_INTEGRALS, LOG_CAT_ERROR, and Util::TimeMeter::print().
Referenced by compute_J_by_boxes_linear().
|
static |
References allocate_buffers_needed_by_integral_code(), job_list_standard_entry_J_struct::boxIndex_1, job_list_standard_entry_J_struct::boxIndex_2, J_std_joblist_thread_struct::boxList, job_list_standard_entry_J_struct::branchIndex_1, job_list_standard_entry_J_struct::branchIndex_2, box_struct::branchListForJ, do_output(), free_buffers_needed_by_integral_code(), get_J_contribs_from_2_interacting_boxes(), J_std_joblist_thread_struct::integralInfo, J_std_joblist_thread_struct::jobList_J_standard, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, J_std_joblist_thread_struct::maxNoOfMonomials, J_std_joblist_thread_struct::noOfJobs_J_standard, J_std_joblist_thread_struct::noOfThreads, distr_list_description_struct::org, J_std_joblist_thread_struct::result_J_list, J_std_joblist_thread_struct::resultCode, J_std_joblist_thread_struct::thread_ID, and J_std_joblist_thread_struct::threshold.
Referenced by execute_joblist_J_std_threaded().
|
static |
References J_std_joblist_thread_struct::boxList, do_output(), execute_joblist_J_std_thread_func(), J_std_joblist_thread_struct::integralInfo, J_std_joblist_thread_struct::jobList_J_standard, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, LOG_CAT_INFO, J_std_joblist_thread_struct::maxNoOfMonomials, J_std_joblist_thread_struct::noOfJobs_J_standard, J_std_joblist_thread_struct::noOfThreads, output_current_memory_usage(), Util::TimeMeter::print(), J_std_joblist_thread_struct::result_J_list, J_std_joblist_thread_struct::resultCode, and J_std_joblist_thread_struct::threshold.
Referenced by compute_J_by_boxes_linear().
|
static |
References do_output(), JK::Params::fmm_branch_splitter_extent_1, JK::Params::fmm_branch_splitter_extent_2, JK::Params::fmm_branch_splitter_extent_3, JK::Params::fmm_branch_splitter_extent_4, JK::Params::fmm_branch_splitter_extent_5, JK::Params::fmm_no_of_branches, LOG_AREA_INTEGRALS, and LOG_CAT_ERROR.
Referenced by compute_J_by_boxes_linear().
|
static |
References add_multipole_jobs_for_2_boxes_branches_recursive(), box_struct::basicBox, job_list_standard_entry_J_struct::boxIndex_1, job_list_standard_entry_J_struct::boxIndex_2, job_list_standard_entry_J_struct::branchIndex_1, job_list_standard_entry_J_struct::branchIndex_2, box_struct::branchListForJ, box_struct_basic::centerCoords, check_if_multipoles_can_be_used(), do_output(), box_struct_basic::firstChildBoxIndex, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, box_struct_basic::noOfChildBoxes, distr_list_description_struct::org, distr_list_description_struct::org_mm, template_blas_fabs(), and box_struct_basic::width.
Referenced by compute_J_by_boxes_linear().
|
static |
References DistributionSpecStructLabeled::distr, and DistributionSpecStruct::extent.
Referenced by compute_J_by_boxes_linear().
|
static |
References DistributionSpecStructLabeled::basisFuncIndex_1, DistributionSpecStructLabeled::basisFuncIndex_2, DistributionSpecStructLabeled::distr, DistributionSpecStructLabeled::dmatElement, IntegratorWithMemory::do_2e_integral(), do_output(), get_max_abs_vector_element(), get_product_simple_primitives(), basis_func_index_pair_struct::index_1, basis_func_index_pair_struct::index_2, DistributionSpecStructLabeled::limitingFactor, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, DistributionSpecStructLabeled::pairIndex, POLY_PRODUCT_MAX_DISTRS, and template_blas_sqrt().
Referenced by compute_J_by_boxes_linear().
|
static |
References IntegratorWithMemory::do_2e_integral(), do_output(), get_product_simple_primitives(), basis_func_index_pair_struct::index_1, basis_func_index_pair_struct::index_2, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, POLY_PRODUCT_MAX_DISTRS, and template_blas_sqrt().
Referenced by compute_J_by_boxes_linear().
|
static |
References do_output(), LOG_AREA_INTEGRALS, LOG_CAT_ERROR, Util::TimeMeter::print(), and sort_list_of_multipole_jobs_fixed_boxIndex().
Referenced by compute_J_by_boxes_linear().
|
static |
References job_list_multipole_entry_J_struct::branchIndex, compare_multipole_jobs(), do_output(), LOG_AREA_INTEGRALS, and LOG_CAT_ERROR.
Referenced by sort_list_of_multipole_jobs().
|
static |
Referenced by compute_J_by_boxes_linear().