model.batch()
Create batch jobs.
Syntax
Jobs
model.batch().create(<tag>,jobtype); creates a batch job tagged <tag> of type jobtype, where jobtype is Parametric, Batch, or Cluster.
model.batch().remove(<tag>) removes a batch job.
model.batch().size() returns number of batch jobs.
model.batch().tags() returns the tags of the batch jobs.
model.batch(<tag>).attach(<stag>) attaches a batch job with tag <tag> to a study with tag <stag>, which makes it visible under that study.
model.batch(<tag>).create(<jtag>,<oper>) creates a batch job sequence.
model.batch(<tag>).detach(<stag>) detaches a batch job from a study with tag <stag>.
model.batch(<tag>).remove(<ttag>) removes the task.
model.batch(<tag>).run() runs the batch job. The run method can take an additional boolean input argument createPlots, which, when set to true, generates the corresponding default plots when computing a solution.
model.batch(<tag>).set(jprop,<jvalue>) sets the property jprop to the value <jvalue>.
model.batch(<tag>).study(<stag>) assigns a batch job to a study tag <stag>.
model.batch(<tag>).study() returns the study tag of batch job with tag <tag>.
model.batch(<tag>).feature(<ttag>)).getAllowedPropertyValues(property) returns the set of allowed values for a property if the set is a finite set of strings; otherwise, it returns null.
Batch Job Properties
The Parametric job type has the following properties:
on | off
on | off
on | off
on | off
on | off
true | false
on | off
The Optimization job type sets its property through the Optimization study node, which has the following properties:
minimization | maximization
auto | first | last | sum | min | max
coordsearch | montecarlo | neldermead | bobyqa
on | off
on | off
off | on | detailed
The Batch job type has the following properties:
on | off
now | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23
on | off
on | off
on | off
on | off
on | off
on | off
on | off
on | off
on | off
all | none | manual
on | off
on | off
on | off
 The Cluster job type has the following properties:
general | whpc2008 | wccs2003 | sge | slurm | none
on | off
none | scp | user
on | off
node | socket| core
Highest | AboveNormal | Normal | BelowNormal | Lowest
on | off
none | ssh | user
native | windows | linux
DD:HH:MM | Infinite
scp | putty | user
host | slot | manual
ssh | putty | user
Tasks
model.batch(<tag>).create(<ttag>,tasktype); creates a task of type tasktype tagged <ttag>. Find options for tasktype in Table 2-5 below.
Task Type Properties
model.batch(<tag>).feature(<ttag>).set(ttprop,<tpvalue>) sets the task type property ttprop to the value <tpvalue>.
Task type properties can have the values listed in Table 2-6.
on | off
on | off
The Data Task Type
The Data task type contains child nodes with process information of type Process; see Table 2-7.
Table 2-7: Data Child nodes.
  model.batch(<tag>).feature(<ttag>).feature(<ptag>).set(ptype,<pvalue>) sets the property ptype to the value <pvalue>. ptype can have the values listed in Table 2-8
update | progress | cancel | stop | clear | rerun
Example
Create a parametric sweep over a geometry sequence that creates a batch job that runs a parametric sweep that runs a solver.
Code for Use with Java
model.batch().create("sweep1","Parametric");
model.batch("sweep1").set("pname","a");
model.batch("sweep1").set("plist",new double[]{1,2});
model.batch("sweep1").create("sol","Solutionseq");
model.batch("sweep1").feature("sol").set("seq","sol3");
model.batch().create("batch1","Batch");
model.batch("batch1").create("task","Jobseq");
model.batch("batch1").feature("task").set("seq","sweep1");
model.batch().create("sweep2","Parametric");
model.batch("sweep2").set("pname","b");
model.batch("sweep2").set("plist",new double[]{1,2,3});
model.batch("sweep2").create("gtask","Geomseq");
model.batch("sweep2").feature("gtask").set("seq","geom1");
model.batch("sweep2").create("task","Jobseq");
model.batch("sweep2").feature("task").set("seq","batch1");
model.batch("sweep2").run();
Determine the parameter names and values from a parametric sweep that has already been run.
model.batch(pname).feature(fname).getString("psol")
where pname is the name of the parametric sweep feature that ran and fname is the name of the solution feature that stored the solutions. Use
model.sol(sname).feature().tags()
to find out the tags of the stored solutions. Use
model.sol(sname).feature(fname).getString("sol")
to find the solver sequence for a parameter. Use
model.sol(sname).getParamNames()
and
model.sol(sname).getParamVals()
Code for Use with MATLAB
model.batch.create('sweep1','Parametric');
model.batch('sweep1').set('pname','a');
model.batch('sweep1').set('plist',[1,2]);
model.batch('sweep1').create('sol','Solutionseq');
model.batch('sweep1').feature('sol').set('seq','sol3');
model.batch.create('batch1','Batch');
model.batch('batch1').create('task','Jobseq');
model.batch('batch1').feature('task').set('seq','sweep1');
model.batch.create('sweep2','Parametric');
model.batch('sweep2').set('pname','b');
model.batch('sweep2').set('plist',[1,2,3]);
model.batch('sweep2').create('gtask','Geomseq');
model.batch('sweep2').feature('gtask').set('seq','geom1');
model.batch('sweep2').create('task','Jobseq');
model.batch('sweep2').feature('task').set('seq','batch1');
model.batch('sweep2').run;
Determine the parameter names and values from a parametric sweep that has already been run.
model.batch(pname).feature(fname).getString('psol')
where pname is the name of the parametric sweep feature that ran and fname is the name of the solution feature that stored the solutions. Use
model.sol(sname).feature().tags
to find out the tags of the stored solutions. Use
model.sol(sname).feature(fname).getString('sol')
to find the solver sequence for a parameter. Use
model.sol(sname).getParamNames
and
model.sol(sname).getParamVals
See Also
model.sol(), model.study()