Dave L

Dave Linder

472 Reputation

16 Badges

15 years, 305 days
Maplesoft
Software Architect
Waterloo, Ontario, Canada

 

Dave Linder
Mathematical Software, Maplesoft

MaplePrimes Activity


These are replies submitted by Dave L

For 2D Math input in Maple 12, <Ctrl>-underscore should result in an atomic identifier, without having to use palettes or context-menus. 

Dave Linder
Mathematical Software, Maplesoft

For 2D Math input in Maple 12, <Ctrl>-underscore should result in an atomic identifier, without having to use palettes or context-menus. 

Dave Linder
Mathematical Software, Maplesoft

During the development cycle of Maple 9.5 (Jan, 2004) I removed these lines from the very top of `fsolve/EvalAtx` (which dates back to 1996),

   1   if 10000 < max(op(map(abs,map2(op,2,indets([v, f],float))))) then
   2     return exponent_overflow
       end if;

The start of my comment in the source revision begins, "Removal of a highly dubious mechanism for guessing whether the expression will under/overflow." and goes on with a bit of a rant about it. I can hardly imagine why I didn't notice the similar lines at the end of that short routine. I think that I was really focused on this next example, which did not work in Maple 9 and earlier.

fsolve((10.51627310^n-1/2*22.09916394^n-1/2*0.^n)/(1/2*17.95621497^n+1/2*7.261843774^n-10.51627310^n)-1, n=0.5..2);

Jacques, I know that you will be aware of it but others might not realize that from-the-hip editing of Library routines can be a risky thing. That can be so even when one has strong grounds to deem a fix as "good". Maple's so complicated that any adjustment really needs a full test run to ensure that no regressions are caused. I'd be remiss if I didn't mention that, given your code surgery example.

Dave Linder
Mathematical Software, Maplesoft

Duly noted, thanks.

Dave Linder
Mathematical Software, Maplesoft

Currently,

> assume(n>0):
> is(2^n>n);
                                    true

> assume(r,RealRange(Open(-1),Open(1)));
> limit(r^n,n = infinity);
                                            n
                                lim       r~
                           n -> infinity

And, after the simple flip of how `is/RealRange` calls `property/PropInclusion` in its last line,

> assume(n>0):
> is(2^n>n);
                                     false

> assume(r,RealRange(Open(-1),Open(1)));
> limit(r^n,n = infinity);
                                       0

There's always work to be done.

Dave Linder
Mathematical Software, Maplesoft

Currently,

> assume(n>0):
> is(2^n>n);
                                    true

> assume(r,RealRange(Open(-1),Open(1)));
> limit(r^n,n = infinity);
                                            n
                                lim       r~
                           n -> infinity

And, after the simple flip of how `is/RealRange` calls `property/PropInclusion` in its last line,

> assume(n>0):
> is(2^n>n);
                                     false

> assume(r,RealRange(Open(-1),Open(1)));
> limit(r^n,n = infinity);
                                       0

There's always work to be done.

Dave Linder
Mathematical Software, Maplesoft

We can look into this. Thanks, Jacques.

Dave Linder
Mathematical Software, Maplesoft

We can look into this. Thanks, Jacques.

Dave Linder
Mathematical Software, Maplesoft

It took me 4-5 guesses, though.

Dave Linder Mathematical Software, Maplesoft

Was the corporate name Maplesoft coined by a woman?

Dave Linder
Mathematical Software, Maplesoft

I agree with what you write, Jacques, about the importance of good documention of the system (and its changes... and its updates...).

I was considering that (at least) for float[8] datatype Matrices and Vectors LinearAlgebra:-Map could reasonably call map[evalhf,inplace].

Dave Linder Mathematical Software, Maplesoft

In that note I was considering replacing the ATLAS BLAS that are already bundled with Maple. That might be relevant if one had an 8-core machine and was running Linux.

There is no dynamic mechanism in the shipped ATLAS binaries to handle varying the number of cores/cpus that get used: it's set and compiled in as a fixed parameter. Maple doesn't ship with an 8-core/cpu optimized ATLAS on Linux, so if one had such a machine then dropping in a replacement might be desirable. But on Windows with MKL it might be dynamically set, using that OMP_NUM_THREADS environment variable.

One cannot simply drop into Maple an updated set of .dll's to MKL. The bits that use it must be linked against it specifically. But there's less reason to want to do so, because of the above.

Dave Linder Mathematical Software, Maplesoft

I just tried it and yes, you're right. It's 10sec with 64bit Maple (Linux) and 42sec with 32bit Maple (Linux), run on the same machine and OS.

Sorry, I missed that. So only about 100 times faster than 4800 sec, then.

By the way, I have read here that you are interested in solving problems with high performance. Have you see this note about OMP_NUM_THREADS? If you set that to the value 2 as a WinXP environment variable on your Core2 Duo (and reboot to get it to take effect) then you may see improvement in the hardware floating-point linear algebra examples. It could allow the MKL used by Maple to run two threads. But you'd have to measure wall clock time, since Maple's time() command will add the times take by both threads make it appear like there's no difference.

Dave Linder Mathematical Software, Maplesoft

Using an accelerated, fast BLAS set is important, but after attaining a certain major proportional gain over generic refrence BLAS the smaller differences between fast implmentations becomes less important. An exception to that idea is that threaded parallel implementations for SMP or multi-core machines can still be a further major benefit. It's also often the case that resolving Maple Library level interpreted code bottlenecks is also a fruitful area for focus and improvement, especially once some fast BLAS has been utilized. In other words, once fast BLAS are in use on a platform then further tweaking to get a little more performance out of the BLAS is effort less well spent than would be finding other bottlenecks in the Maple Library -- with multithreading being a possible exception.

Cleve Moler made a brief mention in Cleve's Corner, Winter 2000, to the effect that there was not much difference between MKL and ATLAS. That statement is dated, or course. Any difference is going to change over time, depending on which makes best use of new chipset extensions in a timely fashion.

There is an AMD equivalent to Intel's MKL. It is the AMD ACML.

The past few releases of the Intel MKL have also been available for Linux. The Maple-NAG Connector toolbox allows for use of generic, MKL, or ACML BLAS where the corresponding supported NAG C Library allows.

Tip for today: The environment variable OMP_NUM_THREADS can be set to the number of SMP CPUs or cores, on a MS-Windows machine. The Intel MKL should pick this up and allow parallel computation, especially noticable in large floating-point level-3 BLAS calls. While this can bring a benefit for true multi-core machines, it can degrade performance on a single-core hyperthreaded CPU if nice access to cached data is ruined.

Dave Linder Mathematical Software, Maplesoft

For problem 14, "Gaussian error function over a 1500x1500 matrix"

The original code,

with(LinearAlgebra):
TotalTime:=0:
for i from 1 by 1 to 100 do
  a:=RandomMatrix(1500,density=0.5,generator=0.0..1.0,outputoptions=[datatype=float[8]]):
  t:=time():
  Map(erf,a):
  TotalTime:=TotalTime+time()-t:
end do:
print(TotalTime);

was reported as taking about 4800 sec on their "Intel Quad Core Q6600 processor with 2.4 GHz and 2 GB RAM running under Windows Vista Home".

Replacing

     LinearAlgebra:-Map(erf,a):

with

     map[evalhf](erf,a):

makes it take only 17 sec on a single-CPU AMD Athlon64 3200+ under 64bit Linux with Maple 11.02.

Using,

     map[evalhf,inplace](erf,a):

brought it to 10 sec.

Dave Linder Mathematical Software, Maplesoft

4 5 6 7 8 9 10 Page 6 of 11