Appendix F: expert-level options

From Spinach Documentation Wiki
Revision as of 15:40, 9 August 2016 by Kuprov (talk | contribs) (→‎Propagator caching)
Jump to: navigation, search

This section catalogs very advanced functionality that is stable and well-tested, but switched off by default.

CUDA GPU support

Several functions in Spinach can make use of CUDA GPUs. If your computer has a recent NVidia graphics card, enabling that functionality may be beneficial. This is done by adding 'gpu' to the enable array:

    sys.enable={'gpu'};

Spinach kernel modules that can make use of GPU arithmetic are:

  1. Matrix exponential calculation in propagator.m function.
  2. Matrix inverse-times-vector operation during the slow-passage detection in slowpass.m function.
  3. Krylov propagation in krylov.m and step.m functions.

Numerical pseudocontact shift solvers also support GPUs for the Fourier solver option. GPU support is enabled in ipcs.m and kpcs.m by specifying

    options.gpu=1;

For the typical 128x128x128 point grids used in paramagnetic centre probability density reconstructions from PCS, using a Tesla K40 card results in up to an order of magnitude acceleration relative to 32 CPU cores.


Note that commodity NVidia graphics cards (e.g. GeForce) have artificially capped 64-bit floating-point performance - the Tesla range is more expensive, but much recommended.

Propagator caching

Wall clock time consumed by the simulation of the CN2D solid state NMR experiment for a 14N-13C spin pair in glycine with different matrix exponential caching settings in Spinach. Light grey columns correspond to running with matrix caching switched off, medium grey columns are for runs with the caching switched on and a cache that is empty at the start of the simulation. Dark grey columns correspond to simulations where all required matrix exponentials are already present in the cache.

Spinach may be instructed to keep a disk record of the matrices that propagator.m function has previously seen, so that propagators are not recomputed, but instead fetched from the disk next time the matrix is encountered. This can save large amounts of time in simulations of very repetitive pulse sequences. To turn this functionality on, add 'caching' to the enable array:

    sys.enable={'caching'};

The cached propagators are placed into /scratch directory in the Spinach root folder.