Nathan and Armin: Thank you both for the advice!

Sorry, I didn't make it clear: my project is actually an interpreter
for a stencil-based
language <https://stencil-language.readthedocs.org/en/latest/lang_spec.html>that
is used for solving partial differential equations. So I think that
RPython is the right tool to an extent. It worked very well for writing the
interpreter (I also used Alex Gaynor's rply <https://github.com/alex/rply>).
However, now I would like to parallelize the solver (i.e., the matrix
operations).

I sounds as if this is where RPython stops being the right tool for the
job, since threading is useful only for concurrency and not speed, as in
Python. Thank you for letting me know before I spent too much time on it! I
suppose I should have guessed from the code I was writing.

I am seeing two options, on which I welcome comment:

   - Continue using RPython and use
rffi<http://doc.pypy.org/en/latest/rffi.html>to make calls to C, where
I implement the solver function for high speed,
   optionally with threading or message-passing. I've used pthreads, OpenMP,
   and MPI a number of times before, but combining that with rffi might be a
   little over my head.
   - Switch to using PyPy with multiprocessing and/or numpypy. Happily, my
   code runs under PyPy and CPython albeit with some RPython libraries and
   some RPython-specific workarounds (e.g.,
boxes<https://github.com/seanfisk/rpython-stencil-language/blob/master/stencil_lang/structures.py#L43>
   ).

I will talk to my advisor, and other ideas are certainly welcome!

Thank you,

Sean

On Sun, Jul 7, 2013 at 1:42 AM, Armin Rigo <[email protected]> wrote:

Hi Sean,
>
> On Fri, Jul 5, 2013 at 11:17 PM, Armin Rigo <[email protected]> wrote:
> > Sorry, RPython is the wrong tool.  It doesn't support multithreading
> > (...)
>
> I've updated the FAQ entry here to try to explain a bit more precisely
> the reason and motivations for which we, the "core PyPy group" of
> people, keep answering the question "How do I use RPython to..." with
> "Don't!".
>
>
> http://doc.pypy.org/en/latest/faq.html#do-i-have-to-rewrite-my-programs-in-rpython
>
>
> A bientôt,
>
> Armin.
>
-- 
Sean Fisk
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to