Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

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

Search the Archive

Re: Converting Mathematica code to C++

  • To: mathgroup at
  • Subject: [mg88274] Re: [mg88251] Converting Mathematica code to C++
  • From: jmt <jmt at>
  • Date: Wed, 30 Apr 2008 04:25:21 -0400 (EDT)
  • References: <>
  • Reply-to: jmt at


The company I am currently working for recently asked me to evaluate the 
transformation of a complex Mathematica code into C++.

So I considered using MathCode C++.
In short : MathCode C++ is a wonderful tool when you start a project, but when 
your already written Mathematica code uses mostly all features available in 
Mathematica, the task of conforming Mathematica code to MathCode C++ 
(MathCode C++ understands only a subset of Mathematica) is very frustrating ; 
rewriting all in C++ seems easier, because you can then use all features of 

Also note that Mathematica code can often be optimized, and that most of 
numerics in Mathematica hide C/C++ code, so that a gain using efficiency of 
C++ is not dramatic.

Finally, your code must be parallelized if you want it to run on a cluster :  
the task of parallelizing code is a prerequisite, and certainly not easy. 
Afterwards, on a cluster, the un-parallelized code is only a kind of glue 
code, not needing to be fast ; and Mathematica is great for this kind of 

In your case, I should have a look on Grid Mathematica.

On 2008 04 29, Charlie Brummitt wrote:
  > Hi all,
  > I am considering running my research project on a computer cluster on
  > campus. However, the computer cluster requires the programs to be in C++,
  > and I've already coded much of the project in Mathematica. Do converters
  > such as MathCode C++
  > <> work
  > well? Or do I need to re-write everything in C++ (not to mention learn
  > how to code in C++)?
  > If it's relevant, my project calculates the Lyapunov exponents of partial
  > differential equations, and the goal is to find the simplest chaotic PDE.
  > I'm considering trying Intel's Compiler 10.1 for MacOSX, but I am very
  > reluctant to abandon Mathematica to learn to use Intel's interface and
  > others' PDE solvers in C++.
  > Thanks to infinity,
  > Charlie Brummitt
  > University of Wisconsin - Madison
 Informatique technique et scientifique

	Jean-Marie Thomas

       +33 (0)1 75 57 60 75
       +33 (0)6 37 18 86 63

  • Prev by Date: Re: Converting Mathematica code to C++
  • Next by Date: Re: Does Mathematica really need more printed, introductory documentation?
  • Previous by thread: Converting Mathematica code to C++
  • Next by thread: Re: Converting Mathematica code to C++