Numerical packages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Numerical packages

Ignacio Vivona-2
Hi all! I'm currently planning on doing some work related to resolving partial differential equations (shallow water) in pharo. I'm seeing a couple of project for dealing with vectors, matrices and some other math things. 





Has anyone any experience working with these? 

Also I'm looking at Mathmorphs (does it work in pharo?) http://mate.dm.uba.ar/~caniglia/mathMorphs.html and DrGEO http://community.ofset.org/index.php/DrGeo for doing the graphical interaction.
If someone knows of some other project related please guide me.

Thanks in advance,
Ignacio Vivona
Reply | Threaded
Open this post in threaded view
|

Re: Numerical packages

Nicolas Cellier
I can tell you about Smallapack as author.

First advantage: using a state of the art robust library
LAPACK + BLAS is the core of Matlab/Octave/Scilab/R/etc...
It is robust in terms of API stability, numerical stability, and
number of bugs (try finding known ones).

Second advantage: combine advantages of
- a fast and efficient number crunching library for low level primitives
- and our favourite IDE for higher level code (interpreter debugger
browser etc...)
That's the exact strategy developped by Matlab.
As a bonus, Smalltalk interpreter is faster than Matlab, and don't ask
me about Matlab language design (non) choices ;)
To reach Matlab core preformances, you need an optimized version of
BLAS (ATLAS for example).
I imagine versions of these libraries could exploit multi-core
parallelism (but I did not check status of
http://www.netlib.org/scalapack/).

Good news, I have a working Smallapack in both Dolphin and VW.
Unfortunately, the main drawback is that Squeak/Pharo is not in that list.

First, Smallapack may crash the image in Squeak/Pharo...
I've not found the reasons, but suspect some FFI problems.
Maybe I should try using a plugin rather than FFI. That seems doable
since low level FFI code is generated automatically from Lapack
comments. It's just a matter of changing code generator to generate
slang rather than FFI...

Second drawback is that loading Smallapack in a Squeak/Pharo image
requires some pre-requisite.
This is because LAPACK has the bad property of having functions with
more than 16 arguments.
Squeak/Pharo Compiler cannot handle methods with that many arguments.
I have a Compiler hack ready for handling this case.
I have not automated the process because I'm not so sure that
Gofer/Metacello are good for installing such hack (Compiler overrides
may seem evil).
But I can help any good will.

So, if you're after an off-the-shelf library working out of the box,
Smallapack is not OK.
However, if above goals fit yours, and you're willing to help, I'll be
happy to revive the project and inject a few hours into it.

Nicolas

2011/5/31 Ignacio Vivona <[hidden email]>:

> Hi all! I'm currently planning on doing some work related to resolving
> partial differential equations (shallow water) in pharo. I'm seeing a couple
> of project for dealing with vectors, matrices and some other math things.
> http://www.squeaksource.com/DHBNumerical.html
> http://www.squeaksource.com/MatrixPlugin.html
> http://www.squeaksource.com/Numerics.html
> http://www.squeaksource.com/Smallapack.html
> Has anyone any experience working with these?
> Also I'm looking at Mathmorphs (does it work in
> pharo?) http://mate.dm.uba.ar/~caniglia/mathMorphs.html and
> DrGEO http://community.ofset.org/index.php/DrGeo for doing the graphical
> interaction.
> If someone knows of some other project related please guide me.
> Thanks in advance,
> Ignacio Vivona

Reply | Threaded
Open this post in threaded view
|

Re: Numerical packages

Eliot Miranda-2
Hi Nicolas,

On Tue, May 31, 2011 at 1:22 PM, Nicolas Cellier <[hidden email]> wrote:
I can tell you about Smallapack as author.

First advantage: using a state of the art robust library
LAPACK + BLAS is the core of Matlab/Octave/Scilab/R/etc...
It is robust in terms of API stability, numerical stability, and
number of bugs (try finding known ones).

Second advantage: combine advantages of
- a fast and efficient number crunching library for low level primitives
- and our favourite IDE for higher level code (interpreter debugger
browser etc...)
That's the exact strategy developped by Matlab.
As a bonus, Smalltalk interpreter is faster than Matlab, and don't ask
me about Matlab language design (non) choices ;)
To reach Matlab core preformances, you need an optimized version of
BLAS (ATLAS for example).
I imagine versions of these libraries could exploit multi-core
parallelism (but I did not check status of
http://www.netlib.org/scalapack/).

Good news, I have a working Smallapack in both Dolphin and VW.
Unfortunately, the main drawback is that Squeak/Pharo is not in that list.

First, Smallapack may crash the image in Squeak/Pharo...
I've not found the reasons, but suspect some FFI problems.
Maybe I should try using a plugin rather than FFI. That seems doable
since low level FFI code is generated automatically from Lapack
comments. It's just a matter of changing code generator to generate
slang rather than FFI...

How easy is this to test?  What does one have to install?  Is it all freely available?  I'd like to find time to test this in the ReentrantFFIPlugin.  Seems like a good test case.
 

Second drawback is that loading Smallapack in a Squeak/Pharo image
requires some pre-requisite.
This is because LAPACK has the bad property of having functions with
more than 16 arguments.
Squeak/Pharo Compiler cannot handle methods with that many arguments.
I have a Compiler hack ready for handling this case.

That's easy to fix.  The bytecode set supports up to 31 args.  e just need to push fixes to the compiler front-end right?
 
I have not automated the process because I'm not so sure that
Gofer/Metacello are good for installing such hack (Compiler overrides
may seem evil).
But I can help any good will.

So, if you're after an off-the-shelf library working out of the box,
Smallapack is not OK.
However, if above goals fit yours, and you're willing to help, I'll be
happy to revive the project and inject a few hours into it.

Nicolas

best,
Eliot 


2011/5/31 Ignacio Vivona <[hidden email]>:
> Hi all! I'm currently planning on doing some work related to resolving
> partial differential equations (shallow water) in pharo. I'm seeing a couple
> of project for dealing with vectors, matrices and some other math things.
> http://www.squeaksource.com/DHBNumerical.html
> http://www.squeaksource.com/MatrixPlugin.html
> http://www.squeaksource.com/Numerics.html
> http://www.squeaksource.com/Smallapack.html
> Has anyone any experience working with these?
> Also I'm looking at Mathmorphs (does it work in
> pharo?) http://mate.dm.uba.ar/~caniglia/mathMorphs.html and
> DrGEO http://community.ofset.org/index.php/DrGeo for doing the graphical
> interaction.
> If someone knows of some other project related please guide me.
> Thanks in advance,
> Ignacio Vivona


Reply | Threaded
Open this post in threaded view
|

Re: Numerical packages

Nicolas Cellier
2011/5/31 Eliot Miranda <[hidden email]>:

> Hi Nicolas,
>
> On Tue, May 31, 2011 at 1:22 PM, Nicolas Cellier
> <[hidden email]> wrote:
>>
>> I can tell you about Smallapack as author.
>>
>> First advantage: using a state of the art robust library
>> LAPACK + BLAS is the core of Matlab/Octave/Scilab/R/etc...
>> It is robust in terms of API stability, numerical stability, and
>> number of bugs (try finding known ones).
>>
>> Second advantage: combine advantages of
>> - a fast and efficient number crunching library for low level primitives
>> - and our favourite IDE for higher level code (interpreter debugger
>> browser etc...)
>> That's the exact strategy developped by Matlab.
>> As a bonus, Smalltalk interpreter is faster than Matlab, and don't ask
>> me about Matlab language design (non) choices ;)
>> To reach Matlab core preformances, you need an optimized version of
>> BLAS (ATLAS for example).
>> I imagine versions of these libraries could exploit multi-core
>> parallelism (but I did not check status of
>> http://www.netlib.org/scalapack/).
>>
>> Good news, I have a working Smallapack in both Dolphin and VW.
>> Unfortunately, the main drawback is that Squeak/Pharo is not in that list.
>>
>> First, Smallapack may crash the image in Squeak/Pharo...
>> I've not found the reasons, but suspect some FFI problems.
>> Maybe I should try using a plugin rather than FFI. That seems doable
>> since low level FFI code is generated automatically from Lapack
>> comments. It's just a matter of changing code generator to generate
>> slang rather than FFI...
>
> How easy is this to test?  What does one have to install?  Is it all freely
> available?  I'd like to find time to test this in the ReentrantFFIPlugin.
>  Seems like a good test case.
>

http://www.squeaksource.com/Smallapack.html
- is MIT
- has a few tests

For compiling 16+ args, there is a Compiler mcz in the repository (a
few versions back trunk, so a merge might be necessary).
This is useless if you can upgrade to 31 args.

See the wiki tab for load order.
At my last attempts, MC failed to initialize correctly; if a debugger
opens on a nil class var, then try redoing some initialize...

I may help this week end (thursday thru saturday).

Nicolas

>>
>> Second drawback is that loading Smallapack in a Squeak/Pharo image
>> requires some pre-requisite.
>> This is because LAPACK has the bad property of having functions with
>> more than 16 arguments.
>> Squeak/Pharo Compiler cannot handle methods with that many arguments.
>> I have a Compiler hack ready for handling this case.
>
> That's easy to fix.  The bytecode set supports up to 31 args.  e just need
> to push fixes to the compiler front-end right?
>
>>
>> I have not automated the process because I'm not so sure that
>> Gofer/Metacello are good for installing such hack (Compiler overrides
>> may seem evil).
>> But I can help any good will.
>>
>> So, if you're after an off-the-shelf library working out of the box,
>> Smallapack is not OK.
>> However, if above goals fit yours, and you're willing to help, I'll be
>> happy to revive the project and inject a few hours into it.
>>
>> Nicolas
>
> best,
> Eliot
>>
>> 2011/5/31 Ignacio Vivona <[hidden email]>:
>> > Hi all! I'm currently planning on doing some work related to resolving
>> > partial differential equations (shallow water) in pharo. I'm seeing a
>> > couple
>> > of project for dealing with vectors, matrices and some other math
>> > things.
>> > http://www.squeaksource.com/DHBNumerical.html
>> > http://www.squeaksource.com/MatrixPlugin.html
>> > http://www.squeaksource.com/Numerics.html
>> > http://www.squeaksource.com/Smallapack.html
>> > Has anyone any experience working with these?
>> > Also I'm looking at Mathmorphs (does it work in
>> > pharo?) http://mate.dm.uba.ar/~caniglia/mathMorphs.html and
>> > DrGEO http://community.ofset.org/index.php/DrGeo for doing the graphical
>> > interaction.
>> > If someone knows of some other project related please guide me.
>> > Thanks in advance,
>> > Ignacio Vivona
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Numerical packages

SergeStinckwich
In reply to this post by Ignacio Vivona-2
Hi,

recently, i was interested to be able to integrate numerically
ordinary differential equations (ODE) for a project about
epidemiological simulation. I have no big needs and i can reimplement
Runge-Kutta method (rk4 function and friends) in Smalltalk at the
beginning. But if i want to be able to do heavy simulations in the
future, i'm definitively interested by a solution like Smallapack for
Pharo !

Regards,

On Tue, May 31, 2011 at 11:44 PM, Ignacio Vivona <[hidden email]> wrote:

> Hi all! I'm currently planning on doing some work related to resolving
> partial differential equations (shallow water) in pharo. I'm seeing a couple
> of project for dealing with vectors, matrices and some other math things.
> http://www.squeaksource.com/DHBNumerical.html
> http://www.squeaksource.com/MatrixPlugin.html
> http://www.squeaksource.com/Numerics.html
> http://www.squeaksource.com/Smallapack.html
> Has anyone any experience working with these?
> Also I'm looking at Mathmorphs (does it work in
> pharo?) http://mate.dm.uba.ar/~caniglia/mathMorphs.html and
> DrGEO http://community.ofset.org/index.php/DrGeo for doing the graphical
> interaction.
> If someone knows of some other project related please guide me.
> Thanks in advance,
> Ignacio Vivona



--
Serge Stinckwich
UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
Every DSL ends up being Smalltalk
http://doesnotunderstand.org/