4.2 GPU example

The code reported in Figure 5 shows how to set up a program exploiting the combined GPU capabilities of PSBLAS and AMG4PSBLAS.


<<<<<<< HEAD

call p%init(contxt,ptype,info)

This method allocates and initializes the preconditioner p, according to the preconditioner type chosen by the user.

Arguments

contxt

type(psb_ctxt_type), intent(in).

The communication context.

ptype

character(len=*), intent(in) .

The type of preconditioner. Its values are specified in Table 1.

Note that strings are case insensitive.

info

integer, intent(out).

Error code. If no error, 0 is returned. See Section 7 for details.

=======

! build a one-level RAS with overlap 2 and ILU(0) on the local blocks.
call P%init(’AS’,info)
call P%set(’SUB_OVR’,2,info)
call P%build(A,desc_A,info)
... ...
! solve Ax=b with preconditioned BiCGSTAB
  call psb_krylov(’BICGSTAB’,A,P,b,x,tol,desc_A,info)


Listing 5: setup of a one-level Schwarz preconditioner.
>>>>>>> development