|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../common.h"#include "../definitions.h"#include "../object_wrapper.h"#include "../arch/gpu_base.hpp"#include "../spatial_cells/spatial_cell_gpu.hpp"#include "gpu_1d_pqm.hpp"#include "gpu_1d_ppm.hpp"#include "gpu_1d_plm.hpp"

Go to the source code of this file.
Functions | |
| bool | gpu_acc_map_1d (dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, vector< CellID > &launchCells, const uint popID, const uint dimension, const int Dacc, const int Dother, const size_t cumulativeOffset) |
| This function performs the semi-Lagrangian acceleration for a provided list of spatial cells, for one popID, for one dimension. See gpu_acc_semilag.cpp for Information on the calling structure. | |
| bool gpu_acc_map_1d | ( | dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > & | mpiGrid, |
| vector< CellID > & | launchCells, | ||
| const uint | popID, | ||
| const uint | dimension, | ||
| const int | Dacc, | ||
| const int | Dother, | ||
| const size_t | cumulativeOffset ) |
This function performs the semi-Lagrangian acceleration for a provided list of spatial cells, for one popID, for one dimension. See gpu_acc_semilag.cpp for Information on the calling structure.
First, kernels are called to construct the existing columns and columnsets for the sparse velocity space data contained in this cell. A parallel launch and probe cubes are used for this, along with some unified memory column containers. Data from the current spatial cell is then read into an intermediate buffer in column-aligned order.
Then, utilizing pre-calculated SLICE-3D intersections, a kernel is launched to evaluate the extents of velocity space after each column(set) has been accelerated as requested. Block adjustment functions are called to batch-update the velocity space of the cell in question to match the new requirements (adding and removing cells as needed). Then, the velocity block container is cleared.
Finally the acceleration kernel itself is called. It reads the aligned velocity space data from the intermediate buffer, advects the columns according to the SLICE-3D intersections, and stores the resultant phase space density back into the velocity block container.
| mpiGrid | DCCRG container of spatial cells |
| launchCells | vector of cells for which to perform acceleration in this "chunk" |
| popID | ID of the accelerated particle species. |
| dimension | Velocity dimension for acceleration (VX, VY, or VZ) |
| Dacc | Maximal velocity block extent in accelerated dimension |
| Dother | Product of maximal velocity block extents in non-accelerated dimensions |
| cumulativeOffset | running counter for offset of indexing of launchCells into device buffers |
New merged kernel approach without sorting for columns
First, we generate a "probe cube". It started off as an actual cube, but the transverse dimensions are considered as one. One dimension is that of the current acceleration (Dacc), and the other dimension is the product of the other two maximal velocity block domain extents (Dother). The "flattened" version is one where data is gathered over the acceleration direction into a single reduced value.
The flattened version of the probe cube must store: 1) how many columns per potential column position (potColumn) 2) how many blocks per potColumn 3) cumulative offset into columns per potColumn 4) cumulative offset into columnSets per potColumn 5) cumulative offset into blocks per potColumn
For reductions, each slice of the flattened array should have a size a multiple of 2*MAX_BLOCKSIZE:
For the gathered LIDlist, we re-use the allocation of spatial_cell->dev_velocity_block_with_content_list, It which contains variables of type vmesh::GlobalID (which should be the same as vmesh::LocalID, uint_32t). To ensure this static_cast is safe, we verify the sizes.
Use block adjustment callers / lambda rules for extracting required map contents, building up vectors to use for parallel adjustment.
Definition at line 1212 of file gpu_acc_map.cpp.

