OOMMF Home next up previous contents
Next: Batch scheduler Up: OOMMF Batch System Previous: OOMMF Batch System

Batch solver

The batch solver script batchsolve.tcl provides a simple command line interface to the OOMMF micromagnetic solver engine.

The batch solver is launched by the command line:

tclsh app/oommf/oommf.tcl batchsolve [-notk] [[-file] <filename.mif>] \
     [-no_interface] [-start_paused] [-end_paused] [-end_exit]
Do not load Tk or display a (blank) window,
[-file] <filename.mif>
Immediately load and run the specified MIF file. The [-file] tag may be omitted if the first character of filename is not a hyphen.
Do not register with the account service directory application. As a result, batchsolve.tcl will not show up on the threads list in mmLaunch, and no interactive interface will be provided by mmLaunch. (However, if batchsolve.tcl is invoked from inside another script (e.g., batchslave.tcl), the calling script could provide an interface to the batch-controlled solver.)
Pause solver after loading problem.
Pause solver and enter event loop at bottom of batchsolve.tcl rather than just falling off the end (the effect of which will depend on whether or not Tk is loaded).
Explicitly call exit at bottom of batchsolve.tcl.

The input filename.mif file should contain a Micromagnetic Input Format (MIF) problem description, such as produced by mmProbEd. The batch solver searches several directories for this file, including the current working directory, the data and scripts subdirectories, and parallel directories relative to the directories app/mmsolve and app/mmpe in the OOMMF distribution. Refer to the mif_path variable in batchsolve.tcl for the complete list.

If batchsolve.tcl registers itself with the account service directory application, it will appear in the Threads list of any running copy of mmLaunch, and mmLaunch will provide an interactive interface on behalf of batchsolve.tcl. Using this interface, batchsolve.tcl may be controlled in a manner similar to mmSolve2D. The interface allows you to pause, un-pause, and terminate the current simulation, as well as to attach data display applications to monitor the solver's progress. If more interactive control is needed, mmSolve2D should be used.

Use the -start_paused switch to monitor the progress of batchsolve.tcl from the very start of a simulation. With this switch the solver will be paused immediately after loading the specified MIF file, so you can bring up the interactive interface and connect display applications before the simulation begins. Start the simulation by selecting the Run command from the interactive interface.

The -end_paused switch insures that the solver does not automatically terminate after completing the specified simulation. This is not generally useful, but may find application when batchsolve.tcl is called from inside a Tcl-only wrapper script.

The output may be changed by a Tcl wrapper script, but the default output behavior of batchsolve.tcl is to write tabular text data and the magnetization state at equilibrium for each applied field step. The tabular data are appended to the file basename.odt, where basename is specified in the input MIF file. See the routine GetTextData in batchsolve.tcl for details, but at present the output consists of the solver iteration count, nominal applied field B, reduced magnetization m, and total energy. This output is in the ODT file format.

The magnetization data are written to a series of OVF (OOMMF Vector Field) files, basename.field nnnn.omf, where nnnn starts at 0000 and is incremented at each applied field step. (The ASCII header inside each file records the nominal applied field at that step.) These files are viewable using mmDisp.

Programmer's interface
In addition to directly launching batchsolve.tcl from the command line, it may also be sourced from inside another Tcl script, e.g., batchslave.tcl, that provides additional control structures. There are several variables and routines inside batchsolve.tcl that may be accessed and redefined from such a wrapper script to provide enhanced functionality.

Global variables

A Tcl handle to a global mms_mif object holding the problem description defined by the input MIF file.
A Tcl handle to the mms_solver object.
Directory search path used by the

FindFile proc.

Refer to the source code and sample scripts for details on manipulation of these variables.

Batchsolve procs
The following Tcl procedures are designed for external use and/or redefinition:

Called at the start of each task.
Called at each equilibrium state reached in the simulation.
Called at the conclusion of each task.
Searches the directories specified by the global variable search_path for a specified file. The default SolverTaskInit proc uses this routine to locate the requested input MIF file.
The first and third of these accept an arbitrary argument list (args), which is copied over from the args argument to batchsolve.tcl procs BatchTaskRun and BatchTaskLaunch. Typically one copies the default procs (as needed) into a task script, and makes appropriate modifications. You may (re-) define these procs either before or after sourcing batchsolve.tcl.

OOMMF Home next up previous Contents

OOMMF Documentation Team
February 23, 2000