ParallelExec |
Top Previous Next |
A command is executed for multiple data sets. ParallelExec expects at least 2 parameters. The first parameter <command> is interpreted as a function (e.g. alias, function, procedure). All subsequent parameters of the ParallelExec function are passed as values to the first parameter. The function in the first parameter is executed again with each subsequent parameter. Every occurrence of %0 .. %99 is replaced by current values. The function is called repeatedly until it has been executed for all values. All available processors are used at the same time. Not all functions are suitable as commands for parallel use. Requirement Angabe von mindestens 2 Parametern. Parameter Command Command string with the function to be executed multiple times and the placeholders (%0-%99) for the variable parameters that are filled with the values in each run. By the way, the placeholders are replaced regardless of whether other characters directly follow the placeholder or not: they do not have to be free. Values Each parameter from the second onwards is broken down into individual words. The first word is a replacement for %0 in the command. The second word is a replacement for %1, etc. “ “ around the words are removed. /REVERSE If this parameter is to be set, it must come first before the other. The parameter causes the processing and thus also the output of the values to take place in the reverse order. /MULTILINE If this parameter is to be set, it must come first before the other. Multi line parameter values can then also be processed, but the character string listed under Command is then not a command sequence, but a single command line. Rückgabewert
Dialog keiner Beispiel ParallelExec „Echo %0 %1 <%2>“ „Dies ist ein Parameter“ -> Dies ist <ein> In this example, only one value parameter was specified to clarify the replacement of the placeholders, which would also occur for every other value parameter. In the following example, two value parameters are now specified. ParallelExec „Echo %0 %1 <%2>“ „Dies ist ein Parameter“ „Und noch einer“ -> Und noch <einer> -> Dies ist <ein> The output for the second value parameter is also in the same form. The <> characters have been correctly placed around the third word in the value parameter. The order of the outputs is not defined, so it can be nested. If no values are provided for the placeholders, they remain empty. ParallelExec "m_mul(m_add(%0 %2) %1)” “1 2 3” “4 5 6” “7 8 9” -> 8 -> 50 -> 128 Remark If %1 is to be immediately followed by a number as a parameter, then the parameter specification must be in two digits. See also
|