|
Collective Variables Module - Developer Documentation
|
Class for managing the GPU calculation of CVCs. More...
#include <colvar_gpu_calc.h>

Classes | |
| class | compute_gpu_graph_t |
| A struct for holding a CUDA graph and its execution object. More... | |
| struct | compute_node_t |
| A struct for holding a compute node in the CUDA graph and its corresponding atom group or CVC (child of colvardeps) More... | |
Public Member Functions | |
| colvarmodule_gpu_calc () | |
| Constructor. | |
| ~colvarmodule_gpu_calc () | |
| Destructor. | |
| int | init () |
| Initialize all the GPU compute graphs. More... | |
| int | calc_cvs (const std::vector< colvar * > &colvars, colvarmodule *colvar_module) |
Calculate the colvar {...} blocks. More... | |
| int | apply_forces (const std::vector< colvar * > &colvars, colvarmodule *colvar_module) |
| Apply the forces to the atom groups from the CVCs. More... | |
Private Member Functions | |
Internal functions used in calc_cvs() | |
| int | cv_update_flags (const std::vector< colvar * > &colvars) |
| int | cvc_calc_total_force (const std::vector< colvar * > &colvars, colvarmodule *colvar_module, bool use_current_step=false) |
| int | atom_group_read_data_gpu (const std::vector< colvar * > &colvars, colvarmodule_gpu_calc::compute_gpu_graph_t &g, colvarmodule *colvar_module) |
| int | cvc_calc_value (const std::vector< colvar * > &colvars, colvarmodule *colvar_module) |
| int | cvc_calc_gradients (const std::vector< colvar * > &colvars, colvarmodule *colvar_module) |
| int | atom_group_calc_fit_gradients (const std::vector< colvar * > &colvars, colvarmodule_gpu_calc::compute_gpu_graph_t &g, colvarmodule *colvar_module) |
| int | cvc_debug_gradients (const std::vector< colvar * > &colvars, colvarmodule *colvar_module) |
| int | cvc_calc_Jacobian_derivative (const std::vector< colvar * > &colvars, colvarmodule *colvar_module) |
| int | cv_collect_cvc_data (const std::vector< colvar * > &colvars, colvarmodule *colvar_module) |
Private Attributes | |
| compute_gpu_graph_t | read_data_compute |
| CUDA graph for reading data to GPU and calculating required properties. | |
| compute_gpu_graph_t | calc_fit_gradients_compute |
| CUDA graph for calculating fit gradients. | |
| compute_gpu_graph_t | apply_forces_compute |
| CUDA graph for applying forces to atom groups. | |
| std::vector< colvardeps * > | forced_atom_groups |
| A list of atom groups that require forces to be applied. More... | |
Timers for profiling | |
| colvars_gpu::colvar_nvtx_prof | ag_read_data_prof |
| colvars_gpu::colvar_nvtx_prof | cvc_calc_value_prof |
| colvars_gpu::colvar_nvtx_prof | cvc_calc_gradients_prof |
| colvars_gpu::colvar_nvtx_prof | ag_calc_fit_gradients_prof |
| colvars_gpu::colvar_nvtx_prof | cvc_calc_Jacobian_derivative_prof |
| colvars_gpu::colvar_nvtx_prof | cvc_calc_total_force_prof |
| colvars_gpu::colvar_nvtx_prof | cv_collect_cvc_data_prof |
| colvars_gpu::colvar_nvtx_prof | apply_forces_prof |
Class for managing the GPU calculation of CVCs.
| int colvarmodule_gpu_calc::apply_forces | ( | const std::vector< colvar * > & | colvars, |
| colvarmodule * | colvar_module | ||
| ) |
Apply the forces to the atom groups from the CVCs.
On the first call, the CUDA graph for apply atom group forces will be constructed and instantiated. On subsequent calls, the existing CUDA graph will be launched.
| [in] | colvars | A vector of all colvar objects |
| [in] | colvar_module | The main colvarmodule object |
| int colvarmodule_gpu_calc::calc_cvs | ( | const std::vector< colvar * > & | colvars, |
| colvarmodule * | colvar_module | ||
| ) |
Calculate the colvar {...} blocks.
This function performs the following operations:
cv_update_flags to update the flags of all colvars and cvcscvc_calc_total_force to calculate the total force on each CVCatom_group_read_data_gpu to read the atom positions to GPU buffers and calculate the required propertiescvc_calc_value to calculate the values of all CVCscvc_calc_gradients to calculate the gradients of all CVCsatom_group_calc_fit_gradients to calculate the fit gradientscvc_calc_Jacobian_derivative to calculate the Jacobian derivatives of all CVCscv_collect_cvc_data to sum up the colvar values On the first call, the CUDA graphs will be constructed and instantiated. On subsequent calls, the existing CUDA graphs will be launched for "atom_group_read_data_gpu" and "atom_group_calc_fit_gradients".| [in] | colvars | A vector of all colvar objects |
| [in] | colvar_module | The main colvarmodule object |
| int colvarmodule_gpu_calc::init | ( | ) |
Initialize all the GPU compute graphs.
|
private |
A list of atom groups that require forces to be applied.