     unsigned int ngpu = gpu_partition.getNumActiveGPUs();
     for (int idev = ngpu - 1; idev >= 0; --idev)
         {
-        auto range = gpu_partition.getRangeAndSetGPU(idev);
+        gpu_partition.getRangeAndSetGPU(idev);
 
         cudaMemcpyToSymbol(GPU_rho_coeff, &(CPU_rho_coeff[0]), order * (2*order+1) * sizeof(Scalar));
         }

                                                      NNN);
    }

//! Texture for reading particle positions
texture<cufftComplex, 1, cudaReadModeElementType> inv_fourier_mesh_tex_x;
texture<cufftComplex, 1, cudaReadModeElementType> inv_fourier_mesh_tex_y;
texture<cufftComplex, 1, cudaReadModeElementType> inv_fourier_mesh_tex_z;

__global__ void gpu_compute_forces_kernel(const unsigned int work_size,
                                          const Scalar4 *d_postype,
                                          Scalar4 *d_force,


        unsigned int nwork = range.second - range.first;
        unsigned int n_blocks = nwork/run_block_size+1;

        gpu_compute_forces_kernel<<<n_blocks,run_block_size>>>(nwork,
                 d_postype,
