### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 7. Core modules »

# 7.11. Parallel algorithms for MDAnalysis

The `MDAnalysis.core.parallel` module contains implementations of standard functions that can make use of parallelization available on modern multi-core processors.

Warning

Using parallel code is under active development in MDAnalysis and it is possible that the parallel code has some bugs or incompatibilities or less features than the serial code.

## 7.11.1. Fast parallel distance array computation — `MDAnalysis.core.parallel.distances`

Author: | Jan Domański
Year: | 2012
Licence: | GPL

A fast, parallel `distance_array()` function as a substitute for `MDAnalysis.core.distances.distance_array()`; implemented with Cython Parallelism. For development notes see the comments for Issue 80.

Load the module with

    import MDAnalysis.core.parallel.distances

`MDAnalysis.core.parallel.distances.``distance_array`(ref, conf[, box[, result]])

  Calculate all distances d_ij between the coordinates `ref[i]` and `conf[j]` in the numpy arrays ref and conf.

  This is a parallelized version that will automatically decide on how many threads to run.

  Periodic boundary conditions can be taken into account if the box vectors are provided in the 3x3 matrix box. The default `None` calculates simple distances.

  A pre-allocated array can be supplied as results.

  Warning

  Only orthorhombic boxes are supported for box, anything else will produce wrong results.

  New in version 0.7.7.

`MDAnalysis.core.parallel.distances.``distance_array_serial`(ref, conf[, box[, result]])

  Calculate all distances d_ij between the coordinates ref[i] and conf[j] in the numpy arrays ref and conf.

  Periodic boundary conditions can be taken into account if the box vectors are provided in the 3x3 matrix box. The default `None` calculates simple distances.

  A pre-allocated array can be supplied as results.

  Serial version (to check the parallel version). This version is slightly slower than the regular serial (pure C) `MDAnalysis.core.distances.distance_array()` function.

  Warning

  Only orthorhombic boxes are supported for box, anything else will produce wrong results.

  New in version 0.7.7.

### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 7. Core modules »