Borys Uspenskyi

15 Reputation

3 Badges

2 years, 276 days

MaplePrimes Activity


These are questions asked by

I am trying to perform a numerical integration of a matrix using parallel computing. I have found two packages to do that:

1. With Threads package

A:=Matrix([x,x^2],[2*x,sin(x)]);

Threads[Map](int,A,x=0..2,numeric=true);

This code does not parallelize at my Ryzen 5 processor and is using exactly 1 logical core during computation. The matrix is just an example, real matrices are much bigger.

kernelopts(multithreaded) returns true

kernelopts(numcpus) returns 6 when SMT is off and 12 when SMT is on (pretty weird though, it should always return 6)

2. With Grid package

A:=Matrix([x,x^2],[2*x,sin(x)]);

Threads[Map](int,A,x=0..2,numeric=true);

This leads to numerous messages:

"Error, attempting to assign to `int` which is protected.  Try declaring `local int`; see ?protect for details."

Meanwhile, the rezult seems OK and all cores are working to produce it.

What am I doing wrong?

Page 1 of 1