Massive stochastic simulation of cosmic rays propagation in the heliosphere: The COSMICA code
The accurate modeling of galactic cosmic ray (GCR) propagation in the heliosphere requires solving the Parker Transport Equation (PTE), a multidimensional nonlinear equation that cannot be addressed analytically without strong approximations. In recent decades, stochastic differential equation (SDE)–Monte Carlo methods have emerged as a powerful numerical strategy for this problem, thanks to their numerical stability, relatively low memory requirements, and intrinsic parallelism. The increasing availability of general-purpose Graphics Processing Units (GPUs) has further revolutionized this approach by enabling massive parallelization of particle trajectories at relatively low cost. In this work, we introduce COSMICA (COde for a Speedy Montecarlo Involving Cuda Architecture), a new open-source multi-GPU code written in CUDA/C++ for the three-dimensional solution of the PTE. COSMICA has been specifically designed to optimize GPU resource usage and scalability, with strategies including memory hierarchy exploitation, register-conscious kernel design, warp-aware scheduling, and parameter reordering for multi-GPU execution. Benchmark results demonstrate that COSMICA reduces runtimes from weeks to hours for large-scale simulations. These optimizations make COSMICA a versatile tool for systematic studies of cosmic-ray modulation and parameter exploration, thereby expanding the feasibility of investigations that were previously computationally prohibitive. The present article constitutes the first part of a two-paper series, focusing on code design and computational performance; a companion paper will present its validation against benchmark models. • COSMICA: new open, multi-GPU solver for the three-dimensional Parker Transport Equation. • Register-conscious design, warp-aware scheduling, and multi-GPU particle reordering. • Scalability validation across multiple GPU architectures, both enterprise- and consumer-grade. • COSMICA facilitates integration of alternative transport models, beyond cosmic-rays modulation.
Authors
- Sabina Rossi (ORCID: https://orcid.org/0000-0002-1189-4439)
- Giovanni Cavallotto (ORCID: https://orcid.org/0009-0001-5914-0361)
- M. Gervasi (ORCID: https://orcid.org/0000-0003-3884-0905)
- G. La Vacca (ORCID: https://orcid.org/0000-0002-2168-9447)
- Marco S. Nobile (ORCID: https://orcid.org/0000-0002-7692-7203)
- S. Della Torre (ORCID: https://orcid.org/0000-0002-7669-0859)
- Matteo Grazioso (ORCID: https://orcid.org/0009-0004-2802-7501)
- Leone Bacciu (ORCID: https://orcid.org/0009-0006-2175-8779)
Institutions
- Ca' Foscari University of Venice (IT)
- Cineca (IT)
- Istituto Nazionale di Fisica Nucleare, Sezione di Milano Bicocca (IT)
- University of Milano-Bicocca (IT)
Publication Details
- Journal
- Astronomy and Computing
- Published
- 2025-12-06
- DOI
- https://doi.org/10.1016/j.ascom.2025.101043
- Citations
- 1
- Primary Topic
- Solar and Space Plasma Dynamics
- Type
- article
- Field-Weighted Citation Impact
- 1.15