Loop
Synopsis
This operator loops over the subprocess as often as it is specified in the parameter
number of iterations. The iteration macro returns the value of the current number of iteration.
Description
The operators in the subprocess are executed as many times as defined in the parameter number of iterations. By default, the input of each iteration will always be the original input data. This can be changed with the reuse results parameter, which changes the output of each iteration to be the input of the next iteration. For obvious reasons, this will limit the loop to run in a single thread and not make use of more CPU cores.
Input
input
This port receives an IOObject which is passed on to the inner process for each iteration. If the reuse results parameter is selected, all subsequent iterations after the first one will use the results of the output ports of the previous iteration.
Output
output
This port collects every result that is provided by the inner process. If reuse results is selected, only the result of the last iteration will be returned. Otherwise, a collection of all results of each iteration will be returned. The order of the ports is the same inside and outside the operator.
Parameters
Number of iterations
The number of iterations specifies how often the subprocess will be executed.
Iteration macro
The name of the iteration macro which can be accessed in the subprocess.
Reuse results
Set whether to reuse the results of each iteration as the input of the next iteration. If set to true, the output of each iteration is used as input for the next iteration. For obvious reasons, this will limit the loop to run in a single thread and not make use of more CPU cores. If set to false, the input of each iteration will be the original input of the loop.
Enable parallel execution
This parameter enables the parallel execution of the subprocess. Please disable the parallel execution if you run into memory problems.