Support for Multithreading in ABE Fun ctions
To apply multithreading to the ABE functions, you have to use the ?queue argument. When ?queue is specified, the function is queued for multithreaded processing which occurs only on the same host.
You can only apply the ?queue argument to the two-layer ABE functions, one-layer ABE functions, and abeLayerFromShapes.
ABE limits the number of threads for multithreading to ((2*numberOfCores)-1). Therefore, for a two-core host, ABE would use at most three (3) threads. A larger number of threads could be requested but only the maximum number according to the formula would be used.
Limitations of multithreading:
- Within the same queue, the output of one ABE operation cannot be used as the input of another ABE operation.
-
With the exception of
abeLayerGrowandabeLayerShrink, multiple ABE operations can output to the same ABE layer.
There are three differences when running ABE with multithreading:
-
When ABE is initialized, the number of threads can be specified as an argument to
abeInit. The default is four threads. -
For the two-layer and one-layer ABE functions, add the
?queueargument. This will push the operation onto a queue for processing. The operation is not run immediately, it is just added to a queue. -
Run the queue using
abeRunQueue. All queued ABE operations run, and a return is issued after all have been completed.
Related Topics
Return to top