Skip to content
/ cosyr Public
forked from lanl/cosyr

A tool for coherent synchrotron radiation modeling

License

Notifications You must be signed in to change notification settings

jsdomine/cosyr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosyr

build

Summary

Cosyr is a particle beam dynamics simulation code with multi-dimensional synchrotron radiation effects. It tackles a fundamental problem of the nonlinear dynamics of a particle beam from its complete self-fields, particularly the radiation fields, i.e the coherent synchrotron radiation (CSR) problem. The latter underpins many accelerator design issues in ultra-bright beam applications, as well as those arising in the development of advanced accelerators. It is written in C++ and supports two levels of parallelism with MPI and Kokkos.

Algorithms

Cosyr consists of three components:

  • a field/wavelet computation kernel,
  • a wavelet-to-mesh interpolation module,
  • a particle pusher.

The particle pusher is similar to those for existing high performance kinetic plasma simulation codes, such as VPIC. Unlike other particle-mesh codes with a local PDE-based field solver that communicates only with neighbors, Cosyr's field solver is based on the retarded Green's function and thus nonlocal both in time and space. Such an approach allows both the decoupling of the time/spatial scales in coherent and incoherent effects, and the improved solution to the beam self-fields.

Performance

Cosyr is designed to leverage multi-GPU nodes. It exploits the fact that the field kernel, wavelets emission and particle update are completely local. For a given beam, a subset of particles is assigned to a MPI rank. The field kernel is primarily parallelized over particles to be run on manycore nodes or GPU. The wavelet-to-mesh interpolation is done in a multithreaded way using Portage.

Build and use

It can be built on Linux or macOS using CMake.
It requires a C++14 compiler endowed with OpenMP.
The field kernels are designed to be run on manycore CPU or GPU.
For optimized builds on Intel KNL, we recommend the Intel compiler.
To run on Nvidia's GPU, it should be compiled with nvcc.

It was not currently tested on AMD's GPU.

Dependencies
  • kokkos for the wavefronts and field kernels.
  • cabana for the particle pusher.
  • portage for the interpolation step.
  • pybind and a python environment to handle simulation parameters.

The instructions to build the project and its dependencies can be found here.

Running

The simulation parameters are given through an input deck.
The latter is simply a regular Python script.
Those parameters are loaded into the Python locals and can changed as needed.
A set of examples are given in the input directory.
It is also possible to initialize a beam array for the simulation as shown here.
To run: mpirun -np 4 ./cosyr params.py

License and contributions

Cosyr is developed at Los Alamos National Laboratory (C20129).
It is supported by the Laboratory Directed Research and Development program (LDRD).
It is open source under the BSD-3 licence.
It is developed by:

  • Chengkun Huang
  • Feiyu Li
  • Hoby Rakotoarivelo
  • Boqian Shen

Other contributors:

  • Rao Garimella
  • Thomas Kwan
  • Bruce Carlsten
  • Robert Robey
  • Orion Yeung
  • Parker Pombrio

Copyright

© 2021. Triad National Security, LLC. All rights reserved. This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.

About

A tool for coherent synchrotron radiation modeling

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 68.1%
  • Jupyter Notebook 27.9%
  • Python 3.1%
  • Shell 0.6%
  • Dockerfile 0.2%
  • CMake 0.1%