ergo
|
#include <cstring>
#include <vector>
#include <pthread.h>
#include "integrals_2el_exchange_prep.h"
#include "utilities.h"
#include "integrals_2el_utils.h"
Classes | |
struct | neighbor_basisfunc_struct |
struct | listsStruct |
struct | identify_needed_elements_thread_struct |
struct | distr_idxs_and_factor_struct |
Typedefs | |
typedef int * | intPtr |
Functions | |
static int | find_int_in_sorted_list (const int *list, int listLength, int i) |
static int | find_int_in_list (const int *list, int listLength, int i) |
static void | do_sort_int_list (int *list, int n) |
static int | find_doubles_in_sorted_list (const int *list, int n) |
static int | merge_lists (const int *list_1, int list_1_len, const int *list_2, int list_2_len, int *resultList) |
static int | identify_needed_elements_part (ergo_real threshold, const csr_matrix_struct *dens_CSR, const int noOfNeighborsList[], const neighbor_basisfunc_struct *neighborList, const int maxNoOfNeighbors, int **longList, int *longListCounterList, int myIndex, int noOfParts) |
static void * | identify_needed_elements_thread_func (void *arg) |
static int | identify_needed_elements (ergo_real threshold, const csr_matrix_struct *dens_CSR, const int noOfNeighborsList[], const neighbor_basisfunc_struct *neighborList, int maxNoOfNeighbors, int **longList, int *longListCounterList, int nThreads) |
Tries to predict which elements of K will be needed. | |
static int | compare_distr_idxs_and_factor_structs (const void *p1in, const void *p2in) |
int | create_CSR_for_K (const BasisInfoStruct &basisInfo, const IntegralInfo *integralInfo, const JK::Params &J_K_params, csr_matrix_struct *dens_CSR, csr_matrix_struct *K_CSR, int symmetryFlag) |
typedef int* intPtr |
static int compare_distr_idxs_and_factor_structs | ( | const void * | p1in, |
const void * | p2in | ||
) | [static] |
References distr_idxs_and_factor_struct::i1, distr_idxs_and_factor_struct::i2, and distr_idxs_and_factor_struct::limitingFactor.
Referenced by create_CSR_for_K().
int create_CSR_for_K | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo * | integralInfo, | ||
const JK::Params & | J_K_params, | ||
csr_matrix_struct * | dens_CSR, | ||
csr_matrix_struct * | K_CSR, | ||
int | symmetryFlag | ||
) |
References BasisInfoStruct::noOfBasisFuncs, do_output(), LOG_CAT_INFO, LOG_AREA_INTEGRALS, JK::Params::threshold_K, output_current_memory_usage(), ergo_CSR_get_max_abs_element(), get_list_of_labeled_distrs_maxLimitingFactor(), LOG_CAT_ERROR, get_list_of_labeled_distrs(), DistributionSpecStructLabeled::basisFuncIndex_1, DistributionSpecStructLabeled::basisFuncIndex_2, DistributionSpecStructLabeled::limitingFactor, compare_distr_idxs_and_factor_structs(), distr_idxs_and_factor_struct::i1, distr_idxs_and_factor_struct::i2, distr_idxs_and_factor_struct::limitingFactor, neighbor_basisfunc_struct::i, neighbor_basisfunc_struct::max_CS_factor, identify_needed_elements(), JK::Params::noOfThreads_K, and ergo_CSR_create().
Referenced by compute_K_by_boxes_sparse(), and compute_K_by_boxes_sparse_nosymm().
static void do_sort_int_list | ( | int * | list, |
int | n | ||
) | [static] |
Referenced by identify_needed_elements_part().
static int find_doubles_in_sorted_list | ( | const int * | list, |
int | n | ||
) | [static] |
Referenced by identify_needed_elements_part().
static int find_int_in_list | ( | const int * | list, |
int | listLength, | ||
int | i | ||
) | [static] |
Referenced by identify_needed_elements_part().
static int find_int_in_sorted_list | ( | const int * | list, |
int | listLength, | ||
int | i | ||
) | [static] |
Referenced by identify_needed_elements_part().
static int identify_needed_elements | ( | ergo_real | threshold, |
const csr_matrix_struct * | dens_CSR, | ||
const int | noOfNeighborsList[], | ||
const neighbor_basisfunc_struct * | neighborList, | ||
int | maxNoOfNeighbors, | ||
int ** | longList, | ||
int * | longListCounterList, | ||
int | nThreads | ||
) | [static] |
Tries to predict which elements of K will be needed.
Use two different lists, a "long list" and a "short list" for each row of K. The "long list" is always sorted so that we can quickly check if a column index is already present.
References identify_needed_elements_part(), csr_matrix_struct::n, identify_needed_elements_thread_struct::threshold, identify_needed_elements_thread_struct::maxNoOfNeighbors, identify_needed_elements_thread_struct::longList, identify_needed_elements_thread_struct::longListCounterList, identify_needed_elements_thread_struct::thread_ID, identify_needed_elements_thread_struct::nThreads, identify_needed_elements_thread_func(), do_output(), LOG_CAT_ERROR, LOG_AREA_INTEGRALS, LOG_CAT_INFO, and merge_lists().
Referenced by create_CSR_for_K().
static int identify_needed_elements_part | ( | ergo_real | threshold, |
const csr_matrix_struct * | dens_CSR, | ||
const int | noOfNeighborsList[], | ||
const neighbor_basisfunc_struct * | neighborList, | ||
const int | maxNoOfNeighbors, | ||
int ** | longList, | ||
int * | longListCounterList, | ||
int | myIndex, | ||
int | noOfParts | ||
) | [static] |
References csr_matrix_struct::n, ergo_CSR_get_element(), neighbor_basisfunc_struct::i, neighbor_basisfunc_struct::max_CS_factor, find_int_in_sorted_list(), find_int_in_list(), do_sort_int_list(), find_doubles_in_sorted_list(), do_output(), LOG_CAT_ERROR, LOG_AREA_INTEGRALS, and merge_lists().
Referenced by identify_needed_elements_thread_func(), and identify_needed_elements().
static void* identify_needed_elements_thread_func | ( | void * | arg | ) | [static] |
References identify_needed_elements_thread_struct::resultCode, identify_needed_elements_part(), identify_needed_elements_thread_struct::threshold, identify_needed_elements_thread_struct::dens_CSR, identify_needed_elements_thread_struct::noOfNeighborsList, identify_needed_elements_thread_struct::neighborList, identify_needed_elements_thread_struct::maxNoOfNeighbors, identify_needed_elements_thread_struct::longList, identify_needed_elements_thread_struct::longListCounterList, identify_needed_elements_thread_struct::thread_ID, and identify_needed_elements_thread_struct::nThreads.
Referenced by identify_needed_elements().
static int merge_lists | ( | const int * | list_1, |
int | list_1_len, | ||
const int * | list_2, | ||
int | list_2_len, | ||
int * | resultList | ||
) | [static] |
Referenced by identify_needed_elements_part(), and identify_needed_elements().