MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Enable multicore calculation ?

Michael Weyrauch wrote:
> Hello Szbolcs,
>    I am not competent enough to answer such questions, as I have no
> knowledge how the various functions you mention are implemented.
> It is just my experience that "analytic" calculations using Map, Apply
> Inner and all that never seem to use multicores (in my particular
> applications).
> Up to now I only experienced multicore use in calculations using
> NDSolve, where the calculation of the "right hand side" of a large set
> of coupled ordinary differential equations requires the inversion of
> matrices. So I must say that I do not even know which part
> of the numerical calculation uses multicore, Inverse[] or NDSolve[]
> itselve. I just see from the Linux process monitor that CPU usage
> is nearly 400% on an eight processor machine, from which I conclude tha=
> my calculation uses 4 processors (hopefully correct).
> I guess we would need somebody from WRI to enlighten us here...
> Michael
> Szabolcs Horv=E1t schrieb:
>> Michael Weyrauch wrote:
>>> Hello,
>>>    I run some larger calculations on Linux with Mathematica a=
>>> 8 cores essentially using NDSolve, and these calculations definitly u=
>>> usually 4 cores without any interference from my side. Mathematica
>>> seems to detect the multicore environment automatically and the
>>> software acts then accordingly. In a sense I was (positively) surpris=
>>>    However, not everything in Mathematica supports multicore, and it =
>>> my guess and partly my experience that it is mostly (maybe only)
>>> numerical stuff which uses multicores.
>> Dear Michael,
>> I do not have access to any multiprocessor machines which have
>> Mathematica.  I am curious:  do functions like Map or Inner use multip=
>>   processors (in principle it is easy to parallellize these)?  More
>> generally, can those functions that call other Mathematica functions u=
>> more than one processor?  Or is this capability restricted to built-in=

>> operations that are implemented at a lower level than the Mathematica
>> language (such as numerical linear algebra)?
>> Is it guaranteed that Map evaluates the elements of a list in order?
>> What about misuses such as the following:
>> a = 123;
>> Map[(a = 100 + Mod[a, #]) &, {5, 6, 7, 8}];
>> a
>> (Actually this one must be pretty hard to parallellize even if there a=
>> no guarantees about evaluation order.)
>> Szabolcs
Obviously I have no inside knowledge on this, but I would imagine that
it would be extremely hard for Mathematica to use multiple cores for
anything symbolic. Imagine, for example, code that accessed a function f
at the same time as another core was updating the definition of the
function f! By the time you had engineered in all the extra checks to
avoid a collision, you would have probably wiped out any gain in extra
red tape! Possibly compiled code could, in principle, do better because
the compiler can note the larger context in which an operation will be

David Bailey

  • Prev by Date: Re: Does Mathematica really need more printed, introductory documentation?
  • Next by Date: Re: Re: Re: Problems with NSolve
  • Previous by thread: Re: Enable multicore calculation ?
  • Next by thread: Coordinate readout from Graphics3D?