Next: Batch scheduler
Up: OOMMF Batch System
Previous: OOMMF Batch System
Subsections
The batch solver script batchsolve.tcl provides a simple
command line interface to the OOMMF micromagnetic solver engine.
oommf.tcl batchsolve [[-file] <filename.mif>] [-no_interface] \
[-start_paused] [-end_paused] [-end_exit]
where
- [-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.
- -no_interface
- Don't export an interactive interface. Currently this is the only
network-active code inside batchsolve.tcl. (However,
this file may be sourced from inside another script (e.g.,
batchslave.tcl) that could provide network access to the solver
code without going through the interactive interface.)
- -start_paused
- Pause solver after loading problem.
- -end_paused
- 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).
- -end_exit
- Explicitly call exit at bottom of batchsolve.tcl.
The input filename.mif file is a standard OOMMF MIF (Micromagnetic Input Format) file, such as produced by the problem
editor application (mmpe.tcl). The batch solver will search
several directories for this file, including the current working
directory, the data and scripts subdirectories, and
parallel directories relative to the OOMMF mmsolve and
mmpe application directories. Refer to the mif_path
variable in batchsolve.tcl for the complete list.
If the interactive interface is active, then batchsolve.tcl
will register itself with the OOMMF account server and will show up
in the OOMMF launcher application threads list. From there you can
bring the interactive interface up and connect display widgets (in the
same manner as for the interactive solver application, mmsolve).
The interface also allows you to pause, un-pause, and terminate the
current simulation. If you need more interactive control, use
mmsolve instead of batchsolve.tcl.
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 widgets before the simulation is begun. Start the
simulation by selecting the Run command from the interactive
interface.
The -end_paused
switch will insure 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 behavior is
to write tabular text data and the magnetization state at equilibrium
for each 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
batchsolver.tcl for current details, but at present the output
consists of 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.fieldnnnn.omf, where
nnnn starts at 0000 and is incremented at each field step.
(The ascii header inside each file records the nominal applied field
at that step.) These files are viewable using the mmdisp
application.
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.
- mif
- This is a Tcl handle to a global mms_mif object
that is used to initialize and reset the solver by the default
batchsolver.tcl routines.
- solver
- Handle to the omf_solver object.
- search_path
- Directory search path use by the
FindFile proc.
Refer to the documentation on these objects for details on their
manipulation.
Batchsolve procs
The following Tcl procedures are designed for external use and/or
redefinition:
- SolverTaskInit
- Called at the start of each task.
- BatchTaskRelaxCallback
- Called at each equilibrium state reached in the simulation.
- SolverTaskCleanup
- Called at the conclusion of each task.
- FindFile
- Finds a file using the directory search path specified by the
global variable search_path. 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
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 Documentation Team
August 12, 1998