[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: threads



Camm,

>Greetings!  Clint, forgive my stupid question, but you might be able
>to save me some time here.  When threaded support is selected, is the
>number of cpus hardcoded into the lib?  If so, is there anyway to make
>a threaded lib that would run reasonably on any number of cpus?  I
>assume just replacing cblas->ptcblas and f77blas->ptf77blas runs jobs
>on multiple cpus.  Please correct me if I'm mistaken.

It's hardcoded in.  The only trick I could think of would be to enter the
maximum number; e.g., you say there are 4 procs, and if a user has only 2,
each gets two threads.  The performance hit of this varies widely based
on the architecture . . .

My own impression is that the vast majority of SMP systems are duals.  I'm
guessing you've ruled out the idea of supplying dual libs, and having people
who want more recompile?  My own feeling is that some dude with a 8-way SMP
shouldn't be intimidated by compiling from source (with the cost of the
machine, he ought to be able to afford a professional maintainer), and that
duals are pretty much the only SMP for the masses . . .

Antoine is the author of ATLAS's threaded code, so take the following with
a grain of salt (I would need to spend more time than I want to confirm).
I think if you wanted to get hardcore, you could whip up a minimal section
of code that a user could recompile to get the best nthreads.  All of the
code is under ATLAS/src/pthreads, and given a good Make.<arch> and slightly
reworking the makefile, I'm sure you could whip something up . . .

It would probably not be impossible to make it dynamic, but would require
actual code modification, as opposed to just editing makefiles . . .

Antoine and I had a lot of discussion on whether to make things dynamic.
I think I was the main proponent of making it static (mainly as an aid to
robustness and portability); since releasing the threading, every question
about threads seems to involve wanting to change the number dynamically . . .

As for your earlier question on 3DNow!, Peter will have to answer . . .

Cheers,
Clint