[petsc-dev] Possible bugs when using TS with ViennaCL

Mani Chandra mc0710 at gmail.com
Fri Jan 24 22:35:32 CST 2014


Hi Everyone,

I'm trying to use TS with ViennaCL vecs/mats and residual evaluation on
device and have encountered some problems. I have attached a small test
code that illustrates the issue.

The code simply advects a blob diagonally using TS. I have written the
residual evaluation function using 1) the usual Petsc vectors (VecGetArray)
and 2) using ViennaCL vectors (VecViennaCLGetArrayRead/Write).

Run the code using the following:
./petsc_opencl -ts_monitor -snes_monitor -ts_max_steps 1000 -ts_type theta
-ts_dt 10 -snes_rtol 1e-4 -ts_final_time 1000 -ts_monitor_draw_solution

Case 1) No ViennaCL anywhere. I simply use the usual Petsc vectors and set
the residual evaluation function as ComputeResidual (line no. 55). This
case works and the blob is indeed advected as can be seen. (I haven't
bothered with the boundaries. The simulation just stops before the blob
hits the boundaries).

Case 2) We again use the ComputeResidual but now enable ViennaCL vecs and
mats (line nos. 48, 49). This case does NOT work. The SNES monitor shows
convergence but the solution makes no sense.

Case 3) We now use ComputeResidualViennaCL (line no. 56). This does NOT
work either with or without enabling the ViennaCL vecs (line nos. 48, 49).

Cheers,
Mani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140124/60d8d371/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: petsc_opencl.tar.gz
Type: application/x-gzip
Size: 4948 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140124/60d8d371/attachment.gz>


More information about the petsc-dev mailing list