Thanks for the information. It also works here, even if the speed improvement is a bit lower here on my 4 year old machine. But I'll test this in applied work, too.

Artur


2013/11/6 Allin Cottrell <cottrell@wfu.edu>
On Wed, 6 Nov 2013, Artur T. wrote:

> Hi I just saw that the mols() function now supports
> parallelization. Just out of curiosity: How high is
> the efficiency gain to to be expected?

Well, it depends on how big the data are and how many cores you have. On a
ThinkPad with Corei7 mobile processor (2 cores + hyperthreading) the
sample script below reports 6.28973 seconds single-threaded and 2.61957
seconds threaded. Note that "mp_mnk_min" is the minimum number of
multiplications for which the multi-threaded code will be invoked -- set
this to -1 and multi-threading never happens; set it to too small a
positive value and the threading overhead will slow things down; 90000
seems about optimal for this machine.

<hansl>
set echo off
set messages off

set seed 78511231

scalar T = 500000
scalar k = 100

matrix X = {1} ~ mnormal(T, k)
matrix y = mnormal(T, 1)
matrix U, V

print "*** vanilla"
set mp_mnk_min -1
set stopwatch
matrix b = mols(y, X, &U, &V)
printf "elapsed: %g\n", $stopwatch

print "*** openmp"
set mp_mnk_min 90000
set stopwatch
matrix b = mols(y, X, &U, &V)
printf "elapsed: %g\n", $stopwatch
</hansl>

Allin
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users