Difference between revisions of "Run TUFLOW From a Batch-file"
Line 23: | Line 23: | ||
==Other Batch File Switches== | ==Other Batch File Switches== | ||
===Setting a priority=== | ===Setting a priority=== | ||
+ | The priority of a process (such a TUFLOW simulation) can be specified within a batch file. This can be useful for a number of reasons: | ||
+ | *Lowering the priority of a simulation to allow you to continue working; | ||
+ | *Setting a high priority for critical runs; or | ||
+ | *Making sure you runs are high priority on a shared computing resource! | ||
+ | |||
+ | The following are valid priority switches (in increasing order of priority): | ||
+ | */LOW | ||
+ | */BELOWNORMAL | ||
+ | */NORMAL | ||
+ | */ABOVENORMAL | ||
+ | */HIGH | ||
+ | */REALTIME | ||
+ | |||
+ | An example of a low priority simulation is: | ||
+ | <pre>Start /low | ||
+ | |||
===Testing a simulation=== | ===Testing a simulation=== | ||
===Copy a TUFLOW model=== | ===Copy a TUFLOW model=== |
Revision as of 08:11, 7 October 2011
TUFLOW simulations can also be started from a batch file. Batch files are text files which contain a series of commands. Batch files allow a large degree of flexibility in starting TUFLOW simulations, advanced batch files can be used to:
- Run multiple simulations
- Set CPU priority for TUFLOW simulations
- Create a wait (e.g. start a simulation in 1 hour)
- Test simulation input
- Copy a TUFLOW model
- Post process results after simulation has finished.
Match file for Tutorial Model Module 1
To use a batch file, create a new text file in the TUFLOW\runs directory. The name is arbitrary but the file must have the extension ".bat". For example the file name could be _run_TUFLOW.bat.
Open this file in a text editor and add the following line.
"C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" "M01_5m_001.tcf"
This is the simplest command line for starting TUFLOW, the line above contains only two arguments, the first is the path to the TUFLOW executable and the second argument "M01_5m_001.tcf" is the simulation file name. Depending on the location of the executable the above command line will need to be modified. The quotations around the TUFLOW executable and the .tcf file name are only required if there are spaces in the file names. However, it is recommended to include these to avoid problems.
TIP:
A second line with the text "pause" can be added, this will prompt the user to press a key at the end of the batch file. This is useful if the DOS window disappears from the screen, before you can read the output, the pause command will keep the window open.
"C:\TUFLOW\Releases\2011-09\w32\TUFLOW_iSP_w32.exe" "M01_5m_001.tcf" pause
Other Batch File Switches
Setting a priority
The priority of a process (such a TUFLOW simulation) can be specified within a batch file. This can be useful for a number of reasons:
- Lowering the priority of a simulation to allow you to continue working;
- Setting a high priority for critical runs; or
- Making sure you runs are high priority on a shared computing resource!
The following are valid priority switches (in increasing order of priority):
- /LOW
- /BELOWNORMAL
- /NORMAL
- /ABOVENORMAL
- /HIGH
- /REALTIME
An example of a low priority simulation is:
Start /lowTesting a simulation
Copy a TUFLOW model
Advanced Batch Files
Creating a wait