# Parallelization

Cuby offers two levels of parallelization:
Firstly, any task that consists of multiple independent calculations can execute these calculations in parallel.
Secondly, when an external software is called to perform a calculation, a parallel calculation can be requested if the software supports that.

## Cuby parallelization

Many Cuby jobs consist of a number of independent calculations, introduced either at a level of the calculation itself (e.g. some interfaces build the result from multiple child calculations) or at the level of the compotational protocol (e.g. in a data set or scan calculations, many calculations are performed). Internally, all these calculations are stored in queue and only when the results are needed, the queue is processed. The number of calculations executed in parallel is specified by the keyword cuby_threads.

## Parallelization of external calculations

If the sofware supports that, the interface can request a parallel calculation. The number of CPUs is specified by the keyword

parallel. In some cases, multiple mode of parallelization can be selected by the keyword

parallel_mode.

## Combined parallelization

It is possible to combine both modes iof the parallelization, e.g. use a a computer with 8 CPUs to run two calculations simultaneously, each using four CPUs.