Need help interpreting NVIDIA CUDA sample code

Hey, I’ve been using one of the sample codes available on the following directory /usr/local/cuda-11.2/samples/5_Simulations/nbody. I was able to run a few single GPU tests and was now looking into multi GPU executions but can’t understand a few things about how it is coded, such as the division of bodies per device, the initialization of both devices and so on… Has someone used it in the past and is able to give me a few hints on how to better understand the code? Thanks in advance