On Tuesday, 27 March 2012 17:03:12 UTC+1, Dima Pasechnik wrote:
>
> On 2012-03-27, leif <[email protected]> wrote:
> > On 27 Mrz., 17:29, leif <[email protected]> wrote:
> >> On 27 Mrz., 15:39, Volker Braun <[email protected]> wrote:
> >>
> >> > The current state is that we build static atlas with and without 
> threads,
> >> > and the shared library without threads only. And our module_list.py 
> links
> >> > with the single-threaded atlas shared library only. So Sage will use 
> the
> >> > single-threaded version if you build atlas yourself.
> >>
> >> [...]
> >>
> >> And what you say IMHO doesn't explain the problems we had, which
> >> definitely occurred only with *large* matrices (and bdists).
> >> Obviously there's some machine-specific threshold for multithreading,
> >> although multiplication of 1000x1000 matrices should probably already
> >> trigger it.
> >
> > On my dual-core netbook:
> >
> > ----------------------------------------------------------------------
> >| Sage Version 5.0.prealpha0, Release Date: 2011-12-31               |
> >| Type notebook() for the GUI, and license() for information.        |
> > ----------------------------------------------------------------------
> > **********************************************************************
> > *                                                                    *
> > * Warning: this is a prerelease version, and it may be unstable.     *
> > *                                                                    *
> > **********************************************************************
> > sage: a = random_matrix(RDF,1000)
> > sage: time b=a*a
> > Time: CPU 1.40 s, Wall: 0.84 s
>
> >
> Indeed, on mod I get:
>
> dima@mod:~$ sage
> ----------------------------------------------------------------------
> | Sage Version 4.8, Release Date: 2012-01-20                         |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
> sage: a = random_matrix(RDF,1900)
> sage: time b = a*a
> Time: CPU 2.30 s, Wall: 0.87 s
>
> But:
> sage: a = random_matrix(RDF,1000)
> sage: time b = a*a               
> Time: CPU 0.41 s, Wall: 0.36 s
>
>
> Interesting...
>
> Dima
> >
> > -leif
> >
> >
> >> > If you use the os-provided atlas library (which can be multi-threaded 
> yet
> >> > not have the "pt" in the name), you get parallel atlas. For example, 
> on
> >> > Fedora I'm using the system atlas and get
> >>
> >> > sage: sage: a = random_matrix(RDF,1000)
> >> > sage: time a*a
> >> > 1000 x 1000 dense matrix over Real Double Field
> >> > Time: CPU 1.08 s, Wall: 0.26 s
> >>
> >> > And if anybody wonders why there is a single-threaded atlas at all: 
> People
> >> > often specifically WANT a single-threaded blas, and implement their 
> own
> >> > parallelism on top of that.
> >>
> >> > On Tuesday, March 27, 2012 2:14:26 PM UTC+1, William wrote:
> >>
> >> > > On Tue, Mar 27, 2012 at 12:39 PM, Volker Braun <
> [email protected]>
> >> > > wrote:
> >> > > > When I rewrote the atlas spkg I enabled multithreaded atlas 
> libraries.
> >> > > That
> >> > > > is, we configure atlas to allow threading. Whether or not atlas 
> actually
> >> > > > builds threaded libraries depends on os and configure checks for
> >> > > ptthreads.
> >>
> >> > > Does it work on mod.math.washington.edu?  I tried
> >>
> >> > >   sage: a = random_matrix(RDF,1000)
> >> > >   sage: time b = a*a
> >> > >   Time: CPU 0.43 s, Wall: 0.43 s
> >>
> >> > > and clearly ATLAS is *NOT* being multithreaded.
> >> > > However, if I do the same on my little OS X laptop, I get:
> >>
> >> > >   sage: a = random_matrix(RDF,1000)
> >> > >   sage: time b = a*a
> >> > >   Time: CPU 0.45 s, Wall: 0.13 s    # <--- look at that walltime!
> >>
> >> > > which is clearly multithreaded.
> >>
> >> > >  - William
> >
>

On fermat.warwick.ac.uk (a 24-core Linux box), using Sage's ATLAS as built 
from source, some experimentation shows that multiplying square RDF 
matrices is multi-threaded if and only if the matrix size is > 40. It also 
shows that this threshold is the wrong threshold, since multiplying two 
random 41 x 41 matrices is nearly seven times slower than 40 x 40! 
Curiouser and curiouser...

David

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to