0

What are the best practices to follow for math.net numerics matrices/vectors calculations in asp.net/c#.

I'm performing huge number of (10000*30*35) matrices calculations. I'm using Intel MKL provider and C#.Net TPL but still it's taking ~40 seconds on 16 core system which is not acceptable,trying to bring it under 3-4 seconds.

All are dense matrices. When I checked with dotTrace profiler tool, columnsum is taking more time.

Any thoughts??

Below is sample code:

Parallel.For(0, count, (i) =>
                {

                for (int j = 0; j < year; j++)
                {
                    for (int k = 0; k < iterations; k++)
                    {
                        a.PointwiseMultiply(b); 
                        a.Multiply(b); a.Multiply(b);
                        a.Add(b);
                        a.Add(b).Subtract(b);
                        a.ColumnSums(); a.ColumnSums();
                        a.Subtract(1);
                        a.Multiply(2);

                    }
                }
                 //Interlocked.Decrement(ref tc);
                                });
malkam
  • 2,337
  • 1
  • 14
  • 17
  • What is this code supposed to do? What iss A? What is B? If they're variables outside the scope, then parallelization is of no use here. – Emiswelt Aug 02 '15 at 16:40
  • @Emiswelt This is just sample code. Each iteration (i) is independent so using Parallel.For loop – malkam Aug 02 '15 at 18:56

0 Answers0