Field Precision title

Why does it run so slowly?

I recently received two complaints from users about long solution times for 3D calculations. In this article, I want to say a few words about computation speed.

In the first case, a trial user had concluded that the AMaze programs were unusable. He found it took 5 hours to process a single case with MetaMesh. The resolution was clear when I discovered that he was running the trial on a vintage computer with 512 MB of RAM. Of the available memory, the operating system was probably using over 400 MB. The computer was performing prodigious acts of disk swapping. When I ran the example on my old workstation with 2 GB of memory, it took about 6 minutes.

The second case was a new user who thought that the long run times may have been the result of his computer hardware. It turned out that he had two very good machines with dual-core processors and plenty of memory. For computers at this level, the hardware parameters have only a small effect on the run time. The major determinant of solution time is the user. The quality of the setup and the choice of parameters may change the run time by more than an order of magnitude.

Three-dimensional solutions are the grand challenge of numerical field calculations. Here. it's you against the big numbers. Although our software is among the fastest available, a solution with 30 million elements is going to take a long time. New users tend to create very large meshes and expect that the software to take care of everything. This is analogous to buying a Jaguar, loading the truck with 1000 pounds of bricks and then complaining about the handling.

The best way to reduce solution time is to plan carefully before sitting down at the computer. An hour spent making sketches and thinking about the physical nature of the fields can save many hours of run time. There are several issues to consider. What are the critical volumes where accurate values are required? Can features be eliminated? Can the solution volume be reduced without affecting the interior fields? Can symmetry be exploited? Can advanced code features like the Boundary command be utilized? With regard to these questions, the examples supplied with the programs provide good guidelines.

A good way to avoid wasted effort is run to some preliminary 2D calculations. (This is why we include 2D programs in our Advanced Design Suites.) You can get a physical sense of the fields and insights into how material properties and region shapes affect them. I experienced the benefits of a preliminary 2D solution in a recent consulting job to design a permanent-magnet focusing assembly. I resisted the temptation to jump immediately to the full 3D solution. Instead, I proceeded in three steps:

  1. A 2D PerMag solution for a long system.
  2. A 3D Magnum solution with symmetry boundaries of the same system.
  3. A 3D Magnum solution of the complete system with end effects.

Initially, the 2D and 3D solutions did not agree. After some checking, I found that I had gotten lazy and did not allow sufficient cycles for convergence of the 3D solution. With an increased number of iteration cycles, the two codes agreed exactly. Without the check, I could have wasted days generating invalid solutions for the full system.

Eventually, a point comes when a large-mesh solution is unavoidable. If you have prepared carefully, only a few large production runs should be necessary. Here, multi-core machines are a real benefit. In the interactive mode, you can start an instance of the solution program and minimize the window. The solution can run for hours at full speed and you can still use computer normally using the free core(s). To help with long runs, we designed all our programs with the capability to run in the background under batch file control. With this feature, you can set up multiple production solutions to run overnight.

ALT TITLE
CAPTION


LINKS