Installation on a local computer

Installing FBPIC

The installation requires the Anaconda distribution of Python. If Anaconda is not your default Python distribution, download and install it from here.

Installation steps:

  • Install the dependencies of FBPIC:

    conda install -c conda-forge numba scipy h5py mkl mpi4py
    
  • Install fbpic

    pip install fbpic
    

    Note

    If you want to run FBPIC through the PICMI interface, you can instead use

    pip install fbpic[picmi]
    

    Note

    Instead of using a release, you can also install FBPIC from the sources, by cloning the code from Github, and executing python3 -m pip install . from the main directory. A shortcut for this is: python3 -m pip install git+https://github.com/fbpic/fbpic.git.

  • Optional: In order to be able to run the code on a GPU, install the additional package cudatoolkit and cupy – e.g. using CUDA version 11.0:

    conda install -c conda-forge cudatoolkit=11.0
    pip install cupy-cuda110
    

    Warning

    In the above command, you should choose a CUDA version that is compatible with your GPU driver. You can see the version of your GPU driver by typing the command nvidia-smi. You can then find the compatible CUDA versions using this table.

  • Optional: In order to run on a CPU which is not an Intel model, you need to install pyfftw, in order to replace the MKL FFT:

    conda install -c conda-forge pyfftw
    

Potential issues

On Mac OSX, the package mpi4py can sometimes cause issues. If you observe that the code crashes with an MPI-related error, try installing mpi4py using MacPorts and pip. To do so, first install MacPorts. Then execute the following commands:

conda uninstall mpi4py
sudo port install openmpi-gcc48
sudo port select --set mpi openmpi-gcc48-fortran
pip install mpi4py

If you are running on an Apple Silicon machine, mkl is not available via conda. You can use brew instead:

brew install onednn

Running simulations

See the section How to run the code, for instructions on how to run a simulation.