Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!feeder.erje.net!newsfeed.velia.net!news.tu-darmstadt.de!news.belwue.de!rz.uni-karlsruhe.de!news.rz.uni-karlsruhe.de!not-for-mail
From: Arne Schneck <arne.schneck@math.uni-karlsruhe.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: GOTO BLAS and multiple threads
Date: Wed, 13 Aug 2008 12:53:46 +0200
Organization: University of Karlsruhe, Germany
Lines: 23
Message-ID: <g7udqa$59s$1@news2.rz.uni-karlsruhe.de>
References: <g7seu6$4du$1@news2.rz.uni-karlsruhe.de>
NNTP-Posting-Host: iwr06.mathematik.uni-karlsruhe.de
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Trace: news2.rz.uni-karlsruhe.de 1218624138 5436 172.22.5.206 (13 Aug 2008 10:42:18 GMT)
X-Complaints-To: abuse@uni-karlsruhe.de
NNTP-Posting-Date: Wed, 13 Aug 2008 10:42:18 +0000 (UTC)
User-Agent: KNode/0.10.5
Xref: news.mathworks.com comp.soft-sys.matlab:485238



Arne Schneck wrote:
> I've been trying to use GOTO BLAS instead of the BLAS implementation that
> comes with Matlab. The problem is that when I compile a C file (with mex)
> that uses one of the BLAS routines from the GOTO library (dsyrk in my
> case), it only uses 1 thread.

Okay, I kind of solved the problem, but something is still messed up. In
order to uses Goto's BLAS, I just set the BLAS_VERSION environment variable
to the Goto BLAS library. This makes Matlab commands like A*A' call the
BLAS subroutine from Goto's library instead of the ACML library. And it
apparently uses (at least) 8 threads. So that solves the issue for me.

But: When I link C MEX files against libgoto, the resulting MEX file shows
pretty random behavior which completely baffles me. In one Matlab session
it uses 8 threads (don't know for sure, but at least it's fast), then I
restart Matlab and it uses only 1 thread. Although nothing was changed. On
each restart of Matlab it randomly seems to choose whether to use 1 or 8
threads!

Anyone have any idea what's going on here?

Arne