Loading...
Searching...
No Matches
Opm::GpuBridge< BridgeMatrix, BridgeVector, block_size > Class Template Reference

GpuBridge acts as interface between opm-simulators with the GpuSolvers. More...

`#include <GpuBridge.hpp>`

## Public Member Functions

| GpuBridge (std::string accelerator_mode, int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID, bool opencl_ilu_parallel, std::string linsolver)
| Construct a GpuBridge.
void | solve_system (BridgeMatrix *bridgeMat, BridgeMatrix *jacMat, int numJacobiBlocks, BridgeVector &b, WellContributions< Scalar > &wellContribs, InverseOperatorResult &result)
| Solve linear system, A*x = b.
void | get_result (BridgeVector &x)
| Get the resulting x vector.
bool | getUseGpu ()
| Return whether the GpuBridge will use the GPU or not return whether the GpuBridge will use the GPU or not.
void | initWellContributions (WellContributions< Scalar > &wellContribs, unsigned N)
| Initialize the WellContributions object with opencl context and queue those must be set before calling BlackOilWellModel::getWellContributions() in ISTL.
std::string | getAccleratorName ()
| Return the selected accelerator mode, this is input via the command-line.

## Static Public Member Functions

static void | copySparsityPatternFromISTL (const BridgeMatrix &mat, std::vector< int > &h_rows, std::vector< int > &h_cols)
| Store sparsity pattern into vectors.

## Detailed Description

template<class BridgeMatrix, class BridgeVector, int block_size>
class Opm::GpuBridge< BridgeMatrix, BridgeVector, block_size >

GpuBridge acts as interface between opm-simulators with the GpuSolvers.

## Constructor & Destructor Documentation

## GpuBridge()

template<class BridgeMatrix, class BridgeVector, int block_size>

Opm::GpuBridge< BridgeMatrix, BridgeVector, block_size >::GpuBridge | ( | std::string | accelerator_mode,
|  | int | linear_solver_verbosity,
|  | int | maxit,
|  | Scalar | tolerance,
|  | unsigned int | platformID,
|  | unsigned int | deviceID,
|  | bool | opencl_ilu_parallel,
|  | std::string | linsolver )

Construct a GpuBridge.

Parameters

  [in] | accelerator_mode | to select if an accelerated solver is used, is passed via command-line: '–accelerator-mode=[none|cusparse|opencl|amgcl|rocalution|rocsparse]'
  [in] | linear_solver_verbosity | verbosity of GpuSolver
  [in] | maxit | maximum number of iterations for GpuSolver
  [in] | tolerance | required relative tolerance for GpuSolver
  [in] | platformID | the OpenCL platform ID to be used
  [in] | deviceID | the device ID to be used by the cusparse- and openclSolvers, too high values could cause runtime errors
  [in] | opencl_ilu_parallel | whether to parallelize the ILU decomposition and application in OpenCL with level_scheduling
  [in] | linsolver | indicating the preconditioner, equal to the –linear-solver cmdline argument

## Member Function Documentation

## copySparsityPatternFromISTL()

template<class BridgeMatrix, class BridgeVector, int block_size>

void Opm::GpuBridge< BridgeMatrix, BridgeVector, block_size >::copySparsityPatternFromISTL | ( | const BridgeMatrix & | mat,
|  | std::vector< int > & | h_rows,
|  | std::vector< int > & | h_cols )

static

Store sparsity pattern into vectors.

Parameters

  [in] | mat | input matrix, probably BCRSMatrix
  [out] | h_rows | rowpointers
  [out] | h_cols | columnindices

## get_result()

template<class BridgeMatrix, class BridgeVector, int block_size>

void Opm::GpuBridge< BridgeMatrix, BridgeVector, block_size >::get_result | ( | BridgeVector & | x | ) |

Get the resulting x vector.

Parameters

  [in,out] | x | vector x, should be of type Dune::BlockVector

## initWellContributions()

template<class BridgeMatrix, class BridgeVector, int block_size>

void Opm::GpuBridge< BridgeMatrix, BridgeVector, block_size >::initWellContributions | ( | WellContributions< Scalar > & | wellContribs,
|  | unsigned | N )

Initialize the WellContributions object with opencl context and queue those must be set before calling BlackOilWellModel::getWellContributions() in ISTL.

Parameters

  [in] | wellContribs | container to hold all WellContributions
  [in] | N | number of rows in scalar vector that wellContribs will be applied on

## solve_system()

template<class BridgeMatrix, class BridgeVector, int block_size>

void Opm::GpuBridge< BridgeMatrix, BridgeVector, block_size >::solve_system | ( | BridgeMatrix * | bridgeMat,
|  | BridgeMatrix * | jacMat,
|  | int | numJacobiBlocks,
|  | BridgeVector & | b,
|  | WellContributions< Scalar > & | wellContribs,
|  | InverseOperatorResult & | result )

Solve linear system, A*x = b.

Warning
  Values of A might get overwritten!

Parameters

  [in] | bridgeMat | matrix A, should be of type Dune::BCRSMatrix
  [in] | jacMat | matrix A, but modified for the preconditioner, should be of type Dune::BCRSMatrix
  [in] | numJacobiBlocks | number of jacobi blocks in jacMat
  [in] | b | vector b, should be of type Dune::BlockVector
  [in] | wellContribs | contains all WellContributions, to apply them separately, instead of adding them to matrix A
  [in,out] | result | summary of solver result

The documentation for this class was generated from the following files:

- opm/simulators/linalg/gpubridge/GpuBridge.hpp
- opm/simulators/linalg/gpubridge/GpuBridge.cpp