Show code cell source
import abtem
import ase
import dask
from IPython.display import Image, display
dask.config.set({"array.svg.size": 90});
Parallel performance tips#
If your performance is unexpectedly low you can try optimizing using some of the tips below.
Optimize your simulation parameters#
The most effective way of speeding up your simulation is to use optimal simulation parameters.
Number of gpts
#
The number of grid points in your
While dialing in other simulation parameters
Number of slices#
Cell size#
Number of scan samples#
Number of integral samples (frozen phonons, partial coherence etc.)#
Running out of memory?#
Lower the batch size#
See below.
Lower the number of workers#
dask.config.set(num_workers=2):
Reduce early#
#
Use PRISM#
Optimize your usage of FFTs#
The Fast Fourier Transform (FFT) is the most important algorithm determining the speed, hence, ensuring that this algorithm is fast is important.
FFT library#
abTEM supports two different FFT libraries: the open-source FFTW and Intel’s MKL FFT implementation.
We have found that MKL is faster, hence this is the default in abTEM, however, it may be worth trying FFTW
You set the FFT library through the configuration:
abtem.config.set({"fft" : "mkl"})
Set internal thread parallelization#
Use power of 2 gpts
#
Implementations of the fast fourier transform works most efficiently for arrays whose size can be factored into small primes (2, 3, 5, and 7). Modify the number of gpts
of your simulation grid such that