call p%allocate_wrk(info[, vmold])
Allocate internal work vectors. Each application of the preconditioner
uses a number of work vectors which are allocated internally as
necessary; therefore allocation and deallocation of memory occurs
multiple times during the execution of a Krylov method. In most cases
this strategy is perfectly acceptable, but
on some platforms, most notably GPUs, memory allocation is
a slow operation, and the default behaviour would lead to a
slowdown. This method allows to trade space for time by preallocating
the internal workspace outside of the invocation of a Krylov
method. When using GPUs or other specialized devices, the vmold
argument is also necessary to ensure the internal work vectors are of
the appropriate dynamic type to exploit the accelerator hardware; when
allocation occurs internally this is taken care of based on the dynamic
type of the x
argument to the apply
method.
Arguments
info |
integer, intent(out) . |
Error code. If no error, 0 is returned. See Section 8 for details. | |
vmold |
class(psb_ x_base_vect_type), intent(in), optional . |
The desired dynamic type for internal vector components; this allows e.g. running on GPUs. |