ergo
|
Grid Generator interface. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include "dft_common.h"
#include "grid_reader.h"
#include "grid_stream.h"
#include "grid_hicu.h"
#include "grid_matrix.h"
Classes | |
class | FullMatrixWrapper |
class | SparseMatrixWrapper |
struct | DftGridReader |
Macros | |
#define | GRID_BASE_NAME "ERGO-grid" |
#define | GRID_PATT_NAME "ERGO-patt" |
Functions | |
Dft::Matrix * | createGridMatrix (const Dft::FullMatrix &mat) |
Dft::Matrix * | createGridMatrix (const Dft::SparseMatrix &mat) |
static char * | grid_get_fname (const char *base, int filenum) |
void | grid_set_tmpdir (const char *tmpdir) |
void | grid_free_files () |
Frees all the cached data if any. More... | |
static void | grid_atexit (void) |
bool | grid_is_ready () |
static void | grid_open_stream (const class GridGenMolInfo &molInfo, const Dft::GridParams &gss, Dft::SparsePattern *pattern, DftGridReader *reader) |
static void | grid_open_cartesian (const BasisInfoStruct &bis, const Dft::GridParams &gss, const Dft::Matrix *dmat, Dft::SparsePattern *pattern, DftGridReader *reader) |
DftGridReader * | grid_open_full (const class GridGenMolInfo *mol_info, const Dft::GridParams &gss, Dft::SparsePattern *pattern, const Dft::Matrix *dmat, const BasisInfoStruct &bis) |
Returns a handle to a grid file. More... | |
int | grid_getchunk_blocked (DftGridReader *rawgrid, int maxlen, int *nBlocks, int *shlBlocks, real(*coor)[3], real *weight) |
grid_getchunk_blocked() reads grid data also with screening information if only nblocks and shlblocks are provided. More... | |
void | grid_close (DftGridReader *rawgrid) |
Closes the shared grid handle that is specifed as the argument. More... | |
Variables | |
std::string | grid_tmpdir |
static FILE * | grid_file = NULL |
static int | grid_file_open_count = 0 |
static char * | grid_file_name = NULL |
static char * | patt_file_name = NULL |
static pthread_mutex_t | grid_mutex = PTHREAD_MUTEX_INITIALIZER |
static pthread_mutex_t | grdone_mutex = PTHREAD_MUTEX_INITIALIZER |
static int | grid_atexit_registered = 0 |
static const int | MY_MPI_NUM = 0 |
Grid Generator interface.
Functions for opening grid file, reading chunks from it, and closing the file, are provided.
#define GRID_BASE_NAME "ERGO-grid" |
Referenced by grid_open_cartesian(), and grid_open_stream().
#define GRID_PATT_NAME "ERGO-patt" |
Referenced by grid_open_cartesian(), and grid_open_stream().
Dft::Matrix* createGridMatrix | ( | const Dft::FullMatrix & | mat | ) |
Referenced by dft_integrate(), and XCEvaluator::XCEvaluator().
Dft::Matrix* createGridMatrix | ( | const Dft::SparseMatrix & | mat | ) |
|
static |
References grid_free_files().
Referenced by grid_open_full().
void grid_close | ( | DftGridReader * | rawgrid | ) |
Closes the shared grid handle that is specifed as the argument.
References free(), grid_file, grid_file_open_count, and grid_mutex.
Referenced by dft_integrate(), grid_test_synchronisation(), and XCEvaluator::XCEvaluator().
void grid_free_files | ( | ) |
Frees all the cached data if any.
References free(), grid_file_name, and patt_file_name.
Referenced by Vxc_worker::ComputeMatrix(), es_getexc(), es_run(), grid_atexit(), grid_test_synchronisation(), small_calculation(), test_mol(), and test_small().
|
static |
References grid_tmpdir, and malloc().
Referenced by grid_open_cartesian(), and grid_open_stream().
int grid_getchunk_blocked | ( | DftGridReader * | rawgrid, |
int | maxlen, | ||
int * | nBlocks, | ||
int * | shlBlocks, | ||
real(*) | coor[3], | ||
real * | weight | ||
) |
grid_getchunk_blocked() reads grid data also with screening information if only nblocks and shlblocks are provided.
rawgrid | shared grid handle. |
maxlen | the upper limit on the grid point chunk length. |
nBlocks | will contain number of active b.f. blocks. May be NULL if uninteresting. |
shlBlocks | pointer to the shell block range. |
coor | array with grid point coordinates. |
weight | array with grid point weights. |
References DftGridReader::f, and grid_mutex.
Referenced by dft_integrate(), and grid_test_synchronisation().
bool grid_is_ready | ( | ) |
References grid_file_name.
Referenced by XCEvaluator::XCEvaluator().
|
static |
References Dft::HiCuGridParams::box_size, Dft::HiCuGridParams::compare_to_refined, dft_get_num_threads(), Dft::HiCuGridParams::do_double_checking, Dft::HiCuGridParams::do_variation_checking, DftGridReader::f, free(), grdone_mutex, GRID_BASE_NAME, grid_file, grid_file_name, grid_file_open_count, grid_get_fname(), GRID_PATT_NAME, hicu_grid_generate(), Dft::GridParams::hicuParams, Dft::HiCuGridParams::maxError, MY_MPI_NUM, patt_file_name, Dft::HiCuGridParams::start_box_size_debug, Dft::HiCuGridParams::use_energy_criterion, Dft::HiCuGridParams::use_energy_criterion_only, and Dft::HiCuGridParams::use_error_per_volume.
Referenced by grid_open_full().
DftGridReader* grid_open_full | ( | const class GridGenMolInfo * | mol_info, |
const Dft::GridParams & | gss, | ||
Dft::SparsePattern * | pattern, | ||
const Dft::Matrix * | dmat, | ||
const BasisInfoStruct & | bis | ||
) |
Returns a handle to a grid file.
Sets the sparse pattern if passed. Observe that sparse pattern must be passed the first time to get generated. Otherwise, subsequent calls will not be able to set it.
References dal_new, free(), grid_atexit(), grid_atexit_registered, grid_open_cartesian(), grid_open_stream(), Dft::GridParams::gridType, Dft::GridParams::TYPE_HICU, and Dft::GridParams::TYPE_STANDARD.
Referenced by dft_integrate(), grid_test_synchronisation(), and XCEvaluator::XCEvaluator().
|
static |
References dft_get_num_threads(), DftGridReader::f, free(), grdone_mutex, GRID_BASE_NAME, grid_file, grid_file_name, grid_file_open_count, grid_get_fname(), GRID_PATT_NAME, grid_stream_free(), grid_stream_generate(), grid_stream_new(), grid_stream_set_sparse_pattern(), MY_MPI_NUM, and patt_file_name.
Referenced by grid_open_full().
void grid_set_tmpdir | ( | const char * | tmpdir | ) |
References grid_tmpdir.
Referenced by es_run(), main(), test_mol(), and test_small().
|
static |
Referenced by grid_open_cartesian(), and grid_open_stream().
|
static |
Referenced by grid_open_full().
|
static |
Referenced by grid_close(), grid_open_cartesian(), and grid_open_stream().
|
static |
Referenced by grid_free_files(), grid_is_ready(), grid_open_cartesian(), grid_open_stream(), grid_test_scaling(), and hicu_grid_generate().
|
static |
Referenced by grid_close(), grid_open_cartesian(), and grid_open_stream().
|
static |
Referenced by grid_close(), and grid_getchunk_blocked().
std::string grid_tmpdir |
Referenced by grid_get_fname(), and grid_set_tmpdir().
|
static |
Referenced by grid_open_cartesian(), and grid_open_stream().
|
static |
Referenced by grid_free_files(), grid_open_cartesian(), and grid_open_stream().