<div dir="ltr">Also, I'm excited by the new opportunities for parallel programming and development offered by the IPython parallel programming extensions (<a href="http://ipython.org/ipython-doc/dev/parallel/index.html">http://ipython.org/ipython-doc/dev/parallel/index.html</a>), but have not had a chance to try them out. If you get a chance to use them for development, please let us know if you find them to be useful. <div>
<br></div><div>A<br><br><div class="gmail_quote">On Tue, May 8, 2012 at 5:21 PM, Aron Ahmadia <span dir="ltr"><<a href="mailto:aron.ahmadia@kaust.edu.sa" target="_blank">aron.ahmadia@kaust.edu.sa</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
b) In MATLAB, arrays are used everywhere, also for small collections, where one would use tuples or lists in Python (e.g. multiple return values from a function). When I encounter an array in the original MATLAB code, I have to decide whether a tuple, a list, a numpy.ndarray or a PETSc.Vec/PETSc.Mat is appropriate. </blockquote>
<div><br></div></div><div>ndarray for numerical data, Python dicts and lists for more flexibility, PETSc Vecs and Mats if you need the PETSc API. Conversion between ndarray and PETSc Vecs is practically free, so I would keep them as numpy arrays for as long as possible (this is the strategy in pyclaw).</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One approach would be to use PETSc wherever the array can be larger than a typical tuple. Is there a performance penalty associated with using PETSc Vec/Mat for rather small arrays?<br>
</blockquote><div><br></div></div><div>I agree with Matt, no performance penalty here.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>A </div></font></span></div></div>
</blockquote></div><br></div></div>