On Sat, Dec 5, 2009 at 1:06 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is an interesting proposal. Two thoughts:<br>
<br>
Residual and Jacobian evaluation cannot be written in Python (though it<br>
can be prototyped there). After a discretization is chosen, the physics<br>
is usually representable as a tiny kernel (Riemann solvers/pointwise<br>
operation at quadrature points), but if the user is still in charge of<br>
the discretization, it will need services from this new PETSc. So we<br>
need to be able to provide good debugging support across languages and<br>
concurrency models, i.e. Python/MPI->C/OpenMP->Python->CUDA.<br>
<br>
Python is not statically typed. This is both a strength and a weakness,<br>
but dynamic typing makes debugger support more important because the<br>
compiler can't catch type errors, instead we'll find them when an<br>
exception is thrown in the multi-language hybrid environment.<font color="#888888"><br></font></blockquote><div><br>This is a great point. Debugging is the Achilles Heel of multi-language programming. That is<br>why I propose a dual program. All code should be in a single language, which allows efficient<br>
debugging. You are correct to point out that Python debugging is all at runtime.<br><br>Then kernels are moved to an accelerator. The nice part here is that debugging becomes<br>regression, since we have a working model to test against. The worst scenario is one in which<br>
a bug only appears in the optimized kernels at a scale unattainable in the pure Python.<br><br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888">
Jed<br>
</font></blockquote></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<br>