For the sake of completeness of this thread:

Mani's build included
--with-threadcomm --with-pthreadclasses --with-openmp
which seems the be the cause of the problem. Without these flags, the problem disappears and results are correct. If I remember correctly, this is a more fundamental problem in threadcomm rather than specific to the ViennaCL bindings, yet we clearly need to fix it.

Karli


On 01/27/2014 03:03 AM, Mani Chandra wrote:
Hi Karl,

I check my solution using -ts_monitor_draw_solution. Ok forget about the
earlier code and try running the code I have attached now. It is
basically the same code but using DMComposite to manage multiple
variables. On using -ts_monitor_draw_solution, you will see two windows
with blobs being advected. Here's a report for this code:

1) Everything works if I use ComputeResidual, irrespective of which
DMSetVecType I use (including VECVIENNACL). Note that in the earlier
code (without DMComposite) the case with VECVIENNACL doesn't give the
right answer but lets forget about the earlier code.

2) Nothing works if I use ComputeResidualVecViennaCL, whatever maybe
DMSetVecType. Again note that in the earlier code this case works only
if I set the vec/mat types to VIENNACL.

Getting this code to work will basically solve my problems.

Sorry for the bother and thanks so much!

P.S I run the code using ./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

Cheers,
Mani


On Sun, Jan 26, 2014 at 4:40 PM, Karl Rupp <[email protected]
<mailto:[email protected]>> wrote:

    Hi Mani,


     > Thanks! It worked. However the following cases still don't work:


        1)  Using ComputeResidual (not ComputeResidualViennaCL) but with
        DMSetVecType(da, VECVIENNACL) and DMSetMatType(da,
        MATAIJVIENNACL). The
        SNES solver converges but gives nonsensical results. I just get a
        flashing blob.

        2) Using ComputeResidualViennaCL (not ComputeResidual) and *without*

        DMSetVecType(da, VECVIENNACL) and DMSetMatType(da,
        MATAIJVIENNACL). The
        SNES solver converges but gives nonsensical results. I just get a
        flashing blob as 1) above. This case probably should not work anyway
        cause I'm not sure if VecViennaCLGetArray works if the Vecs have not
        been set to ViennaCL.


    Both cases worked for me when calling VecView() on the solution
    vector. Maybe I missed something, I'll check again tomorrow.

    Best regards,
    Karli



Reply via email to