Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
block_adjust_gpu.hpp
Go to the documentation of this file.
1/*
2 * This file is part of Vlasiator.
3 * Copyright 2010-2024 Finnish Meteorological Institute and University of Helsinki
4 *
5 * For details of usage, see the COPYING file and read the "Rules of the Road"
6 * at http://www.physics.helsinki.fi/vlasiator/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
25
26#ifndef VLASIATOR_BLOCK_ADJUST_GPU_HPP
27#define VLASIATOR_BLOCK_ADJUST_GPU_HPP
28
29#include "spatial_cell_gpu.hpp"
30
31#include "../definitions.h"
32#include <dccrg.hpp>
33#include <dccrg_cartesian_geometry.hpp>
34
35#ifdef DEBUG_VLASIATOR
36// Re-use spatial cell debug flag also for batch operations
37 #ifndef DEBUG_SPATIAL_CELL
38 #define DEBUG_SPATIAL_CELL
39 #endif
40#endif
41
42namespace spatial_cell {
43 // Following functions act on all requested cells
44
46 dccrg::Dccrg<spatial_cell::SpatialCell,dccrg::Cartesian_Geometry>& mpiGrid,
47 const vector<CellID>& cells,
48 const uint popID=0);
49
51 dccrg::Dccrg<spatial_cell::SpatialCell,dccrg::Cartesian_Geometry>& mpiGrid,
52 const vector<CellID>& cells,
53 const uint popID=0);
54
56 const uint nCells,
57 const size_t largestSizePower,
58 gpuStream_t stream=0,
59 const size_t offset=0);
60
62 dccrg::Dccrg<spatial_cell::SpatialCell,dccrg::Cartesian_Geometry>& mpiGrid,
63 const vector<CellID>& cellsToAdjust,
64 const uint cellOffset,
65 uint &largestBlocksToChange,
66 uint &largestBlocksBeforeOrAfter,
67 const uint popID=0
68 );
69
70 // Non-templated caller functions due to dual use from both block adjustment and acceleration
72 Hashinator::Hashmap<vmesh::GlobalID,vmesh::LocalID>** input_maps,
73 split::SplitVector<Hashinator::hash_pair<vmesh::GlobalID,vmesh::LocalID>> **output_vecs,
74 vmesh::LocalID* output_sizes,
75 vmesh::VelocityMesh** rule_meshes,
76 Hashinator::Hashmap<vmesh::GlobalID,vmesh::LocalID>** rule_maps,
77 split::SplitVector<vmesh::GlobalID>** rule_vectors,
78 const uint nCells,
79 gpuStream_t stream
80 );
81
83 Hashinator::Hashmap<vmesh::GlobalID,vmesh::LocalID>** input_maps,
84 split::SplitVector<Hashinator::hash_pair<vmesh::GlobalID,vmesh::LocalID>> **output_vecs,
85 vmesh::LocalID* output_sizes,
86 vmesh::VelocityMesh** rule_meshes,
87 Hashinator::Hashmap<vmesh::GlobalID,vmesh::LocalID>** rule_maps,
88 split::SplitVector<vmesh::GlobalID>** rule_vectors,
89 const uint nCells,
90 gpuStream_t stream
91 );
92
94 Hashinator::Hashmap<vmesh::GlobalID,vmesh::LocalID>** input_maps,
95 split::SplitVector<vmesh::GlobalID> **output_vecs,
96 vmesh::LocalID* output_sizes,
97 vmesh::VelocityMesh** rule_meshes,
98 Hashinator::Hashmap<vmesh::GlobalID,vmesh::LocalID>** rule_maps,
99 split::SplitVector<vmesh::GlobalID>** rule_vectors,
100 const uint nCells,
101 gpuStream_t stream
102 );
103
104} // namespaces
105
106#endif
#define gpuStream_t
const uint cellOffset
void extract_to_delete_or_move_caller(Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **input_maps, split::SplitVector< Hashinator::hash_pair< vmesh::GlobalID, vmesh::LocalID > > **output_vecs, vmesh::LocalID *output_sizes, vmesh::VelocityMesh **rule_meshes, Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **rule_maps, split::SplitVector< vmesh::GlobalID > **rule_vectors, const uint nCells, gpuStream_t stream)
void adjust_velocity_blocks_in_cells(dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const vector< CellID > &cellsToAdjust, const uint popID)
void update_velocity_block_content_lists(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const vector< CellID > &cells, const uint popID)
void batch_adjust_blocks_caller(dccrg::Dccrg< spatial_cell::SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, const vector< CellID > &cellsToAdjust, const uint cellOffset, uint &out_largestBlocksToChange, uint &out_largestBlocksBeforeOrAfter, const uint popID)
void extract_to_add_caller(Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **input_maps, split::SplitVector< vmesh::GlobalID > **output_vecs, vmesh::LocalID *output_sizes, vmesh::VelocityMesh **rule_meshes, Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **rule_maps, split::SplitVector< vmesh::GlobalID > **rule_vectors, const uint nCells, gpuStream_t stream)
void clear_maps_caller(const uint nCells, const size_t largestSizePower, gpuStream_t stream, const size_t offset)
void extract_to_replace_caller(Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **input_maps, split::SplitVector< Hashinator::hash_pair< vmesh::GlobalID, vmesh::LocalID > > **output_vecs, vmesh::LocalID *output_sizes, vmesh::VelocityMesh **rule_meshes, Hashinator::Hashmap< vmesh::GlobalID, vmesh::LocalID > **rule_maps, split::SplitVector< vmesh::GlobalID > **rule_vectors, const uint nCells, gpuStream_t stream)
uint32_t LocalID
Definition definitions.h:60