Examples and Further Explanations of -batchoptions
This section provides examples and further explanations
of -batchoptions
.
- Example with registry settings specified on the command line
- Example with registry settings specified in a file
- When to use the -batchoptions Desktop command line option
The following examples use general Desktop and Maxwell-specific settings. This feature is available for all desktop products.
- The registry path separator is the slash ( / ) character.
- Each complete registry key (that is, a registry path and option name) is enclosed in single quotes.
- Registry string values are enclosed in single quotes.
- After the
-batchoptions
switch, the set of registry keys and values that follows it must be enclosed in double quotes. However, if a batchoptions file is referenced (instead of listing the options directly on the command line), the double quotes are not used around the filename. - Backslashes in registry key string values must be escaped with another backslash ( \\ ) because a backslash by itself is an escape code within strings.
Example with registry settings specified on the command line
ansysedt.exe -batchsolve -batchoptions
"'Desktop/Settings/ProjectOptions/NumberOfProcessors'=4
'Maxwell3D/NumCoresPerDistributedTask'=2 (* This option is not currently available from the Add Batchoption dialog box.)
'Desktop/ProjectDirectory'='C:\\projects\test'" projectname.aedt
This command line overrides registry values of the
NumberOfProcessors
(Desktop/Settings/ProjectOptions key) and
ProjectDirectory
(Desktop key) options.
- Multiple registry settings may appear in
a single
-batchoptions
value, separated by whitespace. - The
-batchoptions
value must be enclosed in double quotes if it contains any whitespace.
Example with registry settings specified in a file
maxwell.exe -batchsolve -batchoptions filename projectname.aedt
where the referenced file, <filename>
contains:
$begin 'Config'
'Desktop/Settings/ProjectOptions/NumberOfProcessors'=4
'Maxwell3D/NumCoresPerDistributedTask'=2
'Desktop/ProjectDirectory'='C:/projects/test'
$end 'Config'
This command overrides the registry values of the
NumberOfProcessors
(Desktop/Settings/ProjectOptions key), UpdateReportsOnSolve
(Desktop/Settings/ProjectOptions/Maxwell3D key), and ProjectDirectory
(Desktop key) options. These overrides apply only to the current
Electronics Desktop session.
- The
-batchoptions
<filename>
value must be enclosed in double quotes if it contains whitespace. - The
and$begin 'Config
'$end 'Config'
lines are required.
For additional options you can override for the command line
with -batchoptions
, see
- For -batchoptions Use: Project Directory and Lib Paths
- For -batchoptions Use: TempDirectory
- For -batchoptions Use: Various Desktop Settings
- For -batchoptions Use: Maxwell 2D and Maxwell 3D Options
When to use the -batchoptions Desktop Command Line Option
You can set analysis parameters for batch mode jobs using the graphical user interface (GUI). For example, you can set all options for a batch job using the Add Batch Option dialog box, which is accessed through the Submit Job To dialog box. These parameter settings include the following solver options (several examples, not a complete list):
- HPCLicenseType
- tempdirectory
- Desktop/AutoExtractReports
- Desktop/Settings/ProjectOptions/MumberOfProcessors
- <design_type>/DefaultProcessPriority
- <design_type>/EnableGPU – Applicable to Maxwell 3D
- <design_type>/MPIVendor (either “Intel” or “Microsoft”) – Applicable to Maxwell 2D and Maxwell 3D
For graphical analyses that do not use batch mode, you specify the analysis parameters using the GUI (Tools > Options > General Options or HPC and Analysis Options). These settings are written to the registry when you exit the Electronics Desktop program. The settings are read from the registry when the application is started. Therefore, when you start the Electronics Desktop application, all settings retain the values from the previous session of the same user on the same machine. If there was not a previous session of the same user on the same machine, then the values are obtained from other registry configuration files or from a default value.
When running a batch analysis, any setting that is not
specified using the -batchoptions
command line option is taken
from the registry. This value is typically the setting from the last
session of the same user on the same machine. However, the
-batchoptions
command line option allows you to override the
parameter with values specified on the command line or in a batchoptions
file. The values specified using the -batchoptions
command line
option only apply to the batch job, and do not affect the parameter
values stored in the registry.
If important -batchoptions
values are not specified when
running a batch job, the parameters could be affected by an interactive
session running on the same host by the same user. Parameter changes can
occur if the user sets an option in the GUI and then exits the program,
or if another process that accesses the registry exits. To be sure of the
desired batch job outcome, avoid changing options in concurrent interactive sessions or include the desired -batchoptions in the command line.