Carlos, The second operation uses more cores because it called out to a multithreaded BLAS operation. This will happen if the structure of your data can take advantage BLAS calls. The data layouts are the same so I don't know why the first version does not work. Method dispatch is probably specialized on the array dimension where in your first example, the "vector" is actually a 2d array with one column.
On Thursday, March 27, 2014 3:15:04 PM UTC-4, Carlos Stein wrote: > > Hi all, > > I'm getting started with Julia, looks great. > > I was testing the performance for a simple array product *(A*v)* and it > depended if *v* is a vector or an array. The matrix version > > A = randn(400,4000) > > v = randn(4000,1) > y = A*v > > > used one core, while the vector version > > > A = randn(400,4000) > > v = randn(4000) > y = A*v > > > used all 16 cores and was 10x faster. > > Is there an easy way to know and choose how many cores will be used for a > given operation? > > Thanks! Carlos > >
