run_batch#

MapdlPool.run_batch(files, clear_at_start=True, progress_bar=True, close_when_finished=False, timeout=None, wait=True)#

Run a batch of input files on the pool.

Parameters:
fileslist

List of input files to run.

clear_at_startbool, optional

Clear MAPDL at the start of execution. By default this is True, and setting this to False may lead to instability.

progress_barbool, optional

Show a progress bar when starting the pool. Defaults to True. Will not be shown when wait=False

progress_barbool, optional

Show a progress bar when running the batch. Defaults to True.

close_when_finishedbool, optional

Exit the MAPDL instances when the pool is finished. Default False.

timeoutfloat, optional

Maximum runtime in seconds for each iteration. If None, no timeout. If specified, each iteration will be only allowed to run timeout seconds, and then killed and treated as a failure.

waitbool, optional

Block execution until the batch is complete. Default True.

Returns:
list

List of text outputs from MAPDL for each batch run. Not necessarily in the order of the inputs. Failed runs will not return an output. Since the returns are not necessarily in the same order as iterable, you may want to add some sort of tracker or note within the input files.

Examples

Run 20 verification files on the pool

>>> from ansys.mapdl import examples
>>> files = [examples.vmfiles['vm%d' % i] for i in range(1, 21)]
>>> outputs = pool.run_batch(files)
>>> len(outputs)
20