Sorry for interfering, but I would suggest CBLAS (BLAS rewritten in C) instead of BLAS (which is written in FORTRAN). CBLAS is coming with GSL (GNU Scientific Library) and it's thread safe (I tried it for a scientific Monte Carlo simulation). GSL has the main advantage that it uses already tested algorithms used by the scientific community (like CERN, FermiLab and so on) where speed and precision is a must. But this is for really heavy linear algebra.<div>
<br></div><div>Cheers,</div><div>CGS</div><div><br><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Wed, Oct 5, 2011 at 10:24 AM, Peer Stritzinger <span dir="ltr"><<a href="mailto:peerst@gmail.com">peerst@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Wed, Oct 5, 2011 at 12:17 AM, Richard O'Keefe <<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>> wrote:<br>

><br>
> On 5/10/2011, at 5:37 AM, Peer Stritzinger wrote:<br>
> [how about a linear algebra library built on top of binaries, not entirely<br>
> unlike NumPy]<br>
><br>
> Hasn't something like this already been done?  I'm sure I remember reading<br>
> about it.<br>
<br>
</div>I have to admit I was not aware of this. OTOH it seems not to be<br>
available, can't find anything except the paper and EEP7 which is the<br>
foreign function interface to the external number crunching libraries<br>
they invented.<br>
<br>
However I was thinking along different lines, the approach of "HPTC<br>
with Erlang" (and also NumPy) is to slap on the big chunk of proven<br>
numerical routines as some external library.  Which is the way to go<br>
if you want to do serious number crunching, since its quite hard to<br>
develop trusted and efficient numerical routines.<br>
<br>
The price you have to pay for the slapped on heavyweight library is<br>
that these usually don't scale up to the number of processes Erlang<br>
can handle.  Therefore the need of the impedance adaption I mentioned.<br>
Keeping a pool of numerical processes to keep the cores busy but not<br>
too many of them that the OS is upset. Having work queues that adapt<br>
these to the 20k processes. BTW @John: this would be one solution for<br>
your problem.<br>
<br>
What I was suggesting is a more integrated and lightweight way to make<br>
some number crunching available.  The suggested n-dim matrix type<br>
(e.g. a record containing the metadata and a binary for the data)<br>
combined with some NIFs on these that speed up the parts where Erlang<br>
is not so fast.  Keeping in mind not to do too much work in the NIFs<br>
at one time not to block the scheduler.<br>
<br>
This is for the use cases where there is some numerical stuff needed<br>
but having real time responsiveness and Erlang process counts in mind.<br>
 The use case I have e.g. is some neuronal networks stuff combined<br>
with a lot of symbolic computing to prepare the input.  And its<br>
embarrassingly parallel and needs only some simple vector times matrix<br>
and n-dim array slicing.<br>
<br>
For real heavy numerical stuff I think the best way is to do this in<br>
the systems are built for this and interface them somehow to erlang<br>
with ports or sockets.  Or try to get the code released from the HPTC<br>
paper Jachym mentioned.<br>
<br>
For interfacing with BLAS and their ilk some more native Erlang<br>
numerical capabilities would also be nice to have.  Since they also<br>
use a kind of binary buffer with some metadata approach it would not<br>
be too hard to interface efficiently.<br>
<div><div></div><div class="h5">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div></div>