|
Mathematica has been a marquis application on the Macintosh for many years. It can be used to analyze and visualize large data sets. You can use it to create animations and simulations and for modeling complex situations. You can solve equations numerically or symbolically, perform complicated symbolic calculations, and produce attractive graphs and create electronic notebooks for experimentation by changing the equations or the data. And all that processing can take advantage of lots and lots of memory. There are two key ways in which an application such as Mathematica can take advantage of 64-bit addressing. When you are working with data sets where the amount of data is fixed and large, you dramatically improve the speed of the calculation with 64-bit addressing if all of the data can be stored in RAM to avoid disk swapping. Secondly, there are algorithms for which all of the data must be in memory. You get much richer output if you can apply your algorithm to 8GB of data instead of, say 500MB. It is as if you move from a pixelated low resolution view of the world to a smooth high resolution view. Expanding Memory Makes It PossibleWolframs Director of User Interface Technology Theodore Gray has been making it easier to do mathematics, science, and engineering on the Macintosh since he co-founded the company with Stephen Wolfram and four others in 1988. In the time since they created Mathematica, RAM and hard drives have grown from kilobytes to gigabytes. The size of the memory that can be addressed by 64 bits is ten orders of magnitude larger than what you can currently install in your machine. Some problems are too big to fit into memory addressable by 32 bits, Theo explains. Text processing and video editing might not need 64 bits but scientific and data analysis applications such as Mathematica can benefit from more memory. With Tiger, the 64-bit address space means that far larger addressing is possible, as long as the application is designed to take advantage of the additional space. It allows applications to handle data sets that are billions of times larger than those that can be addressed with 32 bits and to solve more complicated problems without having to swap data in and out of RAM. Memory has also gotten a lot cheaper, and users today can afford memory in gigabytes, not just megabytes. The computers we use have gotten faster as well. Making Math FasterAdvances in speed mean that you can process more data more quickly. As Theo explains, In a matter of a few seconds your computer can fill multiple gigabytes of memory and perform operations on it. In the old days you would die waiting with all the swapping [to disk] you would have to do. People with high-end problems and large data analysis need more than 4GB of memory on their desktop computer. Gray continues, An example is database manipulation where you have to operate on the whole thing at once. For data that occupies more than 4 GB, the only way to accomplish that is with a larger address space. That is what you get with 64 bits. The availability of faster machines and far more available memory pushes the developers at Wolfram to continue to improve the performance of Mathematica. Theo explains,The faster you can do things, the more memory you need because you can churn through more memory in less time. With more memory, you can perform simple operations on large data sets which leads you to work on improving infrastructure for applying them efficiently. Using the Optimization Tools on Mac OS XSo to really take advantage of all that memory, applications have to be far better optimized. At Wolfram they do not optimize for any particular platform. Their engineers perform optimizations that will benefit the version of Mathematica running on Mac OS X as well as the Linux, Windows, or other Unix versions. Grays strategy is to optimize the parts of Mathematica that result in the greatest performance gains. Mathematica has thousands of algorithms: We cant put hacks in all of them to deal with limited address spaces. A clean 64-bit system allows all of them to work on much larger problems in one fell swoop. We cant practically hand-optimize all of it, we need good compilers to do much of this work. In looking for optimization tools, Theo says that, On Windows, there doesnt appear to be a decent profiler. On the Macintosh we get more usable output with Shark and Sampler, two of the optimization tools that are included at no extra costs with the Xcode developer tools on Mac OS X. Developers use them to identify bottlenecks in their code. Theo says that for engineers who are optimizing, say, video compression, it may be important to squeeze out the last clock cycle. His preference is to use the Developer Tools to help locate potential big gains in performance. According to Theo, Shark and Sampler have helped us discover stupid things that are easy to fix. Im not interested in last 10% of performance. Im looking at the other 90% and asking if I can do something fundamentally different there. Thats more typical of most software optimization. One of the areas targeted for improvement in versions 5.0 and 5.1 of Mathematica was the efficiency of large-scale numerics. Theo noted that as a result of these optimizations, dealing with large numerical data sets in Mathematica is as fast as it is in the fastest C libraries. When you are limited to 32-bit addressing while working with large data sets, the advantages gained by improving the algorithms can be obscured by the time required for disk swapping. The optimizations introduced in the 5.0 and 5.1 versions are most apparent when you move to 64-bit. In numerical linear algebra, for example, scientists need to use big tables to find determinants. Being able to keep the tables in RAM means you feel the benefits of the speed increases you get from the improvements in the algorithms. Making a Mountain into Many MolehillsOne common way of handling large problems is to use a grid. You split a large task into smaller pieces and then you distribute the calculation across multiple machines networked together. Theo explains that there are some problems well suited to this approach, but many are better done on a single machine. Gray says, In many cases, what gets done in high performance computing is defined by what can efficiently be done on the grid. Many problems dont fall into that category and dont get solved. He continues, A grid is a solution for a certain class of problems. Animation is an example of a problem that is easy to parallelize. Each frame is a separate easily isolated example. For many classes of problems, its complicated to break a problem into pieces and assemble a final result from the individual computations. A grid is a workaround to what a single computer can do. It can be efficient or it can be cumbersome. Preparing to distribute a calculation reminds Theo of the DOS days of spooling and loading things in and out. Users ended up spending a lot time on the human process of figuring out how to best distribute each calculation. In many cases, this was difficult and it meant spending a lot of time and resources on breaking up the calculation. Today, with a single computer with enough memory to handle these large calculations, you dont need to resort to the grid. What you really want, says Gray, is for the computer to break up your problem and handle it. Where Mathematica really shines is when you have an algorithm. The computer just goes and does it. Its a monolithic thing. In other words, having 64 bits means that more of these complicated calculations can be performed efficiently on a single machine—whereas in the past, you would have had to break the calculations into pieces that could be distributed over a grid of machines, or be performed by a single machine serially. Moving to 64 BitsMoving from 32 bits to 64 bits allows users to address four billion times the memory you could address previously, but of course, this is much more than the physical memory a user can currently purchase or install. The current G5 processor can directly access as much as four terabytes of RAM, hundreds of times more than can fit in any existing enclosure. More importantly, software written for 64-bit processes Tiger won't need to change to take advantage of additional RAM. Theo sees this as a huge advantage. People can now address more memory than they have, and more than they can realistically use, says Theo. 64 bits should be enough. Theo adds, Although weve looked at our current situation and thought it was sufficient before, it is hard to imagine needing to have more than ten thousand petabytes of RAM available to work on a problem. For now, Theo says, having a 64-bit address space is like having unlimited memory. For more information about Mathematica and Wolfram Research, see www.wolfram.com |