next up previous contents
Next: 5.2.1 Serial Initialization Up: 5. Implementation Previous: 5.1 Required Libraries   Contents


5.2 Program Structure

The micromagnetics application can be divided into four sections (Fig. 5.3). First there is a short serial initialization part, which is executed on just one single processor. It reads the configuration files, various input files for the finite element mesh, the initial magnetization, material parameters, etc. Then the data are distributed to the different processors and all required initialization steps for parallel processing are initiated. Next the micromagnetic solvers are initialized, any remaining data structures are created, and stiffness and boundary matrices are calculated. Then the solver is called, which calculates energies and energy gradients, local fields and magnetization distributions. It continues calculating iteratively all desired quantities until some exit condition is met. Finally, the last state of the simulation is stored, all data structures are destroyed and the parallel processing environment is cleaned up.

Figure 5.3: Coarse flow chart of the program.
\includegraphics[scale=0.5]{fig/talk/fig/fluss1.fig.eps}

To achieve optimal performance, it is sensible to make the initial serial initialization part as short as possible. However, this may require some additional data exchange between different processors at a later stage of the initialization phase. Even worse, it increases the amount of ``bookkeeping'' which is necessary to keep track of the distributed data. This trade off has shown up in the mesh partitioning phase, which can be done in parallel using ParMetis via the built-in interface of PETSc. Yet, it proved to be easier to handle, if it is done during the serial initialization phase on just a single processor. Since the whole initialization process itself usually takes only a fraction of the time of the rest of the simulation, it is not as important anyway.



Subsections
next up previous contents
Next: 5.2.1 Serial Initialization Up: 5. Implementation Previous: 5.1 Required Libraries   Contents
Werner Scholz 2003-06-08