accelerInt  v0.1
Functions | Variables
genericcu Namespace Reference

Functions

__global__ void intDriver (const int NUM, const double t, const double t_end, const double *__restrict__ pr_global, double *__restrict__ y_global, const mechanism_memory *__restrict__ d_mem, const solver_memory *__restrict__ s_mem)
 Generic driver for the GPU integrators. More...
 
__device__ void integrate (const double, const double, const double, double *const __restrict__, mechanism_memory const *const __restrict__, solver_memory const *const __restrict__)
 
__host__ void check_error (int num_conditions, int *code_arr)
 
size_t required_solver_size ()
 Returns the total size (in bytes) required for memory storage for a single GPU thread Used in calculation of the maximum number of possible GPU threads to launch, this method returns the size of the solver_memory structure (per-GPU thread) More...
 
void init_solver_log ()
 Initializes solver specific items for logging. More...
 
void solver_log ()
 Executes solver specific logging tasks. More...
 
void initialize_solver (const int, solver_memory **, solver_memory **)
 
void cleanup_solver (solver_memory **, solver_memory **)
 
const char * solver_name ()
 Returns a descriptive solver name. More...
 
void memcpy2D_in (double *dst, const int pitch_dst, double const *src, const int pitch_src, const int offset, const size_t width, const int height)
 A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions. More...
 
void memcpy2D_out (double *dst, const int pitch_dst, double const *src, const int pitch_src, const int offset, const size_t width, const int height)
 A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions. More...
 
void accelerInt_initialize (int NUM, int device)
 Initializes the solver. More...
 
void accelerInt_integrate (const int NUM, const double t_start, const double t_end, const double stepsize, double *__restrict__ y_host, const double *__restrict__ var_host)
 integrate NUM odes from time t_start to time t_end, using stepsizes of stepsize More...
 
void accelerInt_cleanup ()
 Cleans up the solver. More...
 

Variables

int padded
 Padded # of ODEs to solve. More...
 
solver_memoryhost_solver
 The solver memory structs. More...
 
solver_memorydevice_solver
 
mechanism_memory * host_mech
 The mechanism memory structs. More...
 
mechanism_memory * device_mech
 
dim3 dimBlock
 block and grid sizes More...
 
dim3 dimGrid
 
int * result_flag
 result flag More...
 
double * y_temp
 temorary storage More...
 

Function Documentation

◆ accelerInt_cleanup()

void genericcu::accelerInt_cleanup ( )

Cleans up the solver.

Definition at line 217 of file solver_interface.cu.

◆ accelerInt_initialize()

void genericcu::accelerInt_initialize ( int  NUM,
int  device 
)

Initializes the solver.

Parameters
[in]NUMThe number of ODEs to integrate
[in]deviceThe CUDA device number, if < 0 set to the first available GPU

Definition at line 88 of file solver_interface.cu.

◆ accelerInt_integrate()

void genericcu::accelerInt_integrate ( const int  NUM,
const double  t_start,
const double  t_end,
const double  stepsize,
double *__restrict__  y_host,
const double *__restrict__  var_host 
)

integrate NUM odes from time t_start to time t_end, using stepsizes of stepsize

integrate NUM odes from time t_start to time t_end, using stepsizes of t_step

Parameters
[in]NUMThe number of ODEs to integrate. This should be the size of the leading dimension of y_host and var_host.
See also
accelerint_indx
Parameters
[in]t_startThe starting time
[in]t_endThe end time
[in]stepsizeThe integration step size. If stepsize < 0, the step size will be set to t_end - t
[in,out]y_hostThe state vectors to integrate.
[in]var_hostThe parameters to use in dydt() and eval_jacob()
[in]NUMThe number of ODEs to integrate. This should be the size of the leading dimension of y_host and var_host.
See also
accelerint_indx
Parameters
[in]t_startThe system time
[in]t_endThe end time
[in]stepsizeThe integration step size. If stepsize < 0, the step size will be set to t_end - t
[in,out]y_hostThe state vectors to integrate.
[in]var_hostThe parameters to use in dydt() and eval_jacob()

Definition at line 161 of file solver_interface.cu.

◆ check_error()

__host__ void genericcu::check_error ( int  num_conditions,
int *  code_arr 
)

Definition at line 15 of file radau2a_props.cu.

◆ cleanup_solver()

void genericcu::cleanup_solver ( solver_memory **  ,
solver_memory **   
)

◆ init_solver_log()

void genericcu::init_solver_log ( )

Initializes solver specific items for logging.

Initializes stepsize logging for stiffness measurement

Initializes solver specific items for logging.

See also
solver_options.cuh

Initializes the Krylov subspace logging files (if LOG_OUTPUT is defined)

See also
solver_options.cuh

Definition at line 190 of file cvodes_init.c.

◆ initialize_solver()

void genericcu::initialize_solver ( const int  ,
solver_memory **  ,
solver_memory **   
)

◆ intDriver()

__global__ void genericcu::intDriver ( const int  NUM,
const double  t,
const double  t_end,
const double *__restrict__  pr_global,
double *__restrict__  y_global,
const mechanism_memory *__restrict__  d_mem,
const solver_memory *__restrict__  s_mem 
)

Generic driver for the GPU integrators.

Parameters
[in]NUMThe (non-padded) number of IVPs to integrate
[in]tThe current system time
[in]t_endThe IVP integration end time
[in]pr_globalThe system constant variable (pressures / densities)
[in,out]y_globalThe system state vectors at time t. Returns system state vectors at time t_end
[in]d_memThe mechanism_memory struct that contains the pre-allocated memory for the RHS \ Jacobian evaluation
[in]s_memThe solver_memory struct that contains the pre-allocated memory for the solver

Definition at line 29 of file solver_generic.cu.

◆ integrate()

__device__ void genericcu::integrate ( const double  ,
const double  ,
const double  ,
double *const  __restrict__,
mechanism_memory const *const  __restrict__,
solver_memory const *const  __restrict__ 
)

◆ memcpy2D_in()

void genericcu::memcpy2D_in ( double *  dst,
const int  pitch_dst,
double const *  src,
const int  pitch_src,
const int  offset,
const size_t  width,
const int  height 
)
inline

A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions.

Parameters
[out]dstThe destination array
[in]pitch_dstThe width (in bytes) of the destination array. This corresponds to the padded number of IVPs to be solved.
[in]srcThe source pointer
[in]pitch_srcThe width (in bytes) of the source array. This corresponds to the (non-padded) number of IVPs read by read_initial_conditions
[in]offsetThe offset within the source array (IVP index) to copy from. This is useful in the case (for large models) where the solver and state vector memory will not fit in device memory and the integration must be split into multiple kernel calls.
[in]widthThe size (in bytes) of memory to copy for each entry in the state vector
[in]heightThe number of entries in the state vector

Definition at line 46 of file solver_interface.cu.

◆ memcpy2D_out()

void genericcu::memcpy2D_out ( double *  dst,
const int  pitch_dst,
double const *  src,
const int  pitch_src,
const int  offset,
const size_t  width,
const int  height 
)
inline

A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions.

Parameters
[out]dstThe destination array
[in]pitch_dstThe width (in bytes) of the source array. This corresponds to the (non-padded) number of IVPs read by read_initial_conditions
[in]srcThe source pointer
[in]pitch_srcThe width (in bytes) of the destination array. This corresponds to the padded number of IVPs to be solved.
[in]offsetThe offset within the destination array (IVP index) to copy to. This is useful in the case (for large models) where the solver and state vector memory will not fit in device memory and the integration must be split into multiple kernel calls.
[in]widthThe size (in bytes) of memory to copy for each entry in the state vector
[in]heightThe number of entries in the state vector

Definition at line 72 of file solver_interface.cu.

◆ required_solver_size()

size_t genericcu::required_solver_size ( )

Returns the total size (in bytes) required for memory storage for a single GPU thread Used in calculation of the maximum number of possible GPU threads to launch, this method returns the size of the solver_memory structure (per-GPU thread)

See also
solver_memory

Definition at line 167 of file exp4_init.cu.

◆ solver_log()

void genericcu::solver_log ( )

Executes solver specific logging tasks.

Logs errors, step-sizes, and krylov subspace size (if LOG_OUTPUT is defined)

See also
solver_options.cuh

Definition at line 192 of file cvodes_init.c.

◆ solver_name()

const char* genericcu::solver_name ( )

Returns a descriptive solver name.

Definition at line 181 of file cvodes_init.c.

Variable Documentation

◆ device_mech

mechanism_memory * genericcu::device_mech

Definition at line 22 of file solver_interface.cu.

◆ device_solver

solver_memory * genericcu::device_solver

Definition at line 20 of file solver_interface.cu.

◆ dimBlock

dim3 genericcu::dimBlock

block and grid sizes

Definition at line 24 of file solver_interface.cu.

◆ dimGrid

dim3 genericcu::dimGrid

Definition at line 24 of file solver_interface.cu.

◆ host_mech

mechanism_memory* genericcu::host_mech

The mechanism memory structs.

Definition at line 22 of file solver_interface.cu.

◆ host_solver

solver_memory* genericcu::host_solver

The solver memory structs.

Definition at line 20 of file solver_interface.cu.

◆ padded

int genericcu::padded

Padded # of ODEs to solve.

Definition at line 18 of file solver_interface.cu.

◆ result_flag

int* genericcu::result_flag

result flag

Definition at line 26 of file solver_interface.cu.

◆ y_temp

double* genericcu::y_temp

temorary storage

Definition at line 28 of file solver_interface.cu.