<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Oct 26, 2014 at 8:13 PM, Ashwin Srinath <span dir="ltr"><<a href="mailto:ashwinsrnth@gmail.com" target="_blank">ashwinsrnth@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Matthew, I think this fixes the scalar issue:<br><br><a href="https://github.com/ashwinsrnth/petsc-pycuda/commit/145b5f138ecbdddf3c8a2ab4caa86e132ece347f" target="_blank">https://github.com/ashwinsrnth/petsc-pycuda/commit/145b5f138ecbdddf3c8a2ab4caa86e132ece347f</a></div></blockquote><div><br></div><div>Nice, you can do err checking using petsc4py as well:</div><div><br></div><div><pre style="font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono',Monaco,Courier,monospace;font-size:12px;line-height:1.4;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(51,51,51)">    <span class="" style="font-weight:bold">def</span> <span class="" style="color:rgb(153,0,0);font-weight:bold">getType</span><span class="">(</span><span class="" style="color:rgb(153,153,153)">self</span><span class="">):</span>
<a name="cl-122" style="color:rgb(59,115,175)"></a>        <span class="" style="font-weight:bold">cdef</span> <span class="" style="color:rgb(68,85,136);font-weight:bold">const_char</span> *<span class="" style="color:rgb(153,0,0);font-weight:bold">cval</span> <span class="" style="font-weight:bold">=</span> <span class="" style="color:rgb(153,153,153)">NULL</span>
<a name="cl-123" style="color:rgb(59,115,175)"></a>        <span class="">CHKERR</span><span class="">(</span> <span class="">KSPGetType</span><span class="">(</span><span class="" style="color:rgb(153,153,153)">self</span><span class="" style="font-weight:bold">.</span><span class="">ksp</span><span class="">,</span> <span class="" style="font-weight:bold">&</span><span class="">cval</span><span class="">)</span> <span class="">)</span>
<a name="cl-124" style="color:rgb(59,115,175)"></a>        <span class="" style="font-weight:bold">return</span> <span class="">bytes2str</span><span class="">(</span><span class="">cval</span><span class="">)</span>
</pre><pre style="font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono',Monaco,Courier,monospace;font-size:12px;line-height:1.4;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(51,51,51)"><span class=""><br></span></pre><pre style="font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono',Monaco,Courier,monospace;font-size:12px;line-height:1.4;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(51,51,51)"><span class="">  Thanks,</span></pre><pre style="font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono',Monaco,Courier,monospace;font-size:12px;line-height:1.4;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(51,51,51)"><span class=""><br></span></pre><pre style="font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono',Monaco,Courier,monospace;font-size:12px;line-height:1.4;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(51,51,51)"><span class="">     Matt</span></pre></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">On Sun, Oct 26, 2014 at 9:05 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Sun, Oct 26, 2014 at 7:20 PM, Ashwin Srinath <span dir="ltr"><<a href="mailto:ashwinsrnth@gmail.com" target="_blank">ashwinsrnth@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>Hi,<br><br></div>I re-wrote the code to include the code from this branch - it's made everything a lot simpler:<br><a href="https://github.com/ashwinsrnth/petsc-pycuda/blob/master/GPUArray.pyx" target="_blank">https://github.com/ashwinsrnth/petsc-pycuda/blob/master/GPUArray.pyx</a></div></div></blockquote><div><br></div></span><div>Some notes:</div><div><br></div><div>  1) You can check the return type of the PETSc calls for errors</div><div><br></div><div>  2) Lisandro, do you have an automatic converter from PetscScalar to a numpy dtype? Using np.dtype.float64 is dicey.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>If I can help with adding the functionality to `petsc4py`, I'd be glad to :)<br><br></div><div>Thanks,<br></div><div>Ashwin<br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 24, 2014 at 2:43 PM, Lisandro Dalcin <span dir="ltr"><<a href="mailto:dalcinl@gmail.com" target="_blank">dalcinl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On 24 October 2014 03:56, Karl Rupp <<a href="mailto:rupp@iue.tuwien.ac.at" target="_blank">rupp@iue.tuwien.ac.at</a>> wrote:<br>
><br>
> Both 1) and 2) are now pushed to the feature branch. Any feedback<br>
> appreciated :-)<br>
><br>
<br>
</span>Thanks! Looks good. Ashwin, could you please re-write your code to<br>
test this branch? Once you confirm everything's working, we can follow<br>
discussing how to better support this in petsc4py.<br>
<div><div><br>
<br>
--<br>
Lisandro Dalcin<br>
============<br>
Research Scientist<br>
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)<br>
Numerical Porous Media Center (NumPor)<br>
King Abdullah University of Science and Technology (KAUST)<br>
<a href="http://numpor.kaust.edu.sa/" target="_blank">http://numpor.kaust.edu.sa/</a><br>
<br>
4700 King Abdullah University of Science and Technology<br>
al-Khawarizmi Bldg (Bldg 1), Office # 4332<br>
Thuwal 23955-6900, Kingdom of Saudi Arabia<br>
<a href="http://www.kaust.edu.sa" target="_blank">http://www.kaust.edu.sa</a><br>
<br>
Office Phone: <a href="tel:%2B966%2012%20808-0459" value="+966128080459" target="_blank">+966 12 808-0459</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></span></div><br><br clear="all"><span class=""><font color="#888888"><span><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener
</span></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener
</div></div>