Skip to content

Conversation

@aoeftiger
Copy link
Collaborator

Integrate feature/GPU branch into master as a subdirectory.

Stefannn and others added 30 commits June 26, 2015 16:48
- New folder/file structure
- Moved data from gpu_pic to this repo
- Moved 'old' files to subfolder old
- Tested CPU version (GPU todo)
- Created a setup.py to compile the fortran files, moved the .f files to
  the correct subdirectory
- Adopted FD_Staircase_SquareGrid to the new interface. Some things
  still to be solved:
    -> Works only with an odd number of gridpoints due to symmetry
    required by the chamber/aperture/...
- New setup.py to compile the fortran functions

To be done: Somehow incorporate the fortran functions (rhocompute...)
into the new interface
- FD solvers (except Shortley_Weller_extrapolation) work for symmetric
  problems as defined in the test file

- Todo: Check for asymetric problems
- Gradient was computed using a dx,dy,dz=1
  => changed to use mesh.dx etc
- M2P and P2M Fortran versions used in the PyPIC
- Created an interactive test out of the 000_test_round_chamber.py file
  -> looks good so far

(minor modification in FD_solver.py: remove list_internal_force_zero as
it is not needed
- Test the solve() times of the new interface --> not slower
- FFT open boundary 'works':
  - Results are off by a factor of 2, otherwise ok.
To check!
- FiniteDifferences_ShortleyWeller_SquareGrid field comp. was wrong (ex,
  ey were exchanged). Fixed by swapping the two arrays. This is due to
  the Fortran/C ordering etc
- Fix copy & paste typo in the notebook
  -> the wrong fields were plotted
- Rewrote parts of the test to avoid copy/paste errors (functions, ...)
- FiniteDifference_ShortleyWeller_SquareGrid: Add ext_boundary as
  paramateter to init. Not implemented before.
- Add the timing of the FFT_SquareGrid_OpenBoundary to the timings
  notebook
- Fixed the gradient implementation of the two shortley weller
  implemementations:
  1) reshaping phi similar to the other functions
  2) extrapolation: fix indentation error!
With this version both FD staircase, shortley weller, shortley weller
extrapolation and FFT open boundary work.
- Implements new interface for the FFT periodic boundary solver
- 'Magically' fixes the problem of the new/old FFT open boundary problem
   yielding a factor of 2 difference. (multiply by 2...)
   ---> !! TO BE INVESTIGATED
Fix typo in code (scipy sparse)
- Draft of the proxy class for the solvers providing the interface of
  the old 1.0.2 solvers. The child classes should
  initialize the proper pypic solver and pass it to the parent class.
Not tested yet
- Added the necessary import to all test files
- Fixed mistakes in the pyfftw implementation of FFT_PEC
- Minor fix in FD_solver: / -> // in the printing of the mat assembly
- Notebook to test the backwards compatibility.

Note that there's still an error at the boundaries for the
ShortleyWeller implementation (observable in 000, 008, ...) TO FIX
…/PyPIC into new_pypic_gpu_and_cpu

- merge Adrians changes and my local ones (backwards compatibility)
- Remove some unnecessary code in pypic.py

ERRORS in the fft tests (see e.g. 000_round_chamber: problems with the
shape of efx and efy)
Fix later
- Skeleton (not tested) implementation of the gpu fft open boundary solver
- 3D fft using cuda fft implemented, first simple tests work
- ipython notebook to test the new functionality
- created a fft poissonsolver using numpy fftn for debugging purposes
- fixed mistakes: normalize cufft result

Still not the same as analytical solution, the error is the biggest for
small r and grows with the inverse standard deviation of the gaussian beam
distribution
aoeftiger and others added 24 commits February 5, 2016 16:46
takes tuples instead of single numbers for
origin, cell dimensions and number of cells per direction.

Unifies signature of meshes.
check for is None instead of False in pypic.py
Makes pic_solve run 20% faster on GPU (138s vs. 110s on K40m).
Also required by Gianni's approach.
- Removed a very old test: Everything has changed
  since the test was written.
- Update the fft_3d_gpu test to the new mesh interface,
  clean it --> works
was e before but should be charge from keywords.
- Implemented off-the-grid check for p2m atomicadd and m2p variants
---> works now if not all particles are on grid
- Implemented atomicadd 32bit hardware accelerated variant.
---> is now the default, 64bit double precision is slower and can be
used explicitly by giving the kwarg dtype in pypic.particles_to_mesh()
- Fixed shape --> shape_r in mesh_to_particle (barely used function,
usually we use fields_to_particle, there it was correct)

NB: still experience too large total sum of mesh_charges when using
sorted_particles_to_mesh in conjunction with PyHEADTAIL on
feature/PyPIC-integration branch, atomicadd variants work properly.
distances and recalculate the integrated Green's function.

Needed for adaptive meshing.
Introduced setup_mesh method in 2.5D FFT solver and
minor stuff around state saving in PyPIC.
PyHEADTAIL uses Nearest-Grid-Point (zero-order floor) interpolation
in the longitudinal plane, while the RectMesh3D uses first-order
linear Cloud-In-Cell interpolation. This leads to differing
n_macroparticles_per_slice in the longitudinal plane. RectMesh25D
implements NGP interpolation along z to recover the SliceSet behaviour.
Note: the last mesh node is always disregarded during the PIC, therefore
there should be one more z mesh node than slices used in PyHEADTAIL.
git-subtree-dir: GPU
git-subtree-mainline: 6d5c706
git-subtree-split: 68158d1
(sorting is implemented in PyHEADTAIL via the thrust interface)
get_weights is 4x quicker in cython than in numpy for the CPU
and 30x quicker for a lumped ElementwiseKernel than in single
operations for the GPU. This should be incorporated in standard
meshing.
Prepares for simplification of m2p / p2m and mesh kernels.
They should go all together.
@aoeftiger aoeftiger merged commit 1c3375e into master Mar 14, 2017
@aoeftiger aoeftiger deleted the release/integrate-GPU branch March 14, 2017 08:52
@aoeftiger aoeftiger restored the release/integrate-GPU branch June 14, 2017 15:00
@aoeftiger aoeftiger deleted the release/integrate-GPU branch June 14, 2017 15:01
aoeftiger added a commit that referenced this pull request Jun 14, 2017
lgiacome pushed a commit to lgiacome/xfields_old that referenced this pull request Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants