accelerInt
v0.1
|
the generic main file for all GPU solvers More...
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
#include <complex.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <helper_cuda.h>
#include <cuComplex.h>
#include "header.cuh"
#include "timer.h"
#include "solver.cuh"
#include "gpu_memory.cuh"
#include "read_initial_conditions.cuh"
#include "launch_bounds.cuh"
#include <assert.h>
Go to the source code of this file.
Functions | |
void | write_log (int NUM, double t, const double *y_host, FILE *pFile) |
Writes state vectors to file. 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... | |
int | main (int argc, char *argv[]) |
Variables | |
__device__ int | integrator_steps [DIVERGENCE_TEST] = {0} |
If DIVERGENCE_TEST is defined, this creates a device array for tracking. More... | |
the generic main file for all GPU solvers
Contains main function, setup, initialization, logging, timing and driver functions
Definition in file solver_main.cu.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function
[in] | argc | command line argument count |
[in] | argv | command line argument vector |
This allows running the integrators from the command line. The syntax is as follows:
./solver-name [num_threads] [num_IVPs]
omp_get_max_threads()
Number of independent systems
Definition at line 150 of file solver_main.cu.
|
inline |
A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions.
[out] | dst | The destination array |
[in] | pitch_dst | The width (in bytes) of the destination array. This corresponds to the padded number of IVPs to be solved. |
[in] | src | The source pointer |
[in] | pitch_src | The width (in bytes) of the source array. This corresponds to the (non-padded) number of IVPs read by read_initial_conditions |
[in] | offset | The 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] | width | The size (in bytes) of memory to copy for each entry in the state vector |
[in] | height | The number of entries in the state vector |
Definition at line 96 of file solver_main.cu.
|
inline |
A convienience method to copy memory between host pointers of different pitches, widths and heights. Enables easier use of CUDA's cudaMemcpy2D functions.
[out] | dst | The destination array |
[in] | pitch_dst | The width (in bytes) of the source array. This corresponds to the (non-padded) number of IVPs read by read_initial_conditions |
[in] | src | The source pointer |
[in] | pitch_src | The width (in bytes) of the destination array. This corresponds to the padded number of IVPs to be solved. |
[in] | offset | The 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] | width | The size (in bytes) of memory to copy for each entry in the state vector |
[in] | height | The number of entries in the state vector |
Definition at line 122 of file solver_main.cu.
void write_log | ( | int | NUM, |
double | t, | ||
const double * | y_host, | ||
FILE * | pFile | ||
) |
Writes state vectors to file.
[in] | NUM | the number of state vectors to write |
[in] | t | the current system time |
[in] | y_host | the current state vectors |
[in] | pFile | the opened binary file object |
The resulting file is updated as: system time
temperature, mass fractions (State #1)
temperature, mass fractions (State #2)...
Definition at line 59 of file solver_main.cu.
__device__ int integrator_steps[DIVERGENCE_TEST] = {0} |
If DIVERGENCE_TEST is defined, this creates a device array for tracking.
Definition at line 44 of file solver_main.cu.