Personal Stories

Stories about how you have used Maple, MapleSim and Math in your life or work.

For your information.

The growth of the audience of russian Maple site webmath.exponenta.ru
According bigmir.net

 year        hits          visitors         hosts        

 2010      608 118    193 495     179 328
 2011  ...

Yesterday I wrote a post that began,

"I realized recently that, while 64bit Maple 15 on Windows (XP64, 7) is now using accelerated BLAS from Intel's MKL, the Operating System environment variable OMP_NUM_THREADS is not being set automatically."

But that first sentence is about where it stopped being correct, as far as how I was interpreting the performance on 64bit Maple on Windows. So I've rewritten the whole post, and this is the revision.

I concluded that, by setting the Windows operating system environment variable OMP_NUM_THREADS to 4, performance would double on a quad core i7. I even showed timings to help establish that. And since I know that memory management and dynamic linking can cause extra overhead, I re-ran all my examples in freshly launched GUI sessions, with the user-interface completely closed between examples. But I got caught out in a mistake, nonetheless. The problem was that there is extra real-time cost to having my machine's Windows operating system dynamically open the MKL dll the very first time after bootup.

So my examples done first after bootup were at a disadvantage. I knew that I could not look just at measured cpu time, since for such threaded applications that reports as some kind of sum of cycles for all threads. But I failed to notice the real-time measurements were being distorted by the cost of loading the dlls the first time. And that penalty is not necessarily paid for each freshly launched, completely new Maple session. So my measurements were not fair.

Here is some illustration of the extra real-time cost, which I was not taking into account. I'll do Matrix-Matrix multiplication for a 1x1 example, to try and show just how much this extra cost is unrelated to the actual computation. In these examples below, I've done a full reboot on Windows 7 where so annotated. The extra time cost for the very first load of the dynamic MKL libraries can be from 1 to over 3 seconds. That's about the same as the cpu time this i7 takes to do the full 3000x3000 Matrix multiplication! Hence the confusion.

Roman brought up hyperthreading in his comment on the original post. So part of redoing all these examples, with full restarts between them, is testing each case both with and without hyperthreading enabled (in the BIOS).

Quad core Intel i7. (four physical cores)

Hyperthreading disabled in BIOS
-------------------------------

> restart: # actual OS reboot
> getenv(OMP_NUM_THREADS);   # NULL, unset in OS

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=217.18KiB, alloc change=127.98KiB, cpu time=219.00ms, real time=3.10s

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ):
memory used=9.46KiB, alloc change=0 bytes, cpu time=0ns, real time=0ns


> restart: # actual OS reboot
> getenv(OMP_NUM_THREADS);
                              "4"

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=216.91KiB, alloc change=127.98KiB, cpu time=140.00ms, real time=2.81s

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ):
memory used=9.46KiB, alloc change=0 bytes, cpu time=0ns, real time=0ns


Hyperthreading enabled in BIOS
------------------------------

> restart: # actual OS reboot
> getenv(OMP_NUM_THREADS);    # NULL, unset in OS

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=217.00KiB, alloc change=127.98KiB, cpu time=202.00ms, real time=2.84s

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ):
memory used=9.46KiB, alloc change=0 bytes, cpu time=0ns, real time=0ns


> restart: # actual OS reboot
> getenv(OMP_NUM_THREADS);
                              "4"

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=215.56KiB, alloc change=127.98KiB, cpu time=187.00ms, real time=1.12s

> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ):
memory used=9.46KiB, alloc change=0 bytes, cpu time=0ns, real time=0ns


Having established that the first use after reboot was incurring a real time penalty of a few seconds, I redid the timings in order to gauge the benefit of having OMP_NUM_THREADS set appropriately. These too were done with and without hyperthreading enabled. The timings below appear to indicate that slightly bettern performance can be had for this example in the case that hyperthreading is disabled. The timings also appear to indicate that having OMP_NUM_THREADS unset results in performance competitive with having it set to the number of physical cores.

Hyperthreading disabled in BIOS
-------------------------------

> restart:
> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=217.84KiB, alloc change=127.98KiB, cpu time=141.00ms, real time=142.00ms

> getenv(OMP_NUM_THREADS);  # NULL, unset in OS

> M:=LinearAlgebra:-RandomMatrix(3000,datatype=float[8]):
> CodeTools:-Usage( M . M ):
memory used=68.67MiB, alloc change=68.74MiB, cpu time=7.50s, real time=1.92s


> restart:
> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=217.84KiB, alloc change=127.98KiB, cpu time=141.00ms, real time=141.00ms

> getenv(OMP_NUM_THREADS);
                              "1"

> M:=LinearAlgebra:-RandomMatrix(3000,datatype=float[8]):
> CodeTools:-Usage( M . M ):
memory used=68.67MiB, alloc change=68.74MiB, cpu time=7.38s, real time=7.38s


> restart:
> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=217.11KiB, alloc change=127.98KiB, cpu time=125.00ms, real time=125.00ms

> getenv(OMP_NUM_THREADS);
                              "4"

> M:=LinearAlgebra:-RandomMatrix(3000,datatype=float[8]):
> CodeTools:-Usage( M . M ):
memory used=68.67MiB, alloc change=68.74MiB, cpu time=7.57s, real time=1.94s



Hyperthreading enabled in BIOS
------------------------------

> restart:
> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=216.57KiB, alloc change=127.98KiB, cpu time=125.00ms, real time=125.00ms

> getenv(OMP_NUM_THREADS);  # NULL, unset in OS

> M:=LinearAlgebra:-RandomMatrix(3000,datatype=float[8]):
> CodeTools:-Usage( M . M ):
memory used=68.67MiB, alloc change=68.74MiB, cpu time=8.46s, real time=2.15s


> restart:
> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=216.80KiB, alloc change=127.98KiB, cpu time=125.00ms, real time=125.00ms

> getenv(OMP_NUM_THREADS);
                              "1"

> M:=LinearAlgebra:-RandomMatrix(3000,datatype=float[8]):
> CodeTools:-Usage( M . M ):
memory used=68.67MiB, alloc change=68.74MiB, cpu time=7.35s, real time=7.35s


> restart:
> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=216.80KiB, alloc change=127.98KiB, cpu time=125.00ms, real time=125.00ms

> getenv(OMP_NUM_THREADS);  # NULL, unset in OS
                              "4"

> M:=LinearAlgebra:-RandomMatrix(3000,datatype=float[8]):
> CodeTools:-Usage( M . M ):
memory used=68.67MiB, alloc change=68.74MiB, cpu time=8.56s, real time=2.15s


> restart:
> CodeTools:-Usage( Matrix([[3.]]) . Matrix([[3.]]) ): # initialize external libs
memory used=216.80KiB, alloc change=127.98KiB, cpu time=125.00ms, real time=125.00ms

> getenv(OMP_NUM_THREADS);
                              "8"

> M:=LinearAlgebra:-RandomMatrix(3000,datatype=float[8]):
> CodeTools:-Usage( M . M ):
memory used=68.67MiB, alloc change=68.74MiB, cpu time=8.69s, real time=2.23s

With all those new timing measurements it appears that having to set the global environment variable OMP_NUM_THREADS to the number of physical cores may not be necessary. The performance is comparable, when that variable is left unset. So, while this post is now a non-story, it's interesting to know.

And the lesson about comparitive timings is also useful. Sometimes, even complete GUI/kernel relaunch is not enough to get a level and fair field for comparison.

Recently posted onto Wolfram's Blog is a set of 10 tips for how to write fast Mathematica code.  It is a very amusing read -- go read it now, because below I am going to make some comments on it, assuming that you have read it.

 

  1. Use floating-point numbers if you can, and use them early.
    Basically: if you're using Mathematica as a...

My daughter the psychiatrist recently shared a link with me that mentioned a factoid about Facebook: "84 per cent of people think their friends have more friends than they do".  Actually they don't just think this: for 84 percent of Facebook users, the median friend count of their friends is higher than their own friend count, according to

I'm happy to announce that, having retired from University of British Columbia, I've joined Maplesoft as a Content Developer.  Some of my work will be appearing in the Application Center from time to time, and I'll announce them here.  If you have any suggestions for topics you'd like to see in the Application Center, I'd be interested in seeing them.

The iPad is a very exciting device and it has been gaining broad adoption from our academic and professional customers alike. It was a logical step for us to bring Maple technology to this platform.
 
The Maple Player for iPad is now available in the Apple App Store. It comes bundled with ready-made interactive Maple documents, covering topics like integration, differentiation, computing...

Today we've lost computing pioneer Dennis Ritchie. For those not familiar with Dr. Ritchie, he was the co-inventor of the Unix operating system (with Ken Thompson), and the C programming language (with Brian Kernighan), both of which are an integral part of Maple's history.

When Gaston Gonnet implemented the very first version of the Maple kernel, he wanted to do it in the then-new C language, for the hardware and operating system independence that it provided. Unfortunately,...

It would be good I hope to present symbolic-numeric CAE system for framed structures analysis.

It will be available soon as Preview version for enthusiasts

The main features are:

  • One calculation act - all analytical dependencies.
  • Fast designing process for structural systems in industry, consulting and design companies;
  • Fastest parametric analysis of construction. New quality of designing in optimization tasks,...

I think this is more of a blog but we don't have that option so it is here in a post.  Occassionally I like to use Maple to grab data from the internet. 

The problem is that everyone seems to be changing the formats of their webpages.  Out with the old simple txt fomatted data webpages and in with the new html formatted webpages. The trouble with that is, if you already have a worksheet setup to manipulate the data using sockets or HTTP[Get] you...

 

                

3D Paper Physical Model

We are looking for a Maple Wizard to join our team, based in California. US citizenship is an absolute requirement. Please send me a message if you are interested or know someone who might be.

thanks

Td_Group_Adapted_Dou.zip 

Point Groups typical to cubic crystals are Tetrahedral (Td) in Zinc-blende and Octahedral (Oh = i x Td) in Diamond.  Symmetry operations give rise to the widespread application of Group Theory most notably to generate basis functions which transform according to irreducible representations.  Much work has been accomplished using Single Group basis, compatible...

In 2010-2011, I persuaded tens of thousands of Russian and Ukrainian students and students in that Maple - a very useful thing.
Testimonials - the number of visits and thanks.
So I decided to resurrect some of my old sites.
Not just for history!

The first: Maple PoverTools.

http://powertool.narod.ru/

Hello:

I'm studying many time ago the quantum chemistry of rectivity . so far, I can arrive to news theories from my experince on Maple productcs as they are incorporated in my theoric equations. I have glad  on communicat my previous results on Chemical Reactivity and Uniffied Field. botn of those ara closely related and my purpose is obtain diffusion and comments on these.

- My first paper was on Chemical Reactivity (Kinetics and Dynamics) and...

This is for Spanish speakers only. Not related to Maple, but related to Math. The Spanish newspaper El Pais has a series of videos on various math problems, together with solutions (posted later), it's set up as a sort of competition but just watching is (usually) great fun. You can access the full archive online.

You probably don't need to know much Spanish to follow the problems. Much is illustrated in writing on a black or white board. If you don't speak any Spanish...

First 12 13 14 15 16 17 18 Last Page 14 of 25