Doxygen API Reference#
See Original Doxygen output if preferred.
Sphinx API Reference#
-
template<typename T>
struct AccessGeneric# - #include <access_descriptors.hpp>
Generic base type for an access descriptor around an object of type T.
Subclassed by NESO::Particles::Access::Add< T >, NESO::Particles::Access::Max< T >, NESO::Particles::Access::Min< T >, NESO::Particles::Access::Read< T >, NESO::Particles::Access::Write< T >
-
template<typename T>
struct Add : public NESO::Particles::Access::AccessGeneric<T># - #include <access_descriptors.hpp>
Atomic add access descriptor.
-
template<typename T>
struct Add# - #include <cell_dat.hpp>
Access:CellDat::Add<T> add access cellwise.
Public Functions
-
Add() = default#
Pointer to underlying data for the array.
-
Add() = default#
-
template<typename T>
struct Add# - #include <cell_dat_const.hpp>
Access:CellDatConst::Read<T> and Access:CellDatConst::Add<T> are the kernel argument types for accessing CellDatConst data in a kernel.
Public Functions
-
Add() = default#
Pointer to underlying data for the array.
-
Add() = default#
-
template<typename T>
struct Add# - #include <global_array.hpp>
Access:GlobalArray::Read<T> and Access:GlobalArray::Add<T> are the kernel argument types for accessing GlobalArray data in a kernel.
Public Functions
-
Add() = default#
Pointer to underlying data for the array.
-
Add() = default#
-
template<typename T>
struct Add# - #include <local_array.hpp>
ParticleLoop access type for LocalArray Add access.
Public Functions
-
Add() = default#
Pointer to underlying data for the array.
-
Add() = default#
-
struct Add#
- #include <product_matrix.hpp>
ParticleLoop access type for ProductMatrix Add access.
Public Functions
-
Add() = default#
-
inline REAL fetch_add_real(const int product, const int property, const int component, const REAL value)#
Atomically increment a REAL product property.
- Parameters:
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering REAL ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
value – Value to increment property value by.
- Returns:
Value prior to increment.
-
inline INT fetch_add_int(const int product, const int property, const int component, const INT value)#
Atomically increment a INT product property.
- Parameters:
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering INT ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
value – Value to increment property value by.
- Returns:
Value prior to increment.
-
Add() = default#
-
template<typename KEY_TYPE, typename VALUE_TYPE, INT WIDTH>
struct BlockedBinaryNode# - #include <blocked_binary_tree.hpp>
Generic node in a tree where each node stores an array of VALUE_TYPE elements of length WIDTH.
BlockedBinaryTree
is the class that actually creates the tree. This type should be trivially copyable to the device.Public Functions
-
inline void reset()#
Reset the node to a default state with no child nodes and no data held.
-
inline bool is_node(const KEY_TYPE node_key)#
Test if the node corresponds to the input node key.#
- Parameters:
node_key – Node key to test.
- Returns:
True if this node corresponds to the input node key.
-
inline BlockedBinaryNode<KEY_TYPE, VALUE_TYPE, WIDTH> *next(const KEY_TYPE node_key)#
Assuming a node does not match a requested node key, return the child branch which might contain the node. If the node key matches the current node returns the current node.
- Parameters:
node_key – Node key currently being searched for.
- Returns:
Pointer to child node (may be nullptr).
-
inline bool get_location(const KEY_TYPE key, bool **leaf_set, VALUE_TYPE **value)#
For a given global key find the leaf location for the value and the bool that indicates if the value is set. If the key is not in the tree return false.
- Parameters:
key – [in] Global key to find location of value for.
leaf_set – [inout] Return location that points to the flag that indicates if the value is set.
value – [inout] Return location for a pointer to the value.
- Returns:
True if the key is located in the tree otherwise false. The leaf_set and value parameters only contain meaningful values if the return value is true.
-
inline bool get(const KEY_TYPE key, VALUE_TYPE *value)#
For a given key find and return the stored value.
- Parameters:
key – [in] Input global key to retrieve value for.
value – [inout] Pointer to value, only valid if the key is found.
- Returns:
True if the key is found in the tree otherwise false.
-
inline bool set(const KEY_TYPE key, const VALUE_TYPE value)#
For a given key store the corresponding value in the tree. This function assumes that the node is already allocated and placed in the tree according to the node_key.
- Parameters:
key – Global key to store value against.
value – Input value to store pointed to by key.
Returns – true if the value was successfully stored. A return value of false indicates the node which should store the value is not present in the tree.
-
inline void add_node(BlockedBinaryNode<KEY_TYPE, VALUE_TYPE, WIDTH> *node)#
Add an allocated node to the tree under a given node key. The
node_key
member of the added node will be used to determine tree placement.- Parameters:
node – Node to place into the tree.
Public Members
-
KEY_TYPE node_key#
The starting key this node in the tree holds, i.e. with WIDTH=8 node 2 holds keys [8,15].
-
BlockedBinaryNode<KEY_TYPE, VALUE_TYPE, WIDTH> *lhs#
Pointer to the node which forms the left hand branch from this node. May be nullptr if this node does not exist.
-
BlockedBinaryNode<KEY_TYPE, VALUE_TYPE, WIDTH> *rhs#
Pointer to the node which forms the right hand branch from this node. May be nullptr if this node does not exist.
-
VALUE_TYPE data[WIDTH]#
The storage for the values the tree holds.
Public Static Functions
-
static inline KEY_TYPE get_node_key(const KEY_TYPE key)#
For a given input key (in the global key space) get the node key which contains the values for the key.
- Parameters:
key – Input key to index into the tree with.
- Returns:
Node key that indicates the node in the tree which contains the key.
-
static inline KEY_TYPE get_leaf_key(const KEY_TYPE key)#
For a given input key (in the global key space) get the leaf key which can be used to index into the data member on the node which contains the key - see
get_node_key
.- Parameters:
key – Input key to index into container.
- Returns:
Index into data member that corresponds to the input key.
-
inline void reset()#
-
template<typename KEY_TYPE, typename VALUE_TYPE, INT WIDTH>
class BlockedBinaryTree# - #include <blocked_binary_tree.hpp>
Create a blocked key-value map with a given block size. This class creates the tree and provides methods to get and set key-value pairs.
Public Functions
-
inline ~BlockedBinaryTree()#
Create a new tree on a given SYCL device.
-
inline void add(const KEY_TYPE key, const VALUE_TYPE value)#
Add a key-value pair to the container.
- Parameters:
key – Key to add to container.
value – Value to add to container under given key.
-
inline bool host_get(const KEY_TYPE key, VALUE_TYPE *value)#
Host callable method to retrieve the value that corresponds to a given key.
- Parameters:
key – [in] Key to retrieve value for.
value – [inout] Pointer to value type in which to place output value.
- Returns:
True if the key is found in the container otherwise false.
Public Members
-
SYCLTargetSharedPtr sycl_target#
The SYCLTarget on which the tree is allocated.
-
BlockedBinaryNode<KEY_TYPE, VALUE_TYPE, WIDTH> *root#
The root node of the tree.
Protected Attributes
-
std::map<KEY_TYPE, BlockedBinaryNode<KEY_TYPE, VALUE_TYPE, WIDTH>*> nodes#
-
inline ~BlockedBinaryTree()#
-
template<typename T>
class BufferBase# - #include <compute_target.hpp>
Subclassed by NESO::Particles::BufferDevice< int >, NESO::Particles::BufferDevice< REAL >, NESO::Particles::BufferDevice< REAL *** >, NESO::Particles::BufferDevice< INT *** >, NESO::Particles::BufferDevice< INT >, NESO::Particles::BufferDevice< REAL *const *const * >, NESO::Particles::BufferDevice< INT *const *const * >, NESO::Particles::BufferDevice< char >, NESO::Particles::BufferHost< int >, NESO::Particles::BufferHost< REAL *** >, NESO::Particles::BufferHost< INT *** >, NESO::Particles::BufferHost< MPI_Request >, NESO::Particles::BufferHost< MPI_Status >, NESO::Particles::BufferHost< INT >, NESO::Particles::BufferHost< REAL >, NESO::Particles::BufferHost< REAL *const *const * >, NESO::Particles::BufferHost< INT *const *const * >, NESO::Particles::BufferHost< char >, NESO::Particles::BufferDevice< T >, NESO::Particles::BufferHost< T >, NESO::Particles::BufferShared< T >
Public Functions
-
inline std::size_t size_bytes()#
Get the size of the allocation in bytes.
- Returns:
size of buffer in bytes.
-
inline int realloc_no_copy(const std::size_t size)#
Reallocate the buffer to hold at least the requested number of elements. May or may not reduce the buffer size if called with a size less than the current allocation. Current contents is not copied to the new buffer.
- Parameters:
size – Minimum number of elements this buffer should be able to hold.
-
inline sycl::event set_async(const std::vector<T> &data)#
Asynchronously set the values in the buffer to those in a std::vector.
- Parameters:
data – Input vector to copy values from.
- Returns:
Event to wait on before using new values in the buffer.
-
inline void set(const std::vector<T> &data)#
Set the values in the buffer to those in a std::vector. Blocks until the copy is complete.
- Parameters:
data – Input vector to copy values from.
-
inline sycl::event get_async(std::vector<T> &data)#
Asynchronously get the values in the buffer into a std::vector.
- Parameters:
data – [inout] Input vector to copy values from buffer into.
- Returns:
Event to wait on before using new values in the std::vector.
Public Members
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
-
inline std::size_t size_bytes()#
-
template<typename T>
class BufferDevice : public NESO::Particles::BufferBase<T># - #include <compute_target.hpp>
Container around USM device allocated memory that can be resized.
Public Functions
-
BufferDevice(const BufferDevice &st) = delete#
Disable (implicit) copies.
-
BufferDevice &operator=(BufferDevice const &a) = delete#
Disable (implicit) copies.
Create a new BufferDevice of a given number of elements.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
size – Number of elements.
Create a new BufferDevice from a std::vector. Note, this does not operate like a sycl::buffer and is a copy of the source vector.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
vec – Input vector to copy data from.
-
inline ~BufferDevice()#
-
BufferDevice(const BufferDevice &st) = delete#
-
template<typename T>
class BufferDeviceHost# - #include <compute_target.hpp>
Wrapper around a BufferDevice and a BufferHost to store data on the device and the host. To be used as an alternative to BufferShared where the programmer wants to explicitly handle when data is copied between the device and the host.
Public Functions
-
BufferDeviceHost(const BufferDeviceHost &st) = delete#
Disable (implicit) copies.
-
BufferDeviceHost &operator=(BufferDeviceHost const &a) = delete#
Disable (implicit) copies.
-
inline ~BufferDeviceHost()#
Create a new BufferDeviceHost of the request size on the requested compute target.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
size – Number of elements to initially allocate on the device and host.
Create a new BufferDeviceHost from a std::vector. Note, this does not operate like a sycl::buffer and is a copy of the source vector.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
vec – Input vector to copy data from.
-
inline size_t size_bytes()#
Get the size in bytes of the allocation on the host and device.
- Returns:
Number of bytes allocated on the host and device.
-
inline int realloc_no_copy(const size_t size)#
Reallocate both the device and host buffers to hold at least the requested number of elements. May or may not reduce the buffer size if called with a size less than the current allocation. Current contents is not copied to the new buffer.
- Parameters:
size – Minimum number of elements this buffer should be able to hold.
-
inline void host_to_device()#
Copy the contents of the host buffer to the device buffer.
-
inline void device_to_host()#
Copy the contents of the device buffer to the host buffer.
-
inline sycl::event async_host_to_device()#
Start an asynchronous copy of the host data to the device buffer.
- Returns:
sycl::event to wait on for completion of data movement.
-
inline sycl::event async_device_to_host()#
Start an asynchronous copy of the device data to the host buffer.
- Returns:
sycl::event to wait on for completion of data movement.
Public Members
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
-
size_t size#
Size of the allocation on device and host.
-
BufferDevice<T> d_buffer#
Wrapped BufferDevice.
-
BufferHost<T> h_buffer#
Wrapped BufferHost.
-
BufferDeviceHost(const BufferDeviceHost &st) = delete#
-
template<typename T>
class BufferHost : public NESO::Particles::BufferBase<T># - #include <compute_target.hpp>
Container around USM host allocated memory that can be resized.
Public Functions
-
BufferHost(const BufferHost &st) = delete#
Disable (implicit) copies.
-
BufferHost &operator=(BufferHost const &a) = delete#
Disable (implicit) copies.
Create a new BufferHost of a given number of elements.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
size – Number of elements.
Create a new BufferHost from a std::vector. Note, this does not operate like a sycl::buffer and is a copy of the source vector.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
vec – Input vector to copy data from.
-
inline ~BufferHost()#
-
BufferHost(const BufferHost &st) = delete#
- #include <compute_target.hpp>
Container around USM shared allocated memory that can be resized.
Public Functions
Disable (implicit) copies.
Disable (implicit) copies.
Create a new DeviceShared of a given number of elements.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
size – Number of elements.
Create a new BufferShared from a std::vector. Note, this does not operate like a sycl::buffer and is a copy of the source vector.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
vec – Input vector to copy data from.
Protected Functions
-
class CartesianCellBin#
- #include <cell_binning.hpp>
Bin particle positions into the cells of a CartesianHMesh.
Public Functions
-
CartesianCellBin(const CartesianCellBin &st) = delete#
Disable (implicit) copies.
-
CartesianCellBin &operator=(CartesianCellBin const &a) = delete#
Disable (implicit) copies.
-
inline ~CartesianCellBin()#
Create instance to bin particles into cells of a CartesianHMesh.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
mesh – CartesianHMeshSharedPtr to containing the particles.
position_dat – ParticleDat with components equal to the mesh dimension containing particle positions.
cell_id_dat – ParticleDat to write particle cell ids to.
Private Members
-
BufferDevice<int> d_cell_counts#
-
BufferDevice<int> d_cell_starts#
-
BufferDevice<int> d_cell_ends#
-
SYCLTargetSharedPtr sycl_target#
-
ParticleDatSharedPtr<REAL> position_dat#
-
ParticleDatSharedPtr<INT> cell_id_dat#
-
CartesianCellBin(const CartesianCellBin &st) = delete#
-
class CartesianHMesh : public NESO::Particles::HMesh#
- #include <mesh_interface.hpp>
Example mesh that duplicates a MeshHierarchy as a HMesh for examples and testing.
Public Functions
-
CartesianHMesh(const CartesianHMesh &st) = delete#
Disable (implicit) copies.
-
CartesianHMesh &operator=(CartesianHMesh const &a) = delete#
Disable (implicit) copies.
-
inline CartesianHMesh(MPI_Comm comm, const int ndim, std::vector<int> &dims, const double extent = 1.0, const int subdivision_order = 1, const int stencil_width = 0)#
Construct a mesh over a given MPI communicator with a specified shape.
- Parameters:
comm – MPI Communicator to use for decomposition.
ndim – Number of dimensions.
dims – Number of coarse cells in each dimension.
extent – Width of each coarse cell in each dimension.
subdivision_order – Number of times to subdivide each coarse cell to produce the fine cells.
stencil_width – Width of the stencil, in number of cells, used to determine MPI neighbours.
-
inline virtual MPI_Comm get_comm()#
Get the MPI communicator of the mesh.
- Returns:
MPI communicator.
-
inline virtual int get_ndim()#
Get the number of dimensions of the mesh.
- Returns:
Number of mesh dimensions.
-
inline virtual int get_subdivision_order()#
Get the subdivision order of the mesh.
- Returns:
Subdivision order.
-
inline virtual double get_cell_width_coarse()#
Get the mesh width of the coarse cells in the MeshHierarchy.
- Returns:
MeshHierarchy coarse cell width.
-
inline virtual double get_cell_width_fine()#
Get the mesh width of the fine cells in the MeshHierarchy.
- Returns:
MeshHierarchy fine cell width.
-
inline virtual double get_inverse_cell_width_coarse()#
Get the inverse mesh width of the coarse cells in the MeshHierarchy.
- Returns:
MeshHierarchy inverse coarse cell width.
-
inline virtual double get_inverse_cell_width_fine()#
Get the inverse mesh width of the fine cells in the MeshHierarchy.
- Returns:
MeshHierarchy inverse fine cell width.
-
inline virtual int get_ncells_coarse()#
Get the global number of coarse cells.
- Returns:
Global number of coarse cells.
-
inline virtual int get_ncells_fine()#
Get the number of fine cells per coarse cell.
- Returns:
Number of fine cells per coarse cell.
-
inline virtual int get_cell_count()#
- Returns:
The number of “cell” NESO-Particles should consider.
-
inline int get_cart_cell_count()#
- Returns:
The number of Cartesian cells owned by this MPI rank.
-
inline virtual std::shared_ptr<MeshHierarchy> get_mesh_hierarchy()#
Get the MeshHierarchy instance placed over the mesh.
- Returns:
MeshHierarchy placed over the mesh.
-
inline void mesh_tuple_to_mh_tuple(const INT *index_mesh, INT *index_mh)#
Convert a mesh index (index_x, index_y, …) for this cartesian mesh to the format for a MeshHierarchy: (coarse_x, coarse_y,.., fine_x, fine_y,…).
- Parameters:
index_mesh – Input tuple index on mesh.
index_mh – Output tuple index on MeshHierarchy.
-
inline virtual void free()#
Free the mesh and any associated communicators.
-
inline virtual std::vector<int> &get_local_communication_neighbours()#
Get a std::vector of MPI ranks which should be used to setup local communication patterns.
- Returns:
std::vector of MPI ranks.
-
inline virtual void get_point_in_subdomain(double *point)#
Get a point in the domain that should be in, or at least close to, the sub-domain on this MPI process. Useful for parallel initialisation.
- Parameters:
point – Pointer to array of size equal to at least the number of mesh dimensions.
Public Members
-
int cell_starts[3] = {0, 0, 0}#
Holds the first cell this rank owns in each dimension.
-
int cell_ends[3] = {1, 1, 1}#
Holds the last cell+1 this ranks owns in each dimension.
-
int cell_counts_local[3] = {0, 0, 0}#
Local number of cells in each dimension.
-
double global_extents[3] = {0.0, 0.0, 0.0}#
Global extents of the mesh.
-
int stencil_width#
Width of the stencil used to determine which MPI ranks are neighbours.
-
const int ndim#
Number of dimensions of the mesh.
-
const int subdivision_order#
Subdivision order to determine number of fine cells per coarse cell.
-
const double cell_width_coarse#
Width of coarse cells, uniform in all dimensions.
-
const double cell_width_fine#
Width of fine cells, uniform in all dimensions.
-
const double inverse_cell_width_coarse#
Inverse of the coarse cell width.
-
const double inverse_cell_width_fine#
Inverse of the fine cell width.
-
const int ncells_coarse#
Global number of coarse cells.
-
const int ncells_fine#
Number of coarse cells per fine cell.
-
bool single_cell_mode#
Is this mesh running in a mode where it exposes one NP cell per MPI rank.
-
CartesianHMesh(const CartesianHMesh &st) = delete#
-
class CartesianHMeshLocalMapperT : public NESO::Particles::LocalMapper#
- #include <cartesian_mesh.hpp>
LocalMapper for CartesianHMesh. Maps particle positions within the stencil width of each MPI subdomain to the owning rank.
Public Functions
-
CartesianHMeshLocalMapperT(const CartesianHMeshLocalMapperT &st) = delete#
Disable (implicit) copies.
-
CartesianHMeshLocalMapperT &operator=(CartesianHMeshLocalMapperT const &a) = delete#
Disable (implicit) copies.
Construct a new mapper instance to map local particle positions to owing ranks.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
mesh – CartesianHMesh instance this mapping is based on.
-
inline virtual void map(ParticleGroup &particle_group, const int map_cell = -1)#
Map positions to owning MPI ranks. Positions should be within the domain prior to calling map, i.e. particles should be within the domain extents.
- Parameters:
particle_group – ParticleGroup to use.
-
inline virtual void particle_group_callback(ParticleGroup &particle_group)#
No-op implementation of callback.
- Parameters:
particle_group – ParticleGroup.
Public Members
-
CartesianHMeshSharedPtr mesh#
CartesianHMesh on which the lookup is based.
Protected Attributes
-
SYCLTargetSharedPtr sycl_target#
-
int ndim#
-
std::unique_ptr<BufferDeviceHost<int>> dh_cell_lookups[3]#
-
std::unique_ptr<BufferDeviceHost<int*>> dh_cell_lookup#
-
std::unique_ptr<BufferDeviceHost<int>> dh_rank_map#
-
std::unique_ptr<BufferDeviceHost<int>> dh_dims#
-
std::unique_ptr<BufferDeviceHost<int>> dh_cell_counts#
-
CartesianHMeshLocalMapperT(const CartesianHMeshLocalMapperT &st) = delete#
-
class CartesianPeriodic#
- #include <boundary_conditions.hpp>
Periodic boundary conditions implementation designed to work with a CartesianHMesh.
Public Functions
-
CartesianPeriodic(const CartesianPeriodic &st) = delete#
Disable (implicit) copies.
-
CartesianPeriodic &operator=(CartesianPeriodic const &a) = delete#
Disable (implicit) copies.
-
inline ~CartesianPeriodic()#
Construct instance to apply periodic boundary conditions to particles within the passed ParticleDat.
- Parameters:
sycl_target – SYCLTarget to use as compute device.
mesh – CartedianHMesh instance to use a domain for the particles.
position_dat – ParticleDat containing particle positions.
Construct instance to apply periodic boundary conditions to particles within the passed ParticleDat.
- Parameters:
mesh – CartedianHMesh instance to use a domain for the particles.
particle_group – ParticleGroup to apply periodic boundary conditions to.
-
inline void execute()#
Apply periodic boundary conditions to the particle positions in the ParticleDat this instance was created with.
Private Members
-
BufferDevice<REAL> d_extents#
-
SYCLTargetSharedPtr sycl_target#
-
std::shared_ptr<CartesianHMesh> mesh#
-
ParticleDatSharedPtr<REAL> position_dat#
-
ParticleLoopSharedPtr pbc_loop#
-
CartesianPeriodic(const CartesianPeriodic &st) = delete#
-
template<typename T>
class CellDat# - #include <cell_dat.hpp>
Store data on each cell where the number of columns required per cell is constant but the number of rows is variable. Data is stored in a column major manner with a new device pointer per column.
Public Functions
-
inline ~CellDat()#
Create new CellDat on a specified compute target with a specified number of cells and number of columns per cell.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
ncells – Number of cells (fixed).
ncol – Number of columns in each cell (fixed).
-
template<typename U>
inline void reduce_nrow(const U *h_nrow_required)# Pass a number of nrows for each cell where the user promises the new number of rows are equal to or less than the current number of rows.
-
inline void set_nrow(const INT cell, const INT nrow_required)#
Set the number of rows required in a provided cell. This will realloc if needed and copy the existing data into the new space. May not shrink the array if the requested size is smaller than the existing size. wait_set_nrow should be called before using the dat.
-
inline void wait_set_nrow()#
Wait for set_nrow to complete
-
inline int compute_nrow_max()#
Recompute nrow_max from current row counts.
- Returns:
The maximum number of rows across all cells.
-
inline int get_nrow_max()#
Get the maximum number of rows across all cells.
- Returns:
The maximum number of rows across all cells.
-
inline int get_nrow_min()#
Get the minimum number of rows across all cells.
- Returns:
The minimum number of rows across all cells.
-
inline CellData<T> get_cell(const int cell)#
Get the contents of a provided cell on the host as a CellData instance.
- Parameters:
cell – Cell to get data from.
- Returns:
Cell contents of specified cell as CellData instance.
-
inline T get_value(const int cell, const int row, const int col)#
Get a value from a cell, row and column.
- Parameters:
cell – Cell index.
row – Row index.
col – Column index.
- Returns:
Value at location.
-
inline void set_value(const int cell, const int row, const int col, const T value)#
Set a value directly using cell, row, column and value.
- Parameters:
cell – Cell index.
row – Row index.
col – Column index.
value – Value to set at location.
-
inline void get_cell_async(const int cell, CellDataT<T> &cell_data, EventStack &event_stack)#
Get the contents of a provided cell on the host as a CellData instance.
- Parameters:
cell – Cell to get data from.
cell_data – CellDataT instance to populate, must be sufficiently sized.
event_stack – EventStack instance to call wait on for copy.
-
inline void set_cell(const int cell, CellData<T> cell_data)#
Set the contents of a cell on the device using a CellData instance.
- Parameters:
cell – Cell index to set data in.
cell_data – New cell data to set.
-
inline void set_cell_async(const int cell, CellDataT<T> &cell_data, EventStack &event_stack)#
Set the contents of a cell on the device using a CellData instance.
- Parameters:
cell – Cell index to set data in.
cell_data – New cell data to set.
event_stack – EventStack instance to wait on.
-
inline T ***device_ptr()#
Get the root device pointer for the data storage. Data can be accessed on the device in SYCL kernels with access like: d[cell_index][column_index][row_index]
- Returns:
Device pointer that can be used to access the underlying data.
-
inline void print(int start = -1, int end = -1)#
Helper function to print the contents of all cells or a specified range of cells.
- Parameters:
start – (optional) First cell to print.
end – (option) Last cell minus one to print.
Public Members
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
-
const int ncells#
Number of cells.
-
const int ncol#
Number of columns, uniform across all cells.
Protected Functions
-
inline T ***impl_get()#
Non-const pointer to underlying device data. Intended for friend access from ParticleLoop.
-
inline T *const *const *impl_get_const()#
Const pointer to underlying device data. Intended for friend access from ParticleLoop.
Friends
- friend class ParticleLoop
- friend class ParticleDatT
- friend class ParticlePacker
-
friend T ***create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<CellDat<T>*> &a)#
-
inline ~CellDat()#
-
template<typename T>
class CellDataT# - #include <cell_data.hpp>
Container for the data within a single cell stored on the host. Data is store column wise. The data is typically particle data for a single ParticleDat for a single cell and exists as a 2D data structure.
Public Functions
Create a new, empty and uninitialised container for 2D data of the specified shape.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
nrow – Number of rows.
ncol – Number of columns.
-
inline std::vector<T> &operator[](int col)#
Subscript operator for cell data. Data should be indexed by column then row. e.g. CellData cell_data; T value = *cell_data[col][row];
Public Members
-
const int nrow#
Number of rows in the 2D data structure.
-
const int ncol#
Number of columns in the 2D data structure.
Private Functions
Private Members
-
SYCLTargetSharedPtr sycl_target#
-
template<typename T>
class CellDatConst# - #include <cell_dat_const.hpp>
Container that allocates on the device a matrix of fixed size nrow X ncol for N cells. Data stored in column major format. i.e. Data order from slowest to fastest is: cell, column, row.
Public Functions
-
CellDatConst(const CellDatConst &st) = delete#
Disable (implicit) copies.
-
CellDatConst &operator=(CellDatConst const &a) = delete#
Disable (implicit) copies.
-
inline ~CellDatConst()#
-
inline void fill(const T value)#
Fill all the entries with a given value.
- Parameters:
value – Value to place in all entries.
Create new CellDatConst on the specified compute target with a fixed cell count, fixed number of rows per cell and fixed number of columns per cell.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
ncells – Number of cells.
nrow – Number of rows.
ncol – Number of columns.
-
inline int idx(const int cell, const int row, const int col)#
Helper function to index into the stored data. Note column major format.
- Parameters:
cell – Cell index to index into.
row – Row to access.
col – Column to access.
- Returns:
Linear index into data structure for the specified row and column.
-
inline T *device_ptr()#
Get the device pointer for the underlying data. Only accessible on the device.
- Returns:
Returns a device pointer on the compute target.
-
inline CellData<T> get_cell(const int cell)#
Get the data stored in a provided cell on the host as a CellData instance.
- Parameters:
cell – Cell to access the underlying data for.
- Returns:
Cell data for cell.
-
inline void set_cell(const int cell, CellData<T> cell_data)#
Set the data in a cell using a CellData instance.
- Parameters:
cell – Cell to set data for.
cell_data – Source data.
Public Members
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
-
const int ncells#
Number of cells, labeled 0,…,N-1.
-
const int nrow#
Number of rows in each cell.
-
const int ncol#
Number of columns in each cell.
Protected Functions
-
inline CellDatConstDeviceType<T> impl_get()#
Non-const pointer to underlying device data. Intended for friend access from ParticleLoop.
-
inline CellDatConstDeviceTypeConst<T> impl_get_const()#
Const pointer to underlying device data. Intended for friend access from ParticleLoop.
Friends
- friend class ParticleLoop
-
friend CellDatConstDeviceTypeConst<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<CellDatConst<T>*> &a)#
-
friend CellDatConstDeviceType<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<CellDatConst<T>*> &a)#
-
friend CellDatConstDeviceType<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Min<CellDatConst<T>*> &a)#
-
friend CellDatConstDeviceType<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Max<CellDatConst<T>*> &a)#
-
CellDatConst(const CellDatConst &st) = delete#
-
template<typename T>
struct CellDatConstDeviceType# - #include <cell_dat_const.hpp>
Type the implementation methods return;
-
template<typename T>
struct CellDatConstDeviceTypeConst# - #include <cell_dat_const.hpp>
-
class CellMove#
- #include <cell_dat_move.hpp>
CellMove is the implementation that moves particles between cells. When a particle moves to a new cell the corresponding data is moved to the new cell in all the ParticleDat instances.
Public Functions
-
inline ~CellMove()#
Create a cell move instance to move particles between cells.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
ncell – Total number of cells.
layer_compressor – LayerCompressor to use to compress ParticleDat instances.
particle_dats_real – Container of REAL ParticleDat.
particle_dats_int – Container of INT ParticleDat.
Set the ParticleDat to use as a source for cell ids.
- Parameters:
cell_id_dat – ParticleDat to use for cell ids.
-
inline void move()#
Move particles between cells (on this MPI rank) using the cell ids on the particles.
Public Members
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
Private Functions
-
inline void get_particle_dat_info()#
Private Members
-
const int ncell#
-
ParticleDatSharedPtr<INT> cell_id_dat#
-
BufferHost<int> h_npart_cell#
-
BufferDevice<int> d_npart_cell#
-
BufferDevice<int> d_cells_old#
-
BufferDevice<int> d_cells_new#
-
BufferDevice<int> d_layers_old#
-
BufferDevice<int> d_layers_new#
-
BufferHost<int> h_move_count#
-
BufferDevice<int> d_move_count#
-
int num_dats_real = 0#
-
int num_dats_int = 0#
-
BufferHost<REAL***> h_particle_dat_ptr_real#
-
BufferHost<INT***> h_particle_dat_ptr_int#
-
BufferHost<int> h_particle_dat_ncomp_real#
-
BufferHost<int> h_particle_dat_ncomp_int#
-
BufferDevice<REAL***> d_particle_dat_ptr_real#
-
BufferDevice<INT***> d_particle_dat_ptr_int#
-
BufferDevice<int> d_particle_dat_ncomp_real#
-
BufferDevice<int> d_particle_dat_ncomp_int#
-
LayerCompressor &layer_compressor#
-
ErrorPropagate ep_bad_cell_indices#
-
inline ~CellMove()#
-
template<template<typename...> class T, typename U>
class ColumnMajorColumnAccessor# - #include <access.hpp>
One of a pair of classes that enable indexing like foo[row][col] for an object foo which stores data in a column major format.
Public Functions
-
inline ColumnMajorColumnAccessor(T<U> &base, const int &stride, const int &rowx)#
Create new instance to underlying data structure of type
T<U>
which stores 2D data in a column major format using a given stride.- Parameters:
base – Object to index into.
stride – Number of rows in the 2D object.
rowx – Row to access.
-
inline ColumnMajorColumnAccessor(T<U> &base, const int &stride, const int &rowx)#
-
template<template<typename...> class T, typename U>
class ColumnMajorRowAccessor# - #include <access.hpp>
One of a pair of classes that enable indexing like foo[row][col] for an object foo which stores data in a column major format.
Public Functions
-
inline ColumnMajorRowAccessor(T<U> &base, const int &stride)#
Create new instance to underlying data structure of type
T<U>
which stores 2D data in a column major format using a given stride.- Parameters:
base – Object to index into.
stride – Number of rows in the 2D object.
-
inline ColumnMajorColumnAccessor<T, U> operator[](const int &rowx)#
Returns a ColumnMajorColumnAccessor instance which defines a subscript operator that can be used to access any column of the specified row.
- Parameters:
rowx – Row to provide access to.
-
inline ColumnMajorRowAccessor(T<U> &base, const int &stride)#
-
class CommPair#
- #include <communication.hpp>
Wrapper around a pair of inter and intra MPI Comms for shared memory purposes.
Public Functions
-
inline ~CommPair()#
-
inline CommPair()#
-
inline CommPair(MPI_Comm comm_parent)#
Create a new set of inter and intra shared memory region communicators from a parent communicator. Must be called collectively on the parent communicator.
- Parameters:
comm_parent – MPI communicator to derive intra and inter communicators from.
Public Members
-
MPI_Comm comm_parent#
Parent (i.e. global for the simulation) MPI communicator.
-
MPI_Comm comm_inter#
Communicator between one rank on each shared memory region.
-
MPI_Comm comm_intra#
Communicator between the ranks in a shared memory region.
-
int rank_parent#
MPI rank in the parent communicator.
-
int rank_inter#
MPI rank in the inter shared memory region communicator.
-
int rank_intra#
MPI rank within the shared memory region communicator.
-
int size_parent#
Size of the parent communicator.
-
int size_inter#
Size of the inter shared memory communicator.
-
int size_intra#
Size of the intra shared memory communicator.
Private Members
-
bool allocated = false#
-
inline ~CommPair()#
-
class DepartingIdentify#
- #include <departing_particle_identification.hpp>
Class to identify which particles are leaving and MPI rank based on which MPI rank is stored in the NESO_MPI_RANK ParticleDat
Public Functions
-
DepartingIdentify(const DepartingIdentify &st) = delete#
Disable (implicit) copies.
-
DepartingIdentify &operator=(DepartingIdentify const &a) = delete#
Disable (implicit) copies.
-
inline ~DepartingIdentify()#
Create a new instance of this class.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
Set the ParticleDat that contains particle MPI ranks.
- Parameters:
mpi_rank_dat – ParticleDat containing MPI ranks.
-
inline void identify(const int rank_component = 0)#
Identify particles which should be packed and sent to remote MPI ranks. The argument indicates which component of the MPI ranks dat that should be inspected for MPI rank. The intention is that component 0 indicates remote MPI ranks where the particle should be sent through a global communication pattern. Component 1 indicates a remote rank where the particle should be sent through a neighbour based “local” communication pattern. Negative MPI ranks are ignored.
- Parameters:
rank_component – Component to inspect for MPI rank.
Public Members
-
BufferDeviceHost<int> dh_send_ranks#
Array of unique MPI ranks that particles should be sent to.
-
BufferDeviceHost<int> dh_send_counts_all_ranks#
Array of length equal to the communicator size indicating how many particles should be sent to each rank.
-
BufferDeviceHost<int> dh_send_rank_map#
Map from MPI ranks to an index that orders the send ranks.
-
BufferDevice<int> d_pack_cells#
Array that contains the source cells of departing particles.
-
BufferDevice<int> d_pack_layers_src#
Array that contains the source layers (rows) of departing particles.
-
BufferDevice<int> d_pack_layers_dst#
Array that contains the destination layers in the packing buffer of departing particles.
-
BufferDeviceHost<int> dh_num_ranks_send#
Size one array to accumulate the number of remote ranks particles should be sent to.
-
BufferDeviceHost<int> dh_num_particle_send#
Size one array to accumulate the total number of leaving particles.
-
ParticleDatSharedPtr<INT> mpi_rank_dat#
ParticleDat containing MPI ranks.
Private Members
-
SYCLTargetSharedPtr sycl_target#
-
DepartingIdentify(const DepartingIdentify &st) = delete#
-
class DescendantProducts : public NESO::Particles::ProductMatrix#
- #include <descendant_products.hpp>
Class to create M products from each parent particle. Products may inherit property values from the parent.
Public Functions
-
DescendantProducts() = default#
-
DescendantProducts &operator=(const DescendantProducts&) = default#
Create an instance from a ProductMatrixSpec that defines which particle properties should be available for writing in the particle loop kernel.
- Parameters:
sycl_target – Compute device on which products will be made.
spec – Specification of properties which require specialisation in the creating kernel.
num_products_per_parent – The maximum number of products required per parent particle.
-
inline virtual void reset(const int num_particles) override#
Resize the container to hold space for the products of a number of parent particles.
- Parameters:
num_particles – Number of parent particles space is required for.
Public Members
-
int num_products_per_parent#
The number of products this data structure is expecting per parent particle.
-
int num_particles#
The current number of parent particles the container is allocated for.
Protected Functions
-
inline DescendantProductsGet impl_get()#
Protected Attributes
-
std::shared_ptr<BufferDevice<INT>> d_parent_cells#
-
std::shared_ptr<BufferDevice<INT>> d_parent_layers#
Friends
- friend class ParticleGroup
-
inline friend DescendantProductsGet create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<DescendantProducts*> &a)#
-
DescendantProducts() = default#
-
struct DescendantProductsGet#
- #include <descendant_products.hpp>
-
class Domain#
- #include <domain.hpp>
A domain wraps a mesh with useful methods such as how to bin particles into local cells on that mesh type.
Public Functions
Construct a new Domain.
- Parameters:
mesh – HMesh derived mesh object.
local_mapper – Object to map particle positions into mesh cells.
-
inline ~Domain()#
Public Members
-
HMeshSharedPtr mesh#
HMesh derived mesh instance.
-
LocalMapperSharedPtr local_mapper#
LocalMapper derived class instance to bin particles into mesh cells.
-
class DummyLocalMapperT : public NESO::Particles::LocalMapper#
- #include <local_mapping.hpp>
Dummy LocalMapper implementation that does nothing to use as a default.
Public Functions
-
DummyLocalMapperT(const DummyLocalMapperT &st) = delete#
Disable (implicit) copies.
-
DummyLocalMapperT &operator=(DummyLocalMapperT const &a) = delete#
Disable (implicit) copies.
-
inline ~DummyLocalMapperT()#
-
inline DummyLocalMapperT()#
No-op Constructor.
-
inline virtual void map(ParticleGroup &particle_group, const int map_cell = -1)#
No-op implementation of map.
-
inline virtual void particle_group_callback(ParticleGroup &particle_group)#
No-op implementation of callback.
-
DummyLocalMapperT(const DummyLocalMapperT &st) = delete#
-
class ErrorPropagate#
- #include <error_propagate.hpp>
Helper class to propagate errors thrown from inside a SYCL kernel
Public Functions
-
ErrorPropagate(const ErrorPropagate &st) = delete#
Disable (implicit) copies.
-
ErrorPropagate &operator=(ErrorPropagate const &a) = delete#
Disable (implicit) copies.
-
inline ~ErrorPropagate()#
Create a new instance to track assertions thrown in SYCL kernels.
- Parameters:
sycl_target – SYCLTargetSharedPtr used for the kernel.
-
inline void reset()#
Reset the internal state. Useful if the instance is used to indicate events occurred in a parallel loop that are non fatal.
-
inline int *device_ptr()#
Get the int device pointer for use in a SYCL kernel. This pointer should be incremented atomically with some positive integer to indicate an error occured in the kernel.
-
inline void check_and_throw(const char *error_msg)#
Check the stored integer. If the integer is non-zero throw an error with the passed message.
- Parameters:
error_msg – Message to throw if stored integer is non-zero.
-
inline int get_flag()#
Get the current value of the flag on the host.
- Returns:
flag.
-
ErrorPropagate(const ErrorPropagate &st) = delete#
-
class EventStack#
- #include <compute_target.hpp>
Helper class to hold a collection of sycl::event instances which can be waited on.
-
template<size_t N, size_t... S>
struct GenerateIntSequence# - #include <tuple.hpp>
Public Types
-
using type = typename GenerateIntSequence<N - 1, N - 1, S...>::type#
-
using type = typename GenerateIntSequence<N - 1, N - 1, S...>::type#
-
template<size_t... S>
struct GenerateIntSequence<0, S...># - #include <tuple.hpp>
Public Types
-
using type = IntSequence<S...>#
-
using type = IntSequence<S...>#
-
template<size_t INDEX, typename T, typename ...U>
struct GetIndexType# - #include <tuple.hpp>
Public Types
-
using type = typename GetIndexType<INDEX - 1, U...>::type#
-
using type = typename GetIndexType<INDEX - 1, U...>::type#
-
template<typename T>
class GlobalArray# - #include <global_array.hpp>
GlobalArray is an array type which can be accessed from kernels in read or atomic add mode. Post loop execution, with add access mode, the global array values are automatically reduced across the MPI communicator.
Public Functions
-
GlobalArray() = default#
-
GlobalArray<T> &operator=(const GlobalArray<T>&) = default#
Note that the copy operator creates shallow copies of the array.
Create a new GlobalArray on a compute target and given size.
- Parameters:
sycl_target – Device to create GlobalArray on.
size – Number of elements in array.
Default – value to initialise values to.
-
inline void fill(const T value)#
Fill the array with a value.
- Parameters:
value – Value to fill the array with - not reduced across MPI ranks.
-
inline sycl::event get_async(std::vector<T> &data)#
Asynchronously get the values in the local array into a std::vector.
- Parameters:
data – [inout] Input vector to copy values from GlobalArray into.
- Returns:
Event to wait on before using new values in the std::vector.
-
inline void get(std::vector<T> &data)#
Get the values in the local array into a std::vector. Blocks until copy is complete.
- Parameters:
data – [inout] Input vector to copy values from GlobalArray into.
-
inline std::vector<T> get()#
Get the values in the local array into a std::vector.
- Returns:
std::vector of values in the GlobalArray.
Public Members
-
SYCLTargetSharedPtr sycl_target#
The SYCLTarget the GlobalArray is created on.
-
MPI_Comm comm#
The MPI communicator reductions are made over.
Protected Functions
-
inline GlobalArrayImplGetT<T> impl_get()#
Non-const pointer to underlying device data. Intended for friend access from ParticleLoop.
-
inline GlobalArrayImplGetConstT<T> impl_get_const()#
Const pointer to underlying device data. Intended for friend access from ParticleLoop.
-
inline void impl_post_loop_add()#
Post kernel execution reduction.
Protected Attributes
-
std::shared_ptr<BufferDeviceHost<T>> buffer#
Friends
- friend class ParticleLoop
-
friend void post_loop(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, Access::Add<GlobalArray<T>*> &arg)#
-
friend GlobalArrayImplGetConstT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<GlobalArray<T>*> &a)#
-
friend GlobalArrayImplGetT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<GlobalArray<T>*> &a)#
-
GlobalArray() = default#
-
class GlobalMove#
- #include <global_move.hpp>
Class to move particles on the global mesh.
Public Functions
-
GlobalMove(const GlobalMove &st) = delete#
Disable (implicit) copies.
-
GlobalMove &operator=(GlobalMove const &a) = delete#
Disable (implicit) copies.
-
inline void free()#
-
inline ~GlobalMove()#
Construct a new global move instance to move particles between the cells of a MeshHierarchy.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
layer_compressor – LayerCompressor to use to compress ParticleDat rows
particle_dats_real – Container of the REAL valued ParticleDats.
particle_dats_int – Container of the INT valued ParticleDats.
Set the ParticleDat to use for MPI ranks.
- Parameters:
mpi_rank_dat – ParticleDat to use for particle positions.
-
inline void move()#
Use the MPI ranks stored in the first component of the MPI rank dat to move particles between the MPI ranks that own cells in a MeshHierarchy. Particles are unpacked into cell 0 of the receiving MPI rank.
Public Members
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
Private Members
-
ParticleDatSharedPtr<INT> mpi_rank_dat#
-
ParticlePacker particle_packer#
-
ParticleUnpacker particle_unpacker#
-
GlobalMoveExchange global_move_exchange#
-
DepartingIdentify departing_identify#
-
LayerCompressor &layer_compressor#
-
BufferDeviceHost<int> dh_send_rank_npart#
-
GlobalMove(const GlobalMove &st) = delete#
-
class GlobalMoveExchange#
- #include <global_move_exchange.hpp>
This class handles the efficient and asynchronous exchange of particle counts and data between MPI ranks when moving particles between cells of the MeshHierarchy.
Public Functions
-
GlobalMoveExchange(const GlobalMoveExchange &st) = delete#
Disable (implicit) copies.
-
GlobalMoveExchange &operator=(GlobalMoveExchange const &a) = delete#
Disable (implicit) copies.
-
inline void free()#
Explicitly free a ParticleGroup without relying on out-of-scope.
-
inline ~GlobalMoveExchange()#
Construct a new instance to exchange particle counts and data.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
-
inline void npart_exchange_init()#
Initialise the start of a new epoch where global communication is identified. Collective on the communicator.
-
inline void npart_exchange_sendrecv(const int num_remote_send_ranks, BufferDeviceHost<int> &dh_send_ranks, BufferHost<int> &h_send_rank_npart)#
Communicate how many ranks will send particles to each rank. Collective on the communicator.
- Parameters:
num_remote_send_ranks – Number of remote ranks particles will be sent to.
dh_send_ranks – Array of remote ranks particles will be sent to.
h_send_rank_npart – Array of particle counts that will be sent to each rank.
-
inline void npart_exchange_finalise()#
Finalise the communication which indicates to remote ranks the number of ranks that will send them particles.
-
inline void exchange_init(ParticlePacker &particle_packer, ParticleUnpacker &particle_unpacker)#
Start the exchange the particle data. Collective on the communicator.
- Parameters:
particle_packer – ParticlePacker instance to pack particle data.
particle_unpacker – ParticleUnpacker instance to use to unpack particle data.
-
inline void exchange_finalise(ParticleUnpacker &particle_unpacker)#
Finalise the exchange the particle data. Collective on the communicator.
- Parameters:
particle_unpacker – ParticleUnpacker instance to use to unpack particle data.
Public Members
-
int num_remote_send_ranks#
Number of remote ranks to send particles to.
-
int num_remote_recv_ranks#
Number of remote ranks to recv particles from.
-
BufferHost<int> h_send_ranks#
Host array of MPI ranks to send particles to.
-
BufferHost<int> h_recv_ranks#
Host array of MPI ranks to recv particles from.
-
BufferHost<int> h_send_rank_npart#
Host array of particle counts for each send rank.
-
BufferHost<int> h_recv_rank_npart#
Host array of particle counts for each recv rank.
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
Private Members
-
MPI_Comm comm#
-
MPI_Win recv_win#
-
int *recv_win_data#
-
MPI_Request mpi_request#
-
BufferHost<MPI_Request> h_send_requests#
-
BufferHost<MPI_Request> h_recv_requests#
-
BufferHost<MPI_Status> h_recv_status#
-
bool recv_win_allocated#
-
GlobalMoveExchange(const GlobalMoveExchange &st) = delete#
-
class H5Part#
- #include <particle_io.hpp>
Public Functions
Construct a H5Part writer for a given set of ParticleDats described by Sym<type>(name) instances. Must be called collectively on the communicator.
- Parameters:
filename – Output filename, e.g. “foo.h5part”.
particle_group – ParticleGroupSharedPtr instance.
args – Remaining arguments (variable length) should be sym instances indicating which ParticleDats are to be written.
-
inline void close()#
Close the H5Part writer. Must be called. Must be called collectively on the communicator.
-
inline void enable_multi_dim_mode()#
Write ParticleDats as 2D arrays in the HDF5 file.
-
class HMesh#
- #include <mesh_interface.hpp>
Abstract base class for mesh types over which a MeshHierarchy is placed.
Subclassed by NESO::Particles::CartesianHMesh, NESO::Particles::LocalDecompositionHMesh
Public Functions
-
inline virtual MPI_Comm get_comm() = 0#
Get the MPI communicator of the mesh.
- Returns:
MPI communicator.
-
inline virtual int get_ndim() = 0#
Get the number of dimensions of the mesh.
- Returns:
Number of mesh dimensions.
-
inline virtual int get_subdivision_order() = 0#
Get the subdivision order of the mesh.
- Returns:
Subdivision order.
-
inline virtual int get_cell_count() = 0#
Get the total number of cells in the mesh.
- Returns:
Total number of mesh cells.
-
inline virtual double get_cell_width_coarse() = 0#
Get the mesh width of the coarse cells in the MeshHierarchy.
- Returns:
MeshHierarchy coarse cell width.
-
inline virtual double get_cell_width_fine() = 0#
Get the mesh width of the fine cells in the MeshHierarchy.
- Returns:
MeshHierarchy fine cell width.
-
inline virtual double get_inverse_cell_width_coarse() = 0#
Get the inverse mesh width of the coarse cells in the MeshHierarchy.
- Returns:
MeshHierarchy inverse coarse cell width.
-
inline virtual double get_inverse_cell_width_fine() = 0#
Get the inverse mesh width of the fine cells in the MeshHierarchy.
- Returns:
MeshHierarchy inverse fine cell width.
-
inline virtual int get_ncells_coarse() = 0#
Get the global number of coarse cells.
- Returns:
Global number of coarse cells.
-
inline virtual int get_ncells_fine() = 0#
Get the number of fine cells per coarse cell.
- Returns:
Number of fine cells per coarse cell.
-
inline virtual std::shared_ptr<MeshHierarchy> get_mesh_hierarchy() = 0#
Get the MeshHierarchy instance placed over the mesh.
- Returns:
MeshHierarchy placed over the mesh.
-
inline virtual void free() = 0#
Free the mesh and associated communicators.
-
inline virtual std::vector<int> &get_local_communication_neighbours() = 0#
Get a std::vector of MPI ranks which should be used to setup local communication patterns.
- Returns:
std::vector of MPI ranks.
-
inline virtual void get_point_in_subdomain(double *point) = 0#
Get a point in the domain that should be in, or at least close to, the sub-domain on this MPI process. Useful for parallel initialisation.
- Parameters:
point – Pointer to array of size equal to at least the number of mesh dimensions.
-
inline virtual MPI_Comm get_comm() = 0#
-
template<typename T>
struct KernelParameter# - #include <particle_loop_base.hpp>
The KernelParameter types define the types passed to the kernel for each data structure type for each access descriptor.
Public Types
-
using type = void#
-
using type = void#
-
template<typename T>
struct KernelParameter<Access::Add<CellDatConst<T>>># - #include <cell_dat_const.hpp>
KernelParameter type for add access to a CellDatConst.
Public Types
-
using type = Access::CellDatConst::Add<T>#
-
using type = Access::CellDatConst::Add<T>#
-
template<typename T>
struct KernelParameter<Access::Add<GlobalArray<T>>># - #include <global_array.hpp>
KernelParameter type for add access to a GlobalArray.
Public Types
-
using type = Access::GlobalArray::Add<T>#
-
using type = Access::GlobalArray::Add<T>#
-
template<typename T>
struct KernelParameter<Access::Add<LocalArray<T>>># - #include <local_array.hpp>
KernelParameter type for add access to a LocalArray.
Public Types
-
using type = Access::LocalArray::Add<T>#
-
using type = Access::LocalArray::Add<T>#
-
template<>
struct KernelParameter<Access::Add<ProductMatrix>># - #include <product_matrix.hpp>
KernelParameter type for add access to a ProductMatrix.
Public Types
-
using type = Access::ProductMatrix::Add#
-
using type = Access::ProductMatrix::Add#
-
template<typename T>
struct KernelParameter<Access::Max<CellDatConst<T>>># - #include <cell_dat_const.hpp>
KernelParameter type for max access to a CellDatConst.
Public Types
-
using type = Access::CellDatConst::Max<T>#
-
using type = Access::CellDatConst::Max<T>#
-
template<typename T>
struct KernelParameter<Access::Min<CellDatConst<T>>># - #include <cell_dat_const.hpp>
KernelParameter type for min access to a CellDatConst.
Public Types
-
using type = Access::CellDatConst::Min<T>#
-
using type = Access::CellDatConst::Min<T>#
-
template<typename T>
struct KernelParameter<Access::Read<CellDatConst<T>>># - #include <cell_dat_const.hpp>
KernelParameter type for read access to a CellDatConst.
Public Types
-
using type = Access::CellDatConst::Read<T>#
-
using type = Access::CellDatConst::Read<T>#
-
template<typename T>
struct KernelParameter<Access::Read<GlobalArray<T>>># - #include <global_array.hpp>
KernelParameter type for read access to a GlobalArray.
Public Types
-
using type = Access::GlobalArray::Read<T>#
-
using type = Access::GlobalArray::Read<T>#
-
template<typename T>
struct KernelParameter<Access::Read<LocalArray<T>>># - #include <local_array.hpp>
KernelParameter type for read access to a LocalArray.
Public Types
-
using type = Access::LocalArray::Read<T>#
-
using type = Access::LocalArray::Read<T>#
-
template<typename T>
struct KernelParameter<Access::Read<ParticleDatT<T>>># - #include <pli_particle_dat.hpp>
KernelParameter type for read-only access to a ParticleDat.
Public Types
-
using type = Access::ParticleDat::Read<T>#
-
using type = Access::ParticleDat::Read<T>#
-
template<>
struct KernelParameter<Access::Read<ParticleLoopIndex>># - #include <particle_loop_index.hpp>
KernelParameter type for read-only access to a ParticleLoopIndex.
-
template<>
struct KernelParameter<Access::Read<ProductMatrix>># - #include <product_matrix.hpp>
KernelParameter type for read access to a ProductMatrix.
Public Types
-
using type = Access::ProductMatrix::Read#
-
using type = Access::ProductMatrix::Read#
-
template<typename T>
struct KernelParameter<Access::Read<Sym<T>>># - #include <pli_particle_dat.hpp>
KernelParameter type for read-only access to a ParticleDat - via Sym.
Public Types
-
using type = Access::ParticleDat::Read<T>#
-
using type = Access::ParticleDat::Read<T>#
-
template<typename T>
struct KernelParameter<Access::Read<SymVector<T>>># - #include <sym_vector.hpp>
KernelParameter type for read-only access to a SymVector.
-
template<>
struct KernelParameter<Access::Write<DescendantProducts>># - #include <descendant_products.hpp>
KernelParameter type for write access to a DescendantProducts.
Public Types
-
using type = Access::DescendantProducts::Write#
-
using type = Access::DescendantProducts::Write#
-
template<typename T>
struct KernelParameter<Access::Write<LocalArray<T>>># - #include <local_array.hpp>
KernelParameter type for write access to a LocalArray.
Public Types
-
using type = Access::LocalArray::Write<T>#
-
using type = Access::LocalArray::Write<T>#
-
template<typename T>
struct KernelParameter<Access::Write<ParticleDatT<T>>># - #include <pli_particle_dat.hpp>
KernelParameter type for write access to a ParticleDat.
Public Types
-
using type = Access::ParticleDat::Write<T>#
-
using type = Access::ParticleDat::Write<T>#
-
template<>
struct KernelParameter<Access::Write<ProductMatrix>># - #include <product_matrix.hpp>
KernelParameter type for write access to a ProductMatrix.
Public Types
-
using type = Access::ProductMatrix::Write#
-
using type = Access::ProductMatrix::Write#
-
template<typename T>
struct KernelParameter<Access::Write<Sym<T>>># - #include <pli_particle_dat.hpp>
KernelParameter type for write access to a ParticleDat - via Sym.
Public Types
-
using type = Access::ParticleDat::Write<T>#
-
using type = Access::ParticleDat::Write<T>#
-
template<typename T>
struct KernelParameter<Access::Write<SymVector<T>>># - #include <sym_vector.hpp>
KernelParameter type for write access to a SymVector.
- #include <particle_loop.hpp>
Catch all for args passed as shared ptrs
Public Types
-
class LayerCompressor#
- #include <cell_dat_compression.hpp>
A LayerCompressor is a tool to remove rows from ParticleDat instances that correspond to particle data where the particle has been removed. Particles are removed when they move between cells and when they are transferred to other MPI ranks. This ensures that particle data is not duplicated and that the particle data is contiguous.
Public Functions
-
LayerCompressor(const LayerCompressor &st) = delete#
Disable (implicit) copies.
-
LayerCompressor &operator=(LayerCompressor const &a) = delete#
Disable (implicit) copies.
-
inline ~LayerCompressor()#
Construct a new layer compressor to compress all ParticleDat instances that are contained within the passed containers.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
ncell – Number of cells within each ParticleDat.
particle_dats_real – Container of ParticleDat instances of REAL type.
particle_dats_int – Container of ParticleDat instances of INT type.
Set the ParticleDat which contains the cell ids of the particles. This is not a function which is expected to be called by a user.
- Parameters:
cell_id_dat – ParticleDat containing particle cell ids.
-
template<typename T>
inline void compute_remove_compress_indicies(const int npart, T *usm_cells, T *usm_layers)# For the specified N particles to remove at the given cells and rows (layers) compute the data migration required to keep the particle data contiguous.
- Parameters:
npart – Number of particles which are to be removed.
usm_cells – Device accessible pointers to an array of length N that holds the cells of the particles that are to be removed.
usm_layers – Device accessible pointers to an array of length N that holds the layers of the particles that are to be removed.
-
template<typename T>
inline void remove_particles(const int npart, T *usm_cells, T *usm_layers)# Remove particles from the ParticleDat instances.
- Parameters:
npart – Number of particles to remove.
usm_cells – Device accessible pointer to the particle cells.
usm_layers – Device accessible pointer to the particle rows (layers).
Private Members
-
SYCLTargetSharedPtr sycl_target#
-
const int ncell#
-
BufferDevice<INT> d_remove_cells#
-
BufferDevice<INT> d_remove_layers#
-
BufferDevice<INT> d_compress_cells_old#
-
BufferDevice<INT> d_compress_cells_new#
-
BufferDevice<INT> d_compress_layers_old#
-
BufferDevice<INT> d_compress_layers_new#
-
BufferDevice<int> d_npart_cell#
-
BufferHost<int> h_npart_cell#
-
BufferDevice<int> d_move_counters#
-
ParticleDatSharedPtr<INT> cell_id_dat#
-
EventStack event_stack#
-
LayerCompressor(const LayerCompressor &st) = delete#
-
template<typename T>
class LocalArray# - #include <local_array.hpp>
Container to hold an array of values on each MPI rank.
Public Functions
-
LocalArray() = default#
-
LocalArray<T> &operator=(const LocalArray<T>&) = default#
Note that the copy operator creates shallow copies of the array.
Create a new LocalArray on a compute target and given size.
- Parameters:
sycl_target – Device to create LocalArray on.
size – Number of elements in array.
Default – value to initialise values to.
-
inline void fill(const T value)#
Fill the array with a value.
- Parameters:
value – Value to fill the array with.
Create a new LocalArray on a compute target and given size.
- Parameters:
sycl_target – Device to create LocalArray on.
data – Vector to initialise array values to.
-
inline sycl::event set_async(const std::vector<T> &data)#
Asynchronously set the values in the local array to those in a std::vector.
- Parameters:
data – Input vector to copy values from.
- Returns:
Event to wait on before using new values in LocalArray.
-
inline void set(const std::vector<T> &data)#
Set the values in the local array to those in a std::vector. Blocks until the copy is complete.
- Parameters:
data – Input vector to copy values from.
-
inline sycl::event get_async(std::vector<T> &data)#
Asynchronously get the values in the local array into a std::vector.
- Parameters:
data – [inout] Input vector to copy values from LocalArray into.
- Returns:
Event to wait on before using new values in the std::vector.
-
inline void get(std::vector<T> &data)#
Get the values in the local array into a std::vector. Blocks until copy is complete.
- Parameters:
data – [inout] Input vector to copy values from LocalArray into.
-
inline std::vector<T> get()#
Get the values in the local array into a std::vector.
- Returns:
std::vector of values in the LocalArray.
-
inline void realloc_no_copy(const size_t size)#
Reallocate the buffer to hold the requested number of elements. Current contents is not copied to the new buffer.
- Parameters:
size – Number of elements this buffer should hold.
Public Members
-
SYCLTargetSharedPtr sycl_target#
The SYCLTarget the LocalArray is created on.
Protected Functions
-
inline LocalArrayImplGetT<T> impl_get()#
Non-const pointer to underlying device data. Intended for friend access from ParticleLoop.
-
inline LocalArrayImplGetConstT<T> impl_get_const()#
Const pointer to underlying device data. Intended for friend access from ParticleLoop.
Protected Attributes
-
std::shared_ptr<BufferDevice<T>> buffer#
Friends
- friend class ParticleLoop
-
friend LocalArrayImplGetConstT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<LocalArray<T>*> &a)#
-
friend LocalArrayImplGetT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<LocalArray<T>*> &a)#
-
friend LocalArrayImplGetT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<LocalArray<T>*> &a)#
-
LocalArray() = default#
-
class LocalDecompositionHMesh : public NESO::Particles::HMesh#
- #include <mesh_interface_local_decomp.hpp>
A simple HMesh type that does not attempt to build any global mapping data structures.
Public Functions
-
inline ~LocalDecompositionHMesh()#
-
inline LocalDecompositionHMesh(const int ndim, std::vector<double> origin, std::vector<double> extents, const int cell_count, MPI_Comm comm = MPI_COMM_WORLD)#
Create a new instance.
- Parameters:
ndim – Number of dimensions.
origin – Origin to use.
extents – Cartesian extents of the domain.
cell_count – Number of cells in the mesh.
comm – MPI communicator to use.
-
inline virtual MPI_Comm get_comm()#
Get the MPI communicator of the mesh.
- Returns:
MPI communicator.
-
inline virtual int get_ndim()#
Get the number of dimensions of the mesh.
- Returns:
Number of mesh dimensions.
-
inline virtual int get_subdivision_order()#
Get the subdivision order of the mesh.
- Returns:
Subdivision order.
-
inline virtual int get_cell_count()#
Get the total number of cells in the mesh on this MPI rank, i.e. the number of Nektar++ elements on this MPI rank.
- Returns:
Total number of mesh cells on this MPI rank.
-
inline virtual double get_cell_width_coarse()#
Get the mesh width of the coarse cells in the MeshHierarchy.
- Returns:
MeshHierarchy coarse cell width.
-
inline virtual double get_cell_width_fine()#
Get the mesh width of the fine cells in the MeshHierarchy.
- Returns:
MeshHierarchy fine cell width.
-
inline virtual double get_inverse_cell_width_coarse()#
Get the inverse mesh width of the coarse cells in the MeshHierarchy.
- Returns:
MeshHierarchy inverse coarse cell width.
-
inline virtual double get_inverse_cell_width_fine()#
Get the inverse mesh width of the fine cells in the MeshHierarchy.
- Returns:
MeshHierarchy inverse fine cell width.
-
inline virtual int get_ncells_coarse()#
Get the global number of coarse cells.
- Returns:
Global number of coarse cells.
-
inline virtual int get_ncells_fine()#
Get the number of fine cells per coarse cell.
- Returns:
Number of fine cells per coarse cell.
-
inline virtual std::shared_ptr<MeshHierarchy> get_mesh_hierarchy()#
Get the MeshHierarchy instance placed over the mesh.
- Returns:
MeshHierarchy placed over the mesh.
-
inline virtual void free()#
Free the mesh and associated communicators.
-
inline virtual std::vector<int> &get_local_communication_neighbours()#
Get a std::vector of MPI ranks which should be used to setup local communication patterns.
- Returns:
std::vector of MPI ranks.
-
inline virtual void get_point_in_subdomain(double *point)#
Get a point in the domain that should be in, or at least close to, the sub-domain on this MPI process. Useful for parallel initialisation.
- Parameters:
point – Pointer to array of size equal to at least the number of mesh dimensions.
Public Members
-
int ndim#
Number of dimensions (physical).
-
int subdivision_order#
Subdivision order of MeshHierarchy.
-
MPI_Comm comm#
MPI Communicator used.
-
std::shared_ptr<MeshHierarchy> mesh_hierarchy#
Underlying MeshHierarchy instance.
-
int cell_count#
Number of cells, i.e. Number of Nektar++ elements on this rank.
-
inline ~LocalDecompositionHMesh()#
-
class LocalMapper#
- #include <local_mapping.hpp>
Abstract class to map positions to owning MPI ranks based on local information, i.e. halo cells. Could also use or set the cell id.
Subclassed by NESO::Particles::CartesianHMeshLocalMapperT, NESO::Particles::DummyLocalMapperT
Public Functions
-
inline virtual void map(ParticleGroup &particle_group, const int map_cell = -1) = 0#
This function maps particle positions to cells on the underlying mesh.
- Parameters:
particle_group – ParticleGroup containing particle positions.
-
inline virtual void particle_group_callback(ParticleGroup &particle_group) = 0#
Callback for ParticleGroup to execute for additional setup of the LocalMapper that may involve the ParticleGroup.
- Parameters:
particle_group – ParticleGroup instance.
-
inline virtual void map(ParticleGroup &particle_group, const int map_cell = -1) = 0#
-
class LocalMove#
- #include <local_move.hpp>
Class to move particles between MPI ranks that are considered neighbours.
Public Functions
-
inline ~LocalMove()#
Construct a new instance to move particles between neighbouring MPI ranks.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
layer_compressor – LayerCompressor instance used to compress ParticleDat instances.
particle_dats_real – Container of REAL valued ParticleDat instances.
particle_dats_int – Container of INT valued ParticleDat instances.
nranks – Number of remote ranks to consider as neighbours that this rank could send to.
ranks – Remote ranks to consider as neighbours that this rank could send to.
Set the ParticleDat to use for MPI ranks.
- Parameters:
mpi_rank_dat – ParticleDat to use for particle positions.
-
inline void npart_exchange_sendrecv()#
Exchange the particle counts that will be send and received between neighbours.
-
inline void exchange_init()#
Start the communication that exchanges particle data between neighbouring ranks.
-
inline void exchange_finalise()#
Wait for the exchange of particle data to complete. Received data is ready to be unpacked on completion.
-
inline void move()#
Top level method that performs all the required steps to transfer particles between neighbouring MPI ranks.
Public Members
-
MPI_Comm comm#
The MPI communicator in use by the instance.
-
int num_remote_send_ranks#
Number of remote ranks this rank could send particles to.
-
int num_remote_recv_ranks#
Number of remote ranks this rank could receive from.
Private Members
-
SYCLTargetSharedPtr sycl_target#
-
ParticleDatSharedPtr<INT> mpi_rank_dat#
-
ParticlePacker particle_packer#
-
ParticleUnpacker particle_unpacker#
-
LayerCompressor &layer_compressor#
-
BufferHost<int> h_send_ranks#
-
BufferHost<int> h_recv_ranks#
-
BufferHost<MPI_Request> h_send_requests#
-
BufferHost<MPI_Request> h_recv_requests#
-
BufferHost<MPI_Status> h_status#
-
BufferDeviceHost<int> dh_send_rank_map#
-
BufferHost<int> h_send_rank_npart#
-
BufferHost<int> h_recv_rank_npart#
-
DepartingIdentify departing_identify#
-
int in_flight_sends#
-
int in_flight_recvs#
-
inline ~LocalMove()#
-
template<typename T>
struct LoopParameter# - #include <particle_loop_base.hpp>
The LoopParameter types define the type collected from a data structure prior to calling the loop. The loop is responsible for computing the kernel argument from the loop argument. e.g. in the ParticleDat case the LoopParameter is the pointer type that points to the data for all cells, layers and components.
Public Types
-
using type = void*#
-
using type = void*#
-
template<typename T>
struct LoopParameter<Access::Add<CellDatConst<T>>># - #include <cell_dat_const.hpp>
Loop parameter for add access of a CellDatConst.
Public Types
-
using type = CellDatConstDeviceType<T>#
-
using type = CellDatConstDeviceType<T>#
-
template<typename T>
struct LoopParameter<Access::Add<GlobalArray<T>>># - #include <global_array.hpp>
Loop parameter for add access of a GlobalArray.
-
template<typename T>
struct LoopParameter<Access::Add<LocalArray<T>>># - #include <local_array.hpp>
Loop parameter for add access of a LocalArray.
-
template<>
struct LoopParameter<Access::Add<ProductMatrix>># - #include <product_matrix.hpp>
Loop parameter for add access of a ProductMatrix.
Public Types
-
using type = ProductMatrixGet#
-
using type = ProductMatrixGet#
-
template<typename T>
struct LoopParameter<Access::Max<CellDatConst<T>>># - #include <cell_dat_const.hpp>
Loop parameter for max access of a CellDatConst.
Public Types
-
using type = CellDatConstDeviceType<T>#
-
using type = CellDatConstDeviceType<T>#
-
template<typename T>
struct LoopParameter<Access::Min<CellDatConst<T>>># - #include <cell_dat_const.hpp>
Loop parameter for min access of a CellDatConst.
Public Types
-
using type = CellDatConstDeviceType<T>#
-
using type = CellDatConstDeviceType<T>#
-
template<typename T>
struct LoopParameter<Access::Read<CellDatConst<T>>># - #include <cell_dat_const.hpp>
Loop parameter for read access of a CellDatConst.
Public Types
-
using type = CellDatConstDeviceTypeConst<T>#
-
using type = CellDatConstDeviceTypeConst<T>#
-
template<typename T>
struct LoopParameter<Access::Read<GlobalArray<T>>># - #include <global_array.hpp>
Loop parameter for read access of a GlobalArray.
-
template<typename T>
struct LoopParameter<Access::Read<LocalArray<T>>># - #include <local_array.hpp>
Loop parameter for read access of a LocalArray.
-
template<typename T>
struct LoopParameter<Access::Read<ParticleDatT<T>>># - #include <pli_particle_dat.hpp>
Loop parameter for read access of a ParticleDat.
-
template<>
struct LoopParameter<Access::Read<ParticleLoopIndex>># - #include <particle_loop_index.hpp>
Loop parameter for read access of a ParticleLoopIndex.
Public Types
-
using type = ParticleLoopIndexKernelT#
-
using type = ParticleLoopIndexKernelT#
-
template<>
struct LoopParameter<Access::Read<ProductMatrix>># - #include <product_matrix.hpp>
Loop parameter for read access of a ProductMatrix.
Public Types
-
using type = ProductMatrixGetConst#
-
using type = ProductMatrixGetConst#
-
template<typename T>
struct LoopParameter<Access::Read<Sym<T>>># - #include <pli_particle_dat.hpp>
Loop parameter for read access of a ParticleDat via Sym.
-
template<typename T>
struct LoopParameter<Access::Read<SymVector<T>>># - #include <sym_vector.hpp>
Loop parameter for read access of a SymVector.
-
template<>
struct LoopParameter<Access::Write<DescendantProducts>># - #include <descendant_products.hpp>
Loop parameter for write access of a DescendantProducts.
Public Types
-
using type = DescendantProductsGet#
-
using type = DescendantProductsGet#
-
template<typename T>
struct LoopParameter<Access::Write<LocalArray<T>>># - #include <local_array.hpp>
Loop parameter for write access of a LocalArray.
-
template<typename T>
struct LoopParameter<Access::Write<ParticleDatT<T>>># - #include <pli_particle_dat.hpp>
Loop parameter for write access of a ParticleDat.
-
template<>
struct LoopParameter<Access::Write<ProductMatrix>># - #include <product_matrix.hpp>
Loop parameter for write access of a ProductMatrix.
Public Types
-
using type = ProductMatrixGet#
-
using type = ProductMatrixGet#
-
template<typename T>
struct LoopParameter<Access::Write<Sym<T>>># - #include <pli_particle_dat.hpp>
Loop parameter for write access of a ParticleDat via Sym.
-
template<typename T>
struct LoopParameter<Access::Write<SymVector<T>>># - #include <sym_vector.hpp>
Loop parameter for write access of a SymVector.
- #include <particle_loop.hpp>
Catch all for args passed as shared ptrs
Public Types
-
template<typename T>
struct Max# - #include <cell_dat_const.hpp>
Access:CellDatConst::Read<T> and Access:CellDatConst::Max<T> are the kernel argument types for accessing CellDatConst data in a kernel.
Public Functions
-
Max() = default#
Pointer to underlying data for the array.
-
Max() = default#
-
template<typename T>
struct Max : public NESO::Particles::Access::AccessGeneric<T># - #include <access_descriptors.hpp>
Atomic max access descriptor.
-
class MeshHierarchy#
- #include <mesh_hierarchy.hpp>
Structure to place a coarse mesh over an arbitrary shaped domain. Each cell in the coarse mesh is a cubes/square that contains a fine mesh also of cubes/squares. Each cell is indexed with a tuple for the coarse mesh and a tuple for the fine mesh in the coarse cell. Each cell in the fine mesh is owned by a unique MPI rank.
This class contains the description of the coarse and fine meshes and the map from fine cells to owning MPI rank. The map is accessible on all MPI ranks and is stored once per MPI shared memory region.
Public Functions
-
MeshHierarchy(const MeshHierarchy &st) = delete#
Disable (implicit) copies.
-
MeshHierarchy &operator=(MeshHierarchy const &a) = delete#
Disable (implicit) copies.
-
inline MeshHierarchy()#
-
inline MeshHierarchy(MPI_Comm comm, const int ndim, std::vector<int> dims, std::vector<double> origin, const double extent = 1.0, const int subdivision_order = 1)#
Create a mesh hierarchy decomposed over the given MPI communicator with a specified number and shape of coarse cells and subdivision order. Must be called collectively on the communicator.
- Parameters:
comm – MPI communicator to use for decomposition.
ndim – Number of dimensions (1,2 or 3).
dims – Number of coarse cells in each dimension.
origin – Origin to use for mesh.
extent – Cell width of a coarse cell in each dimension.
subdivision_order – Number of times to subdivide each coarse cell in each dimension to produce the fine mesh.
-
inline void free()#
Free all data structures associated with this object. Must be called collectively on the communicator.
-
inline INT tuple_to_linear_global(INT *index_tuple)#
Convert a global index represented by a tuple into a linear index. tuple should be: 1D: (coarse_x, fine_x) 2D: (coarse_x, coarse_y, fine_x, fine_y) 3D: (coarse_x, coarse_y, coarse_z, fine_x, fine_y, fine_z)
- Parameters:
index_tuple – Index represented as a tuple.
- Returns:
Linear index.
-
inline INT tuple_to_linear_coarse(INT *index_tuple)#
Convert a coarse mesh index represented by a tuple into a linear index. tuple should be: 1D: (coarse_x) 2D: (coarse_x, coarse_y) 3D: (coarse_x, coarse_y, coarse_z)
- Parameters:
index_tuple – Index represented as a tuple.
- Returns:
Linear index.
-
inline INT tuple_to_linear_fine(INT *index_tuple)#
Convert a fine mesh index represented by a tuple into a linear index. tuple should be: 1D: (fine_x) 2D: (fine_x, fine_y) 3D: (fine_x, fine_y, fine_z)
- Parameters:
index_tuple – Index represented as a tuple.
- Returns:
Linear index.
-
inline void linear_to_tuple_global(INT linear, INT *index)#
Convert a global mesh linear index into a tuple index. tuple should be: 1D: (coarse_x, fine_x) 2D: (coarse_x, coarse_y, fine_x, fine_y) 3D: (coarse_x, coarse_y, coarse_z, fine_x, fine_y, fine_z)
- Parameters:
linear – Linear index to convert.
index – Output, index represented as a tuple.
-
inline void linear_to_tuple_coarse(INT linear, INT *index)#
Convert a coarse mesh linear index into a tuple index. tuple should be: 1D: (coarse_x,) 2D: (coarse_x, coarse_y) 3D: (coarse_x, coarse_y, coarse_z,)
- Parameters:
linear – Linear index to convert.
index – Output, index represented as a tuple.
-
inline void linear_to_tuple_fine(INT linear, INT *index)#
Convert a fine mesh linear index into a tuple index. tuple should be: 1D: (fine_x,) 2D: (fine_x, fine_y) 3D: (fine_x, fine_y, fine_z)
- Parameters:
linear – Linear index to convert.
index – Output, index represented as a tuple.
-
inline void claim_initialise()#
Mark the start of an epoch where ranks claim global cells. Collective on communicator.
-
inline void claim_cell(const INT index, int weight)#
Claim a cell in the MeshHierarchy with a certain weight. The rank that claims with the highest weight owns the cell. In the case of weight contention the highest rank is given the cell. Weights should be an integer in the range ‘[1, int_max-1]’. Claim with the highest weight will be assigned the cell.
- Parameters:
index – Global linear index to cell to claim.
weight – Weight to claim the cell with.
-
inline void claim_finalise()#
Mark the end of an epoch where ranks claim global cells. Collective on communicator.
Public Members
-
MPI_Comm comm#
MPI communicator on which this mesh is decomposed.
-
int ndim#
Number of mesh dimensions (1,2 or 3).
-
int subdivision_order#
The fine mesh cells have width
cell_width_coarse / 2^p
for subdivision order p.
-
double cell_width_coarse#
Cell width of the coarse cells.
-
double cell_width_fine#
Cell width of the fine cells.
-
double inverse_cell_width_coarse#
1/cell_width_coarse
.
-
double inverse_cell_width_fine#
1/cell_width_fine
.
Private Functions
-
inline void all_reduce_max_map()#
-
MeshHierarchy(const MeshHierarchy &st) = delete#
-
struct MeshHierarchyDeviceMapper#
- #include <mesh_hierarchy.hpp>
A struct to aid binning points into MeshHierarchy cells. This type is device copyable such that points can be easilly binned into cells on the device.
Public Functions
-
inline void map_to_tuple(const REAL *position, INT *cell) const#
For an input point find the MeshHierarchy cell that contains the point in tuple form. Output tuple should be: 1D: (coarse_x, fine_x) 2D: (coarse_x, coarse_y, fine_x, fine_y) 3D: (coarse_x, coarse_y, coarse_z, fine_x, fine_y, fine_z)
- Parameters:
position – [in] Input position.
cell – [out] Ouput, index represented as a tuple.
-
inline void map_tuple_to_cart_tuple(const INT *mh_tuple, INT *cart_tuple) const#
For an input MeshHierarchy tuple output the tuple which would index into a standard Cartesian mesh of the same structure. Input tuple should be: 1D: (coarse_x, fine_x) 2D: (coarse_x, coarse_y, fine_x, fine_y) 3D: (coarse_x, coarse_y, coarse_z, fine_x, fine_y, fine_z)
- Parameters:
mh_tuple – [in] Input tuple in global MeshHierarchy form.
cart_tuple – [out] N dimensional tuple which indexes into the Cartesian mesh view of the MeshHierarchy.
-
inline void map_to_cart_tuple_no_trunc(const REAL *position, INT *cell) const#
Map position into the cartesian grid. Do not attempt to trucate the position into the mesh.
- Parameters:
position – [in] Input position to map into the Cartesian view of the MeshHierarchy.
cell – [inout] N dimensional tuple that maps into the Cartesian view of the MeshHierarchy.
-
inline void cart_tuple_to_tuple(const INT *cart_tuple, INT *mh_tuple) const#
Convert a Cartesian tuple index into a MeshHierarchy global tuple index.
- Parameters:
cart_tuple – [in] Cartesian tuple to convert.
mh_tuple – [inout] MeshHierarchy global tuple representation of input tuple.
-
inline INT tuple_to_linear_global(INT *index_tuple) const#
Convert a global index represented by a tuple into a linear index. tuple should be: 1D: (coarse_x, fine_x) 2D: (coarse_x, coarse_y, fine_x, fine_y) 3D: (coarse_x, coarse_y, coarse_z, fine_x, fine_y, fine_z)
- Parameters:
index_tuple – Index represented as a tuple.
- Returns:
Linear index.
-
inline INT tuple_to_linear_coarse(INT *index_tuple) const#
Convert a coarse mesh index represented by a tuple into a linear index. tuple should be: 1D: (coarse_x) 2D: (coarse_x, coarse_y) 3D: (coarse_x, coarse_y, coarse_z)
- Parameters:
index_tuple – Index represented as a tuple.
- Returns:
Linear index.
Public Members
-
inline void map_to_tuple(const REAL *position, INT *cell) const#
-
class MeshHierarchyGlobalMap#
- #include <global_mapping.hpp>
This class maps global positions into the cells of a HMesh and determines which MPI rank owns that cell.
Public Functions
-
MeshHierarchyGlobalMap(const MeshHierarchyGlobalMap &st) = delete#
Disable (implicit) copies.
-
MeshHierarchyGlobalMap &operator=(MeshHierarchyGlobalMap const &a) = delete#
Disable (implicit) copies.
-
inline ~MeshHierarchyGlobalMap()#
Construct a new global mapping instance for MeshHierarchy.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
h_mesh – HMesh derived mesh to use for mapping.
position_dat – ParticleDat containing particle positions.
cell_id_dat – ParticleDat containg particle cell ids.
mpi_rank_dat – ParticleDat containing the owning rank of particles.
-
inline void execute()#
For each particle that does not have a non-negative MPI rank determined as a local owner obtain the MPI rank that owns the global cell which contains the particle.
Private Members
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
-
HMeshSharedPtr h_mesh#
HMesh instance on which particles live.
-
ParticleDatSharedPtr<REAL> &position_dat#
ParticleDat storing Positions.
-
ParticleDatSharedPtr<INT> &cell_id_dat#
ParticleDat storing cell ids.
-
ParticleDatSharedPtr<INT> &mpi_rank_dat#
ParticleDat storing MPI rank.
-
BufferHost<int> h_lookup_count#
Host buffer containing the number of particles to query owning MPI rank.
-
BufferDevice<int> d_lookup_count#
Device buffer containing the number of particles to query owning MPI rank.
-
BufferHost<INT> h_lookup_global_cells#
Host buffer of global cells on HMesh to query owner of.
-
BufferDevice<INT> d_lookup_global_cells#
Device buffer of global cells on HMesh to query owner of.
-
BufferHost<int> h_lookup_ranks#
Space to store the ranks owning the lookup cells on the host.
-
BufferDevice<int> d_lookup_ranks#
Space to store the ranks owning the lookup cells on the Device.
-
BufferDevice<int> d_lookup_local_cells#
Cells of the particles for which the lookup is being performed.
-
BufferDevice<int> d_lookup_local_layers#
Layers of the particles for which the lookup is being performed.
-
BufferHost<REAL> h_origin#
Host buffer holding the origin of MeshHierarchy.
-
BufferDevice<REAL> d_origin#
Device buffer holding the origin of MeshHierarchy.
-
BufferHost<int> h_dims#
Host buffer containing the dims of MeshHierarchy.
-
BufferDevice<int> d_dims#
Device buffer containing the dims of MeshHierarchy.
-
ErrorPropagate error_propagate#
ErrorPropagate for detecting errors in kernels.
-
MeshHierarchyGlobalMap(const MeshHierarchyGlobalMap &st) = delete#
-
class MeshHierarchyMapper#
- #include <mesh_hierarchy.hpp>
A class to provide methods to bin points into MeshHierarchy cells and transform between representations of MeshHierarchy indexing.
Public Functions
Create new instance of helper mapper class.
- Parameters:
sycl_target – [in] The compute device to provide device copyable mapper structs for.
mesh_hierarchy – [in] The MeshHierarchy for which to create a mapper class for.
-
inline MeshHierarchyDeviceMapper get_device_mapper()#
Get a device copyable struct with device callable methods for interfacing with a MeshHierarchy.
- Returns:
New mapper struct.
-
inline MeshHierarchyDeviceMapper get_host_mapper()#
Get a host struct with methods to interface with a MeshHierarchy instance.
- Returns:
New mapper struct.
Private Functions
-
inline MeshHierarchyDeviceMapper get_generic_mapper()#
Private Members
-
std::shared_ptr<BufferDeviceHost<REAL>> dh_origin#
-
std::shared_ptr<BufferDeviceHost<INT>> dh_dims#
-
std::shared_ptr<MeshHierarchy> mesh_hierarchy#
-
template<typename T>
struct Min# - #include <cell_dat_const.hpp>
Access:CellDatConst::Read<T> and Access:CellDatConst::Min<T> are the kernel argument types for accessing CellDatConst data in a kernel.
Public Functions
-
Min() = default#
Pointer to underlying data for the array.
-
Min() = default#
-
template<typename T>
struct Min : public NESO::Particles::Access::AccessGeneric<T># - #include <access_descriptors.hpp>
Atomic min access descriptor.
-
struct NDRangePeel1D#
- #include <compute_target.hpp>
Main loop with peel loop for 1D nd_range. The peel loop should be masked to remove the workitems past the loop extents.
Public Members
-
sycl::nd_range<1> loop_main#
The main iteration set which does not need masking.
-
const bool peel_exists#
Bool to indicate if there is a peel loop.
-
const size_t offset#
Offset to apply to peel loop indices.
-
sycl::nd_range<1> loop_peel#
Peel loop description. Indicies from the loop should have offset added to compute the global index. This loop should be masked by a conditional for the original loop bounds.
-
sycl::nd_range<1> loop_main#
-
template<typename T>
class ParticleDatT# - #include <particle_dat.hpp>
Wrapper around a CellDat to store particle data on a per cell basis.
Public Functions
-
ParticleDatT(const ParticleDatT &st) = delete#
Disable (implicit) copies.
-
ParticleDatT &operator=(ParticleDatT const &a) = delete#
Disable (implicit) copies.
Create a new ParticleDat.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
sym – Sym object that defines the type and label.
ncomp – Number of components, of type defined in
sym
.ncell – Number of cells this ParticleDat is defined over.
positions – Does this Dat hold particle positions or cell ids.
-
inline void npart_host_to_device()#
Copy cell particle counts from host buffer to device buffer.
-
inline sycl::event async_npart_host_to_device()#
Asynchronously copy cell particle counts from host buffer to device buffer.
- Returns:
sycl::event for copy operation.
-
inline void npart_device_to_host()#
Copy cell particle counts from device buffer to host buffer.
-
inline sycl::event async_npart_device_to_host()#
Asynchronously copy cell particle counts from device buffer to host buffer.
- Returns:
sycl::event for copy operation.
-
inline ~ParticleDatT()#
-
inline void append_particle_data(const int npart_new, const bool new_data_exists, std::vector<INT> &cells, std::vector<INT> &layers, std::vector<T> &data, EventStack &es)#
Add particle data to the ParticleDat.
- Parameters:
npart_new – Number of new particles to add.
new_data_exists – Indicate if there is new data to copy of if the data should be initialised with zeros.
cells – Cell indices of the new particles.
layers – Layer (row) indices of the new particles.
data – Particle data to copy into the ParticleDat.
es – EventStack to push events onto.
-
inline void realloc(std::vector<INT> &npart_cell_new)#
Realloc the underlying CellDat such that the indicated new number of particles can be stored.
- Parameters:
npart_cell_new – Particle counts for each cell.
Realloc the underlying CellDat such that the indicated new number of particles can be stored.
- Parameters:
npart_cell_new – Particle counts for each cell.
-
template<typename U>
inline void realloc(BufferHost<U> &npart_cell_new)# Realloc the underlying CellDat such that the indicated new number of particles can be stored.
- Parameters:
npart_cell_new – Particle counts for each cell.
-
inline void realloc(const int cell, const int npart_cell_new)#
Realloc the underlying CellDat such that the indicated new number of particles can be stored for a particular cell.
- Parameters:
cell – Cell index to reallocate.
npart_cell_new – Particle counts for the cell.
-
inline sycl::event copy_particle_data(const int npart, const INT *d_cells_old, const INT *d_cells_new, const INT *d_layers_old, const INT *d_layers_new)#
Asynchronously copy particle data from old cells/layers to new cells/layers.
- Parameters:
npart – Number of particles to copy.
d_cells_old – Device pointer to an array of old cells.
d_cells_new – Device pointer to an array of new cells.
d_layers_old – Device pointer to an array of old layers.
d_layers_new – Device pointer to an array of new layers.
- Returns:
sycl::event to wait on for data copy.
-
inline INT get_npart_local()#
Get the number of particles stored in all cells
- Returns:
Total number of stored particles.
-
template<typename U>
inline sycl::event set_npart_cells_device(const U *d_npart_cell_in)# Async call to set d_npart_cells from a device buffer. npart_device_to_host must be called on event completion.
- Parameters:
d_npart_cell_in – Device accessible pointer to an array containing new cell counts.
- Returns:
sycl::event to wait on for completion.
-
template<typename U>
inline void set_npart_cells_host(const U *h_npart_cell_in)# Set cell particle counts from host accessible pointer. npart_host_to_device must be called to set counts on the device.
- Parameters:
h_npart_cell_in – Host pointer to cell particle counts.
-
inline void set_npart_cell(const INT cell, const int npart)#
Set the particle count in a single cell. Assigns on both host and device.
- Parameters:
cell – Cell to set particle count for.
npart – New particle count for cell.
-
inline void set_npart_cells(std::vector<INT> &npart)#
Set particle counts in cells from std::vector. Sets on both host and device.
- Parameters:
npart – std::vector of new particle counts per cell.
-
template<typename U>
inline void set_npart_cells(const BufferHost<U> &h_npart_cell_in)# Set the particle counts in cells from a BufferHost. Sets on both host and device.
- Parameters:
h_npart_cell_in – New particle counts per cell.
-
template<typename U>
inline sycl::event async_set_npart_cells(const BufferHost<U> &h_npart_cell_in)# Asynchronously set the particle counts in cells from a BufferHost. Sets on both host and device.
- Parameters:
h_npart_cell_in – New particle counts per cell.
- Returns:
sycl::event to wait on for device assignment.
-
inline void trim_cell_dat_rows()#
Reduce the row count of the underlying CellDat to the per cell particle occupancies.
-
inline void print(const int start = 0, int end = -1)#
Utility function to print the contents of all or a select range of cells.
- Parameters:
start – Optional first cell to start printing from.
end – Optional end cell +1 to end printing at.
-
inline INT get_npart_upper_bound()#
Get an upper bound for the number of particles. May be a very bad approximation.
- Returns:
Upper bound for number of particles.
-
inline INT get_particle_loop_iter_range()#
Get the size of the iteration set required to loop over all particles with the particle loop macros.
- Returns:
Particle Loop iteration set size.
-
inline INT get_particle_loop_cell_stride()#
Get the size of the iteration set per cell stride required to loop over all particles with the particle loop macros.
- Returns:
Particle Loop iteration stride size.
-
inline int *get_particle_loop_npart_cell()#
Get a device pointer to the array that stores particle counts per cell for the particle loop macros.
- Returns:
Device pointer to particle counts per cell.
-
inline void wait_realloc()#
Wait for a realloc to complete.
Public Members
-
int *d_npart_cell#
Device only accessible array of the particle counts per cell.
-
int *h_npart_cell#
Host only accessible array of particle counts per cell.
-
const int ncell#
Number of cells this ParticleDat is defined on.
-
const bool positions#
Flat to indicate if this ParticleDat is to hold particle positions or.
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
Protected Functions
-
inline void write_callback_wrapper(const int mode)#
-
inline ParticleDatImplGetT<T> impl_get()#
Non-const pointer to underlying device data. Intended for friend access from ParticleLoop. These pointers must not be cached then used later without recalling this function.
-
inline ParticleDatImplGetConstT<T> impl_get_const()#
Const pointer to underlying device data. Intended for friend access from ParticleLoop. These pointers must not be cached then used later without recalling this function.
Protected Attributes
-
INT *d_npart_cell_es#
Pointer to the inclusive sum of cell occupancies computed by the ParticleGroup
Friends
- friend class ParticleLoop
- friend class SymVector< T >
- friend class ParticleGroup
- friend class MeshHierarchyGlobalMap
- friend class CellMove
- friend class LayerCompressor
- friend class ParticlePacker
- friend class ParticleUnpacker
-
friend ParticleDatImplGetConstT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<Sym<T>*> &a)#
-
friend ParticleDatImplGetT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<Sym<T>*> &a)#
-
friend ParticleDatImplGetConstT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<ParticleDatT<T>*> &a)#
-
friend ParticleDatImplGetT<T> create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<ParticleDatT<T>*> &a)#
-
ParticleDatT(const ParticleDatT &st) = delete#
-
struct ParticleDatVersionT#
- #include <particle_group.hpp>
Type to replace std::variant<Sym<INT>, Sym<REAL>> as the version tracking key as this has been causing segfaults.
Public Functions
-
inline ParticleDatVersionT()#
-
ParticleDatVersionT &operator=(const ParticleDatVersionT&) = default#
-
inline ParticleDatVersionT &operator=(const Sym<INT> &s)#
-
inline ParticleDatVersionT &operator=(const Sym<REAL> &s)#
-
inline bool operator<(const ParticleDatVersionT &v) const#
-
inline ParticleDatVersionT()#
-
class ParticleGroup#
- #include <particle_group.hpp>
Fundamentally a ParticleGroup is a collection of ParticleDats, domain and a compute device.
Public Functions
-
ParticleGroup(const ParticleGroup &st) = delete#
Disable (implicit) copies.
-
ParticleGroup &operator=(ParticleGroup const &a) = delete#
Disable (implicit) copies.
-
inline void free()#
Explicitly free a ParticleGroup without relying on out-of-scope.
Construct a new ParticleGroup.
- Parameters:
domain – Domain instance containing these particles.
particle_spec – ParticleSpec that describes the ParticleDat instances required.
sycl_target – SYCLTargetSharedPtr to use as compute device.
-
inline ~ParticleGroup()#
Add a ParticleDat to the ParticleGroup after construction.
- Parameters:
particle_dat – New ParticleDat to add.
Add a ParticleDat to the ParticleGroup after construction.
- Parameters:
particle_dat – New ParticleDat to add.
-
inline void add_particles()#
Add particles to the ParticleGroup. Any rank may add particles that exist anywhere in the domain. This call is collective across the ParticleGroup and ranks that do not add particles should not pass any new particle data.
-
template<typename U>
inline void add_particles(U particle_data)# Add particles to the ParticleGroup. Any rank may add particles that exist anywhere in the domain. This call is collective across the ParticleGroup and ranks that do not add particles should not pass any new particle data.
- Parameters:
particle_data – New particle data to add to the ParticleGroup.
-
inline void add_particles_local(ParticleSet &particle_data)#
Add particles only to this MPI rank. It is assumed that the added particles are in the domain region owned by this MPI rank. If not, see
ParticleGroup::add_particles
.- Parameters:
particle_data – New particles to add.
Add particles only to this MPI rank. It is assumed that the added particles are in the domain region owned by this MPI rank. If not, see
ParticleGroup::add_particles
.- Parameters:
particle_data – New particles to add.
Add particles only to this MPI rank. It is assumed that the added particles are in the domain region owned by this MPI rank. If not, see
ParticleGroup::add_particles
. Particle properties which exist on the ParticleGroup and not in the ProductMatrix will be zero initialised. Particle properties which exist on the ProductMatrix and not in the ParticleGroup will be ignored.- Parameters:
product_matrix – New particles to add.
Add new particles to this ParticleGroup via a DescendantProducts instance. If no alternative source ParticleGroup is provided then properties are either defined in the DescendantProducts, from which they are copied, or if the property is not defined in the DescendantProducts then the property values are copied from the parent particle.
When a source ParticleGroup is provided: Properties which are defined in the DescendantProducts are copied from the DescendantProducts. If a property is defined in the source ParticleGroup and not in this ParticleGroup then it is ignored. If a property is defined in this ParticleGroup and not in the source ParticleGroup then the values are zero initialised. Properties not defined in the DescendantProducts which exist as particle properties in both the source ParticleGroup and this ParticleGroup are copied from the parent particles. When the source ParticleGroup is specified the parent indices in DescendantProducts always refer to particles in the parent ParticleGroup.
- Parameters:
descendant_products – New particles to add.
source_particleGroup – Alternative ParticleGroup to use as the set of parent particles. The descendant_products parent indices must have been created with this ParticleGroup. By default no alternative ParticleGroup is specified and the parents are assumed to be in the ParticleGroup on which add_particles_local was called.
Add particles to this ParticleGroup from another ParticleGroup. Properties which exist in the destination ParticleGroup and not the source ParticleGroup are zero initialised. Properties which exist in both ParticleGroups are copied. Properties which only exist in the source ParticleGroup are ignored.
Particle properties will be copied cell-wise from the source to destination ParticleGroups. This cell-wise copy requires that the source and destination domains share the same number of cells on each MPI rank.
- Parameters:
particle_group – New particles to add.
Add particles to this ParticleGroup from another ParticleGroup. Properties which exist in the destination ParticleGroup and not the source ParticleGroup are zero initialised. Properties which exist in both ParticleGroups are copied. Properties which only exist in the source ParticleGroup are ignored.
Particle properties will be copied cell-wise from the source to destination ParticleGroups. This cell-wise copy requires that the source and destination domains share the same number of cells on each MPI rank.
- Parameters:
particle_sub_group – New particles to add.
-
inline int get_npart_local()#
Get the total number of particles on this MPI rank.
- Returns:
Local particle count.
-
inline bool contains_dat(Sym<REAL> sym)#
Determine if the ParticleGroup contains a ParticleDat of a given name.
- Parameters:
sym – Symbol of ParticleDat.
- Returns:
True if ParticleDat exists on this ParticleGroup.
-
inline bool contains_dat(Sym<INT> sym)#
Determine if the ParticleGroup contains a ParticleDat of a given name.
- Parameters:
sym – Symbol of ParticleDat.
- Returns:
True if ParticleDat exists on this ParticleGroup.
Template for get_dat method called like: ParticleGroup::get_dat(Sym<REAL>(“POS”)) for a real valued ParticleDat.
- Parameters:
name – Name of ParticleDat.
check_exists – Check if the dat exists, default true.
- Returns:
ParticleDatSharedPtr<T> particle dat.
-
inline ParticleDatSharedPtr<REAL> &operator[](Sym<REAL> sym)#
Users are recomended to use “get_dat” instead. Enables access to the ParticleDat instances using the subscript operators.
- Parameters:
sym – Sym<REAL> of ParticleDat to access.
-
inline ParticleDatSharedPtr<INT> &operator[](Sym<INT> sym)#
Users are recomended to use “get_dat” instead. Enables access to the ParticleDat instances using the subscript operators.
- Parameters:
sym – Sym<INT> of ParticleDat to access.
-
inline CellData<REAL> get_cell(Sym<REAL> sym, const int cell)#
Get a CellData instance that holds all the particle data for a ParticleDat for a cell.
- Parameters:
sym – Sym<REAL> indicating which ParticleDat to access.
cell – Cell index to access.
- Returns:
CellData for requested cell.
-
inline CellData<INT> get_cell(Sym<INT> sym, const int cell)#
Get a CellData instance that holds all the particle data for a ParticleDat for a cell.
- Parameters:
sym – Sym<INT> indicating which ParticleDat to access.
cell – Cell index to access.
- Returns:
CellData for requested cell.
-
inline void clear()#
Clear all particles from the ParticleGroup on the calling MPI rank.
-
inline void remove_particles(const int npart, const std::vector<INT> &cells, const std::vector<INT> &layers)#
Remove particles from the ParticleGroup.
- Parameters:
npart – Number of particles to remove.
cells – Vector of particle cells.
layers – Vector of particle layers(rows).
-
template<typename T>
inline void remove_particles(const int npart, T *usm_cells, T *usm_layers)# Remove particles from the ParticleGroup.
- Parameters:
npart – Number of particles to remove.
usm_cells – Device accessible array of particle cells.
usm_layers – Device accessible array of particle layers(rows).
Remove all the particles particles from the ParticleGroup which are members of a ParticleSubGroup.
- Parameters:
particle_sub_group. –
-
inline INT get_npart_cell(const int cell)#
Get the number of particles in a cell.
- Parameters:
cell – Cell to query.
- Returns:
Number of particles in queried cell.
-
inline ParticleSpec &get_particle_spec()#
Get the ParticleSpec of the ParticleDats stored in this ParticleGroup.
- Returns:
ParticleSpec of stored particles.
-
inline void global_move()#
Use the MPI ranks in the first component of the MPI rank dat to move particles globally using the MeshHierarchy of the mesh in the domain.
Must be called collectively on the ParticleGroup.
-
inline void local_move()#
Use the MPI ranks in the second component of the MPI rank dat to move particles to neighbouring ranks using the neighbouring ranks defined on the mesh.
Must be called collectively on the ParticleGroup.
-
inline void hybrid_move()#
Perform a global move using non-negative MPI ranks in the first component of the MPI rank dat. Then bin moved particles into local cells to obtain any required ranks for the local move. Second perform a local move to move particles based on the MPI rank stored in the second component of the MPI rank dat.
Must be called collectively on the ParticleGroup.
-
inline size_t particle_size()#
Number of bytes required to store the data for one particle.
- Returns:
Number of bytes required to store one particle.
-
inline void cell_move()#
Move particles between cells using the cell ids stored in the cell id dat.
-
inline void set_npart_cell_from_dat()#
Copy the particle counts per cell from the position ParticleDat to the npart cell array of the ParticleGroup.
-
template<typename ...T>
inline void print(T... args)# Print particle data for all particles for the specified ParticleDats. Empty cells are not printed.
-
inline void remove_particle_dat(Sym<REAL> sym)#
Remove a ParticleDat from the ParticleGroup
- Parameters:
sym – Sym object that refers to a ParticleDat
-
inline void remove_particle_dat(Sym<INT> sym)#
Remove a ParticleDat from the ParticleGroup
- Parameters:
sym – Sym object that refers to a ParticleDat
-
inline ParticleSetSharedPtr get_particles(std::vector<INT> &cells, std::vector<INT> &layers)#
Create a ParticleSet containing the data from particles held in the ParticleGroup. e.g. to Extract the first two particles from the second cell:
cells = [1, 1] layers = [0, 1]
- Parameters:
cells – Vector of cell indices of particles to extract.
cells – Vector of layer indices of particles to extract.
- Returns:
ParticleSet of particle data.
Public Members
-
DomainSharedPtr domain#
Domain this instance is defined over.
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
-
std::map<Sym<REAL>, ParticleDatSharedPtr<REAL>> particle_dats_real = {}#
Map from Sym instances to REAL valued ParticleDat instances.
-
std::map<Sym<INT>, ParticleDatSharedPtr<INT>> particle_dats_int = {}#
Map from Sym instances to INT valued ParticleDat instances.
-
ParticleDatSharedPtr<REAL> position_dat#
ParticleDat storing particle positions.
-
ParticleDatSharedPtr<INT> cell_id_dat#
ParticleDat storing particle cell ids.
-
ParticleDatSharedPtr<INT> mpi_rank_dat#
ParticleDat storing particle MPI ranks.
-
ParticleSpec particle_spec#
ParticleSpec of all the ParticleDats of this ParticleGroup.
-
LayerCompressor layer_compressor#
Layer compression instance for dats when particles are removed from cells.
Protected Types
-
typedef ParticleDatVersionT ParticleDatVersion#
-
typedef std::map<ParticleDatVersion, int64_t> ParticleDatVersionTracker#
Protected Functions
-
inline void realloc_all_dats()#
-
inline void check_dats_and_group_agree()#
-
template<typename T>
inline void push_particle_spec(ParticleProp<T> prop)#
-
inline void invalidate_callback_inner(ParticleDatVersion sym, const int mode)#
-
inline bool check_validation(ParticleDatVersionTracker &to_check, const bool update_to_check = true)#
Returns true if the passed version is behind and can be updated. By default updates the passed version.
-
inline void recompute_npart_cell_es()#
Protected Attributes
-
int ncell#
-
int npart_local#
-
BufferHost<INT> h_npart_cell#
-
BufferDevice<INT> d_npart_cell#
-
BufferDevice<INT> d_remove_cells#
-
BufferDevice<INT> d_remove_layers#
-
GlobalMove global_move_ctx#
-
std::shared_ptr<MeshHierarchyGlobalMap> mesh_hierarchy_global_map#
-
std::map<ParticleDatVersion, std::tuple<int64_t, bool>> particle_dat_versions#
-
std::shared_ptr<BufferDeviceHost<INT>> dh_npart_cell_es#
BufferDeviceHost holding the exclusive sum of the number of particles in each cell.
-
std::shared_ptr<BufferDevice<int>> d_sub_group_layers#
The sub group creation requires get_npart_local temporary space and we create this space here on the parent subgroup such that it is shared across all subgroups to avoid exessive memory usage/realloc
Friends
- friend class ParticleSubGroupImplementation::SubGroupSelector
- friend class ParticleSubGroup
-
ParticleGroup(const ParticleGroup &st) = delete#
-
template<typename KERNEL, typename ...ARGS>
class ParticleLoop : public NESO::Particles::ParticleLoopBase# - #include <particle_loop.hpp>
ParticleLoop loop type. The particle loop applies the given kernel to all particles in a ParticleGroup. The kernel must be independent of the execution order (i.e. parallel and unsequenced in C++ terminology).
Public Functions
-
ParticleLoop(const ParticleLoop &st) = delete#
Disable (implicit) copies.
-
ParticleLoop &operator=(ParticleLoop const &a) = delete#
Disable (implicit) copies.
Create a ParticleLoop that executes a kernel for all particles in the ParticleGroup.
- Parameters:
name – Identifier for particle loop.
particle_group – ParticleGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleGroup.
- Parameters:
particle_group – ParticleGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleDat.
- Parameters:
name – Identifier for particle loop.
particle_dat – ParticleDat to define the iteration set.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleDat.
- Parameters:
particle_dat – ParticleDat to define the iteration set.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
-
inline virtual void submit(const std::optional<int> cell = std::nullopt)#
Launch the ParticleLoop and return. Must be called collectively over the MPI communicator of the ParticleGroup. Loop execution is complete when the corresponding call to wait returns.
- Parameters:
cell – Optional cell index to only launch the ParticleLoop over.
-
inline virtual void wait()#
Wait for loop execution to complete. On completion perform post-loop actions. Must be called collectively on communicator.
-
inline virtual void execute(const std::optional<int> cell = std::nullopt)#
Execute the ParticleLoop and block until execution is complete. Must be called collectively on the MPI communicator associated with the SYCLTarget this loop is over.
- Parameters:
cell – Optional cell to launch the ParticleLoop over.
Protected Types
Protected Functions
-
template<size_t INDEX, typename U>
inline void unpack_args(U a0)# Recursively assemble the tuple args.
-
template<size_t INDEX, size_t SIZE, typename PARAM>
inline void create_loop_args_inner(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, PARAM &loop_args)# Recursively assemble the outer loop arguments.
-
inline void create_loop_args(sycl::handler &cgh, loop_parameter_type &loop_args, ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info)#
-
inline virtual int get_loop_type_int()#
-
inline ParticleLoopImplementation::ParticleLoopGlobalInfo create_global_info()#
Protected Attributes
-
std::tuple<ARGS...> args#
Tuple of the arguments passed to the ParticleLoop on construction.
-
ParticleGroupSharedPtr particle_group_shrptr#
-
ParticleGroup *particle_group_ptr = {nullptr}#
-
SYCLTargetSharedPtr sycl_target#
-
std::shared_ptr<void> particle_dat_init#
This stores the particle dat the loop was created with to prevent use after free errors in the case when the ParticleLoop is created with a ParticleDat.
-
std::unique_ptr<ParticleLoopImplementation::ParticleLoopIterationSet> iteration_set#
-
EventStack event_stack#
-
bool loop_running = {false}#
-
int *d_npart_cell#
-
int *h_npart_cell_lb#
-
int *d_npart_cell_lb#
-
int ncell#
-
size_t local_size#
Protected Static Functions
Method to compute access to a type wrapped in a shared_ptr.
-
template<template<typename> typename T, typename U>
static inline auto create_loop_arg_cast(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, T<U> a)# Method to compute access to a type not wrapper in a shared_ptr
Method to compute access to a type wrapped in a shared_ptr.
-
template<template<typename> typename T, typename U>
static inline auto post_loop_cast(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, T<U> a)# Method to compute access to a type not wrapper in a shared_ptr
-
template<size_t INDEX, size_t SIZE>
static inline constexpr void create_kernel_args_inner(ParticleLoopImplementation::ParticleLoopIteration &iterationx, const loop_parameter_type &loop_args, kernel_parameter_type &kernel_args)# recusively assemble the kernel arguments from the loop arguments
-
static inline constexpr void create_kernel_args(ParticleLoopImplementation::ParticleLoopIteration &iterationx, const loop_parameter_type &loop_args, kernel_parameter_type &kernel_args)#
called before kernel execution to assemble the kernel arguments.
-
ParticleLoop(const ParticleLoop &st) = delete#
-
class ParticleLoopBase#
- #include <particle_loop_base.hpp>
Abstract base class for ParticleLoop such that the templated ParticleLoop can be cast to a base type for storage.
Subclassed by NESO::Particles::ParticleLoop< KERNEL, ARGS… >, NESO::Particles::ParticleLoop< KERNEL, ARGS >
Public Functions
-
inline virtual void execute(const std::optional<int> cell = std::nullopt) = 0#
Execute the particle loop and block until completion. Must be called Collectively on the communicator.
-
inline virtual void submit(const std::optional<int> cell = std::nullopt) = 0#
Launch the ParticleLoop and return. Must be called collectively over the MPI communicator of the ParticleGroup. Loop execution is complete when the corresponding call to wait returns.
-
inline virtual void wait() = 0#
Wait for loop execution to complete. On completion perform post-loop actions. Must be called collectively on communicator.
-
inline virtual void execute(const std::optional<int> cell = std::nullopt) = 0#
-
struct ParticleLoopGlobalInfo#
- #include <particle_loop_base.hpp>
The description of the iteration set to pass to the objects used in the loop.
-
struct ParticleLoopIndex#
- #include <particle_loop_index.hpp>
The type to pass to a ParticleLoop to read the ParticleLoop loop index in a kernel.
-
struct ParticleLoopIndexKernelT#
- #include <particle_loop_index.hpp>
Host to loop type for index.
-
struct ParticleLoopIteration#
- #include <particle_loop_base.hpp>
The description of the iteration index to pas to objects used in the loop.
Public Members
-
size_t index#
The overarching outer loop index.
-
int cellx#
The cell the particle resides in.
-
int layerx#
The layer (row) the particle resides in.
-
int loop_layerx#
The layer of the particle in the particle loop iteration set. e.g. not all looping types visit all the particles in a cell. layerx_loop is a linear contiguous index for the particles which are visited in each cell.
-
size_t index#
-
struct ParticleLoopIterationSet#
- #include <particle_loop.hpp>
For a set of cells containing particles create several sycl::nd_range instances which cover the iteration space of all particles. This exists to create an iteration set over all particles which is blocked, to reduce the number of kernel launches, and reasonably robust to non-uniform.
Public Functions
-
inline ParticleLoopIterationSet(const int nbin, const int ncell, int *h_npart_cell)#
Creates iteration set creator for a given set of cell particle counts.
- Parameters:
nbin – Number of blocks of cells.
ncell – Number of cells.
h_npart_cell – Host accessible array of cell particle counts.
-
inline std::tuple<int, std::vector<sycl::nd_range<2>>&, std::vector<std::size_t>&> get(const std::optional<int> cell = std::nullopt, const size_t local_size = 256)#
Create and return an iteration set which is formed as nbin sycl::nd_ranges.
- Parameters:
cell – If set iteration set will only cover this cell.
local_size – Optional size of SYCL work groups.
- Returns:
Tuple containing: Number of bins, sycl::nd_ranges, cell index offsets.
-
inline ParticleLoopIterationSet(const int nbin, const int ncell, int *h_npart_cell)#
-
template<typename KERNEL, typename ...ARGS>
class ParticleLoopSubGroup : public NESO::Particles::ParticleLoop<KERNEL, ARGS...># - #include <particle_sub_group.hpp>
Derived ParticleLoop type which implements the particle loop over iteration sets defined by ParticleSubGroups.
Public Functions
Create a ParticleLoop that executes a kernel for all particles in the ParticleSubGroup.
- Parameters:
name – Identifier for particle loop.
particle_group – ParticleSubGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleSubGroup.
- Parameters:
particle_group – ParticleSubGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
-
inline virtual void submit(const std::optional<int> cell = std::nullopt) override#
Launch the ParticleLoop and return. Must be called collectively over the MPI communicator of the ParticleGroup. Loop execution is complete when the corresponding call to wait returns.
- Parameters:
cell – Argument for api compatibility.
Protected Functions
-
inline virtual int get_loop_type_int() override#
-
inline void setup_subgroup_is(ParticleSubGroupImplementation::SubGroupSelector::SelectionT &selection)#
Protected Attributes
-
ParticleSubGroupSharedPtr particle_sub_group#
-
class ParticlePacker#
- #include <packing_unpacking.hpp>
Class to pack particle data to send using MPI operations.
Public Functions
-
ParticlePacker(const ParticlePacker &st) = delete#
Disable (implicit) copies.
-
ParticlePacker &operator=(ParticlePacker const &a) = delete#
Disable (implicit) copies.
-
inline ~ParticlePacker()#
Construct a particle packing object on a compute device.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
-
inline void reset()#
Reset the instance before packing particle data.
-
inline char *get_packed_data_on_host(const int num_remote_send_ranks, const int *h_send_rank_npart_ptr)#
Get the packed particle data on the host such that it can be sent.
- Parameters:
num_remote_send_ranks – Number of remote ranks involved in send.
h_send_rank_npart_ptr – Host accessible pointer holding the number of particles to be sent to each remote rank.
- Returns:
Pointer to host allocated buffer holding the packed particle data.
Pack particle data on the device.
- Parameters:
num_remote_send_ranks – Number of remote ranks involved in send.
h_send_rank_npart – Host buffer holding the number of particles to be sent to each remote rank.
dh_send_rank_map – Maps MPI ranks to the cell in the packing CellDat.
num_particles_leaving – Total number of particles to pack.
d_pack_cells – BufferDevice holding the cells of particles to pack.
d_pack_layers_src – BufferDevice holding the layers(rows) of particles to pack.
d_pack_layers_dst – BufferDevice holding the destination layers in the packing CellDat.
particle_dats_real – Container of REAL ParticleDat instances to pack.
particle_dats_int – Container of INT ParticleDat instances to pack.
rank_component – Component of MPI rank ParticleDat to inspect for destination MPI rank.
- Returns:
sycl::event to wait on for packing completion.
Public Members
-
int num_bytes_per_particle#
Number of bytes required per particle packed.
-
BufferHost<char> h_send_buffer#
Host buffer to copy packed data to before sending using MPI routines.
-
BufferHost<INT> h_send_offsets#
Vector of offsets to index into the host send buffer.
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
Private Functions
Private Members
-
int num_dats_real = 0#
-
int num_dats_int = 0#
-
BufferDeviceHost<REAL*const*const*> dh_particle_dat_ptr_real#
-
BufferDeviceHost<INT*const*const*> dh_particle_dat_ptr_int#
-
BufferDeviceHost<int> dh_particle_dat_ncomp_real#
-
BufferDeviceHost<int> dh_particle_dat_ncomp_int#
-
ParticlePacker(const ParticlePacker &st) = delete#
-
template<typename T>
class ParticleProp# - #include <particle_spec.hpp>
Class to describe a property of a particle.
Public Functions
-
inline ParticleProp(const Sym<T> sym, int ncomp, bool positions = false)#
Constructor for particle properties.
- Parameters:
sym – Sym<T> instance for the property.
ncomp – Number of components for the property.
positions – Bool to indicate if the property hold positions or cells ids.
-
inline bool operator==(const ParticleProp<T> &prop) const#
-
inline ParticleProp(const Sym<T> sym, int ncomp, bool positions = false)#
-
class ParticleRemover#
- #include <particle_remover.hpp>
Utility to aid removing particles from a ParticleGroup based on a condition.
Public Functions
-
ParticleRemover(const ParticleRemover &st) = delete#
Disable (implicit) copies.
-
ParticleRemover &operator=(ParticleRemover const &a) = delete#
Disable (implicit) copies.
Construct a remover that operates on ParticleGroups that use the given SYCLTarget.
- Parameters:
sycl_target – SYCLTarget instance.
Remove particles from a ParticleGroup based on a value in a ParticleDat. For each particle, compares the first value in the ParticleDat with the passed Key. Removes the particle if the value matches the key.
- Parameters:
particle_group – ParticleGroup to remove particles from.
particle_dat – ParticleDat to inspect to determine if particles should be removed.
key – Key to compare particle values with for removal.
Private Members
-
BufferDeviceHost<int> dh_remove_count#
-
BufferDevice<INT> d_remove_cells#
-
BufferDevice<INT> d_remove_layers#
-
SYCLTargetSharedPtr sycl_target#
-
ParticleRemover(const ParticleRemover &st) = delete#
-
class ParticleSet#
- #include <particle_set.hpp>
Container to hold particle data for a set of particles.
Public Functions
-
inline ParticleSet(const int npart, ParticleSpec particle_spec)#
Constructor for a set of particles.
- Parameters:
npart – Number of particles required.
particle_spec – ParticleSpec instance that describes the particle properties.
-
inline REAL &at(Sym<REAL> sym, const int particle_index, const int component_index)#
Access REAL elements for a particle.
- Parameters:
sym – Sym of particle property to access.
particle_index – Index of particle to access.
component_index – Index of component to access.
- Returns:
modifiable reference to element.
-
inline INT &at(Sym<INT> sym, const int particle_index, const int component_index)#
Access REAL elements for a particle.
- Parameters:
sym – Sym of particle property to access.
particle_index – Index of particle to access.
component_index – Index of component to access.
- Returns:
modifiable reference to element.
-
inline std::vector<REAL> &get(Sym<REAL> const &sym)#
Get the vector of values describing the particle data for a given Sym<REAL>. Will return an empty std::vector if the passed Sym is not a stored property.
- Parameters:
sym – Sym<REAL> to access.
- Returns:
std::vector of data or empty std::vector.
-
inline std::vector<INT> &get(Sym<INT> const &sym)#
Get the vector of values describing the particle data for a given Sym<INT>. Will return an empty std::vector if the passed Sym is not a stored property.
- Parameters:
sym – Sym<INT> to access.
- Returns:
std::vector of data or empty std::vector.
Public Members
-
const int npart#
Number of particles stored in the container.
Protected Functions
Private Members
Friends
- friend class ParticleGroup
-
inline ParticleSet(const int npart, ParticleSpec particle_spec)#
-
class ParticleSpec#
- #include <particle_spec.hpp>
A ParticleSpec is a particle specification described by a collection of particle properties.
Public Functions
-
template<typename ...T>
inline ParticleSpec(T... args)# Constructor to create a particle specification.
- Parameters:
args – ParticleSpec is called with a set of ParticleProp arguments.
-
inline ParticleSpec(std::vector<ParticleProp<REAL>> &properties_real, std::vector<ParticleProp<INT>> &properties_int)#
Create a particle specification from a vector of REAL properties and a vector of INT properties.
- Parameters:
properties_real – REAL particle properties.
properties_int – INT particle properties.
-
inline void push(ParticleProp<REAL> pp)#
Push a ParticleProp<REAL> property onto the specification.
- Parameters:
pp – ParticleProp<REAL> to add to the specification.
-
inline void push(ParticleProp<INT> pp)#
Push a ParticleProp<INT> property onto the specification.
- Parameters:
pp – ParticleProp<INT> to add to the specification.
-
template<typename T>
inline bool contains(ParticleProp<T> pp)# Determine if a ParticleProp is contained in this specification.
- Parameters:
pp – ParticleProp to search for.
- Returns:
True if passed ParticleProp is in this ParticleSpec.
-
inline bool contains(ParticleSpec &ps)#
Determine if a passed ParticleSpec is a subset of this ParticleSpec.
- Parameters:
ps – ParticleSpec to compare with.
- Returns:
True if the passed particle spec is a subset of this particle spec.
-
template<typename T>
inline void remove(ParticleProp<T> pp)# Remove a particle property from the specification.
- Parameters:
pp – ParticleProp to remove from the specification.
-
inline ParticleSpec()#
-
inline ~ParticleSpec()#
Public Members
-
std::vector<ParticleProp<REAL>> properties_real#
Collection of REAL ParticleProp.
-
std::vector<ParticleProp<INT>> properties_int#
Collection of INT ParticleProp.
Private Functions
-
template<typename ...T>
inline void push(ParticleProp<REAL> pp, T... args)#
-
template<typename ...T>
inline void push(ParticleProp<INT> pp, T... args)#
-
inline auto find(ParticleProp<REAL> &prop)#
-
inline auto find(ParticleProp<INT> &prop)#
-
inline auto end(ParticleProp<REAL>&)#
-
inline auto end(ParticleProp<INT>&)#
-
template<typename T>
inline void erase(ParticleProp<REAL>, T &location)#
-
template<typename T>
inline void erase(ParticleProp<INT>, T &location)#
-
template<typename ...T>
-
class ParticleSubGroup#
- #include <particle_sub_group.hpp>
A ParticleSubGroup is a container that holds the description of a subset of the particles in a ParticleGroup. For example a sub group could be constructed with all particles of even id. A ParticleSubGroup is a valid iteration set for a ParticleLoop.
A ParticleSubGroup with no selector lambda refers to the entire parent ParticleGroup.
Public Functions
Create a ParticleSubGroup based on a kernel and arguments. The selector kernel must be a lambda which returns true for particles which are in the sub group and false for particles which are not in the sub group. The arguments for the selector kernel must be read access Syms, i.e. Access::read(Sym<T>(“name”)).
For example if A is a ParticleGroup with an INT ParticleProp “ID” that holds particle ids then the following line creates a ParticleSubGroup from the particles with even ids.
auto A_even = std::make_shared<ParticleSubGroup>( A, [=](auto ID) { return ((ID[0] % 2) == 0); }, Access::read(Sym<INT>(“ID”)));
- Parameters:
parent – Parent ParticleGroup or ParticleSubGroup from which to form ParticleSubGroup.
kernel – Lambda function (like a ParticleLoop kernel) that returns true for the particles which should be in the ParticleSubGroup.
args – Arguments in the form of access descriptors wrapping objects to pass to the kernel.
Create a ParticleSubGroup which is simply a reference/view into an entire ParticleGroup. This constructor creates a sub-group which is equivalent to
auto A_all = std::make_shared<ParticleSubGroup>( A, [=]() { return true; } );
but can make additional optimisations.
- Parameters:
parent – Parent ParticleGroup or ParticleSubGroup from which to form ParticleSubGroup.
-
inline bool static_status(const std::optional<bool> status = std::nullopt)#
Get and optionally set the static status of the ParticleSubGroup.
- Parameters:
status – Optional new static status.
- Returns:
Static status.
-
inline void create()#
Explicitly re-create the sub group.
-
inline bool is_valid()#
Test if a ParticleSubGroup has been invalidated by an operation which irreparably invalidates the internal data structures. This method will always return true for a non-static ParticleSubGroup as non-static ParticleSubGroups are automatically rebuilt as needed.
If the ParticleSubGroup is static and this method returns false then the ParticleSubGroup should not be used for any further operations. Note that the implementation calls this method internally to attempt to avoid miss-use of a ParticleSubGroup and hence the user is not expected to routinely call this method.
- Returns:
False if a static ParticleSubGroup has been invalidated by an external operation which invalidated the ParticleSubGroup (e.g. moving particles between cells or MPI ranks, adding or removing particles). Otherwise returns True.
-
inline bool create_if_required()#
Re-create the sub group if required.
- Returns:
True if an update occured otherwise false.
-
inline INT get_npart_local()#
- Returns:
The number of particles currently in the ParticleSubGroup.
-
inline INT get_npart_cell(const int cell)#
- Returns:
The number of particles in a cell of the ParticleSubGroup.
-
inline ParticleGroupSharedPtr get_particle_group()#
- Returns:
The original ParticleGroup this ParticleSubGroup references.
-
inline bool is_entire_particle_group()#
- Returns:
True if this ParticleSubGroup references the entirety of the parent ParticleGroup.
-
inline ParticleSetSharedPtr get_particles(std::vector<INT> &cells, std::vector<INT> &layers)#
Create a ParticleSet containing the data from particles held in the ParticleSubGroup. e.g. to Extract the first two particles from the second cell:
cells = [1, 1] layers = [0, 1]
- Parameters:
cells – Vector of cell indices of particles to extract.
cells – Vector of layer indices of particles to extract.
- Returns:
ParticleSet of particle data.
Protected Functions
-
inline void check_sym_type(ParticleLoopIndex&)#
-
inline ParticleSubGroup(ParticleSubGroupImplementation::SubGroupSelector selector)#
-
inline int get_cells_layers(std::vector<INT> &cells, std::vector<INT> &layers)#
Get the cells and layers of the particles in the sub group (slow)
-
inline void create_inner()#
-
inline void create_and_update_cache()#
Protected Attributes
-
bool is_static#
-
ParticleGroupSharedPtr particle_group#
-
int npart_local#
-
ParticleGroup::ParticleDatVersionTracker particle_dat_versions#
-
bool is_whole_particle_group#
Friends
- friend class ParticleLoopSubGroup
- friend class ParticleGroup
-
class ParticleUnpacker#
- #include <packing_unpacking.hpp>
Class to unpack particle data which was packed using the ParticlePacker.
Public Functions
-
ParticleUnpacker(const ParticleUnpacker &st) = delete#
Disable (implicit) copies.
-
ParticleUnpacker &operator=(ParticleUnpacker const &a) = delete#
Disable (implicit) copies.
-
inline ~ParticleUnpacker()#
Construct an unpacking object.
- Parameters:
sycl_target – SYCLTargetSharedPtr to use as compute device.
Reset the unpacker ready to unpack received particles.
- Parameters:
num_remote_recv_ranks – Number of MPI ranks that will send to this rank.
h_recv_rank_npart – Number of particles each rank will send to this rank.
particle_dats_real – Container of REAL ParticleDat instances to unpack.
particle_dats_int – Container of INT ParticleDat instances to unpack.
Unpack the recv buffer into the particle group. Particles unpack into cell 0.
- Parameters:
particle_dats_real – Container of REAL ParticleDat instances to unpack.
particle_dats_int – Container of INT ParticleDat instances to unpack.
Public Members
-
BufferHost<char> h_recv_buffer#
Host buffer to receive particle data into from MPI operations.
-
BufferHost<INT> h_recv_offsets#
Offsets into the recv buffer for each remote rank that will send to this.
-
int npart_recv#
Number of particles expected in the next/current recv operation.
-
int num_bytes_per_particle#
Number of bytes per particle.
-
SYCLTargetSharedPtr sycl_target#
Compute device used by the instance.
Private Functions
Private Members
-
int num_dats_real = 0#
-
int num_dats_int = 0#
-
BufferDeviceHost<REAL***> dh_particle_dat_ptr_real#
-
BufferDeviceHost<INT***> dh_particle_dat_ptr_int#
-
BufferDeviceHost<int> dh_particle_dat_ncomp_real#
-
BufferDeviceHost<int> dh_particle_dat_ncomp_int#
-
BufferDevice<char> d_recv_buffer#
-
ParticleUnpacker(const ParticleUnpacker &st) = delete#
-
class ProductMatrix#
- #include <product_matrix.hpp>
Type to store N products which can be passed to a ParticleLoop. Fundamentally this class allocates two matrices, one for REAL valued properties and one for INT value properties. These matrices are allocated column major. Each output particle populates a row in these two matrices. The column ordering is based on the ordering of properties and there components in the input particle specification.
Subclassed by NESO::Particles::DescendantProducts
Public Functions
-
ProductMatrix() = default#
-
ProductMatrix &operator=(const ProductMatrix&) = default#
Note that the copy operator creates shallow copies of the array.
Create a new product matrix on the SYCLTarget. The reset method should be called with the desired number of output particles before a loop is executed which requires space for those output particles.
- Parameters:
sycl_target – Device on which particle loops will be executed using the product matrix.
spec – A specification for the output particle properties.
-
inline virtual void reset(const int num_products)#
Allocate space for a number of particle properties and fill the matrix with the default values.
- Parameters:
reset – Number of output particles to set in matrix.
Public Members
-
SYCLTargetSharedPtr sycl_target#
The SYCLTarget products are created on.
-
int num_products#
The number of products stored.
-
std::shared_ptr<ProductMatrixSpec> spec#
The specification of the products.
Protected Functions
-
inline ProductMatrixGet impl_get()#
-
inline ProductMatrixGetConst impl_get_const()#
Protected Attributes
-
std::shared_ptr<BufferDevice<REAL>> d_data_real#
-
std::shared_ptr<BufferDevice<INT>> d_data_int#
-
std::shared_ptr<BufferDeviceHost<int>> dh_offsets_real#
-
std::shared_ptr<BufferDeviceHost<int>> dh_offsets_int#
Friends
- friend class ParticleGroup
-
inline friend ProductMatrixGetConst create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<ProductMatrix*> &a)#
-
inline friend ProductMatrixGet create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<ProductMatrix*> &a)#
-
inline friend ProductMatrixGet create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<ProductMatrix*> &a)#
-
ProductMatrix() = default#
-
struct ProductMatrixGet#
- #include <product_matrix.hpp>
-
struct ProductMatrixGetConst#
- #include <product_matrix.hpp>
-
struct ProductMatrixSpec#
- #include <product_matrix.hpp>
Type to describe the particle properties of products.
Public Functions
-
ProductMatrixSpec() = default#
-
ProductMatrixSpec &operator=(const ProductMatrixSpec&) = default#
-
inline ProductMatrixSpec(ParticleSpec &particle_spec)#
Create a specification for products based on a ParticleSpec.
- Parameters:
particle_spec – Specification for product particle properties.
-
inline void set_default_value(Sym<INT> sym, const int component, const INT value)#
Set the default value for a particle property.
- Parameters:
sym – Sym of particle property.
component – Component of particle property.
value – Default value to set.
-
inline void set_default_value(Sym<REAL> sym, const int component, const REAL value)#
Set the default value for a particle property.
- Parameters:
sym – Sym of particle property.
component – Component of particle property.
value – Default value to set.
Public Members
-
int num_components_real#
The total number of components of type REAL stored.
-
int num_components_int#
The total number of components of type INT stored.
-
int num_properties_real#
The number of REAL particle properties.
-
int num_properties_int#
The number of INT particle properties.
-
std::map<std::pair<Sym<REAL>, int>, REAL> default_values_real#
Default values applied on call to reset for REAL.
-
std::map<std::pair<Sym<INT>, int>, INT> default_values_int#
Default values applied on call to reset for INT.
-
ParticleSpec particle_spec#
The ParticleSpec the instance was created from.
-
ProductMatrixSpec() = default#
-
struct ProfileEntry#
- #include <profiling.hpp>
Structure to describe an entry in the profiling data structure.
-
class ProfileMap#
- #include <profiling.hpp>
Data structure for profiling data. Fundamentally is a map from key to key to value.
Public Functions
-
inline ~ProfileMap()#
-
inline ProfileMap()#
Construct a new empty instance.
-
inline void set(const std::string key1, const std::string key2, const int64_t value_integral, const double value_real = 0.0)#
Set or create a new profiling entry in the data structure.
- Parameters:
key1 – First key for the entry.
key2 – Second key for the entry.
value_integral – Integral value for the entry.
value_real – Floating point value for the entry.
-
inline void inc(const std::string key1, const std::string key2, const int64_t value_integral, const double value_real = 0.0)#
Increment a profiling entry in the data structure.
- Parameters:
key1 – First key for the entry.
key2 – Second key for the entry.
value_integral – Integral value for the entry to add to current value.
value_real – Floating point value for the entry to add to current value.
-
inline void reset()#
Reset the profiling data by emptying the current set of keys and values.
-
inline void print()#
Print the profiling data.
-
inline void event(const std::string key1, const std::string key2)#
Record a profiling event in the data structure.
- Parameters:
key1 – First key for the entry.
key2 – Second key for the entry.
-
inline void add_region(ProfileRegion &profile_region)#
Add a region to this profiling.
- Parameters:
profile_region – ProfileRegion to add.
-
inline void print_events()#
Print the event data to stdout.
Public Members
-
std::map<std::string, std::map<std::string, ProfileEntry>> profile#
Main data structure storing profiling data.
-
std::list<std::tuple<std::string, std::string, std::chrono::high_resolution_clock::time_point>> events#
Main data structure for storing events.
-
std::list<ProfileRegion> regions#
-
inline ~ProfileMap()#
-
struct ProfileRegion#
- #include <profiling.hpp>
Struct to hold a ProfileRegion for profiling.
Public Functions
-
inline ProfileRegion(const std::string key1, const std::string key2, const int level = 0)#
Create new ProfileRegion.
- Parameters:
key1 – First key for ProfileRegion.
key2 – Second key for ProfileRegion.
-
inline void end()#
End the ProfileRegion.
-
inline ProfileRegion(const std::string key1, const std::string key2, const int level = 0)#
-
template<typename T>
class RawPointerColumnMajorColumnAccessor# - #include <access.hpp>
One of a pair of classes that enable indexing like foo[row][col] for an object foo which stores data in a column major format.
Public Functions
-
inline RawPointerColumnMajorColumnAccessor(T *d_ptr, const int stride, const int rowx)#
Create new instance to access data through a pointer which stores 2D data in a column major format using a given stride.
- Parameters:
d_ptr – Base pointer to index into.
stride – Number of rows in the 2D object.
rowx – Row to access.
-
inline RawPointerColumnMajorColumnAccessor(T *d_ptr, const int stride, const int rowx)#
-
template<typename T>
class RawPointerColumnMajorRowAccessor# - #include <access.hpp>
One of a pair of classes that enable indexing like foo[row][col] for an object foo which stores data in a column major format.
Public Functions
-
inline RawPointerColumnMajorRowAccessor(T *d_ptr, const int stride)#
Create new instance to access data through a pointer which stores 2D data in a column major format using a given stride.
- Parameters:
d_ptr – Base Object to index into.
stride – Number of rows in the 2D object.
-
inline RawPointerColumnMajorColumnAccessor<T> operator[](const int rowx)#
Returns a RawPointerColumnMajorColumnAccessor instance which defines a subscript operator that can be used to access any column of the specified row.
- Parameters:
rowx – Row to provide access to.
-
inline RawPointerColumnMajorRowAccessor(T *d_ptr, const int stride)#
-
template<typename T>
struct Read# - #include <cell_dat.hpp>
Access:CellDat::Read<T> read access cellwise.
Public Functions
-
Read() = default#
Pointer to underlying data for the array.
-
Read() = default#
-
template<typename T>
struct Read# - #include <cell_dat_const.hpp>
Access:CellDatConst::Read<T> and Access:CellDatConst::Add<T> are the kernel argument types for accessing CellDatConst data in a kernel.
Public Functions
-
Read() = default#
Pointer to underlying data for the array.
-
Read() = default#
-
template<typename T>
struct Read# - #include <global_array.hpp>
Access:GlobalArray::Read<T> and Access:GlobalArray::Add<T> are the kernel argument types for accessing GlobalArray data in a kernel.
Public Functions
-
Read() = default#
Pointer to underlying data for the array.
-
Read() = default#
-
template<typename T>
struct Read# - #include <local_array.hpp>
Access:LocalArray::Read<T>, Access::LocalArray::Write<T> and Access:LocalArray::Add<T> are the kernel argument types for accessing LocalArray data in a kernel. ParticleLoop access type for LocalArray Read access.
Public Functions
-
Read() = default#
Pointer to underlying data for the array.
-
Read() = default#
-
struct Read#
- #include <particle_loop_index.hpp>
ParticleLoop index containing the cell and layer.
Public Functions
-
inline INT get_local_linear_index() const#
- Returns:
The local linear index of the particle on this MPI rank in the ParticleGroup
-
inline INT get_loop_linear_index() const#
- Returns:
The linear index of the particle within the current ParticleLoop.
-
inline INT get_sub_linear_index() const#
- Returns:
The local linear index of the particle in the ParticleSubGroup. This call is identical to get_local_linear_index when the iteration set is a ParticleGroup.
Public Members
-
int loop_type_int#
The type of the ParticleLoop (intended for internal use).
-
INT const *npart_cell_es#
pointer to the exclusive sum of particle counts in each cell (intended for internal use).
-
INT const *npart_cell_es_lb#
pointer to the exclusive sum of particle counts in each cell for loop bounds (intended for internal use).
-
int starting_cell#
Loop iteration index (intended for internal use - see get_loop_linear_index) Starting cell for ParticleLoop called cell wise (intended for internal use).
-
inline INT get_local_linear_index() const#
-
template<typename T>
struct Read# - #include <pli_particle_dat.hpp>
Access:ParticleDat::Read<T> and Access:ParticleDat::Read<T> are the kernel argument types for accessing particle data in a kernel.
Public Functions
-
struct Read#
- #include <product_matrix.hpp>
Access:ProductMatrix::Read<T>, Access::ProductMatrix::Write<T> and Access:ProductMatrix::Add<T> are the kernel argument types for accessing ProductMatrix data in a kernel. ParticleLoop access type for ProductMatrix Read access.
Public Functions
-
Read() = default#
-
inline const REAL &at_real(const int product, const int property, const int component) const#
Access a REAL product property.
- Parameters:
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering REAL ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
- Returns:
Constant reference to product value.
-
inline const INT &at_int(const int product, const int property, const int component) const#
Access a INT product property.
- Parameters:
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering INT ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
- Returns:
Constant reference to product value.
-
Read() = default#
-
template<typename T>
struct Read : public NESO::Particles::Access::AccessGeneric<T># - #include <access_descriptors.hpp>
Read access descriptor.
-
template<typename T>
struct Read# - #include <sym_vector.hpp>
Access:SymVector::Read<T> and Access:SymVector::Read<T> are the kernel argument types for accessing particle data in a kernel via a SymVector.
-
struct SelectionT#
- #include <particle_sub_group.hpp>
-
class SubGroupSelector#
- #include <particle_sub_group.hpp>
Class to consume the lambda which selects which particles are to be in a ParticleSubGroup and provide to the ParticleSubGroup a list of cells and layers.
Public Functions
Create a selector based on a kernel and arguments. The selector kernel must be a lambda which returns true for particles which are in the sub group and false for particles which are not in the sub group. The arguments for the selector kernel must be read access Syms, i.e. Access::read(Sym<T>(“name”)).
- Parameters:
parent – Parent ParticleGroup or ParticleSubGroup from which to form ParticleSubGroup.
kernel – Lambda function (like a ParticleLoop kernel) that returns true for the particles which should be in the ParticleSubGroup.
args – Arguments in the form of access descriptors wrapping objects to pass to the kernel.
-
inline SelectionT get()#
Get two BufferDeviceHost objects that hold the cells and layers of the particles which currently are selected by the selector kernel.
- Returns:
List of cells and layers of particles in the sub group.
Public Members
-
ParticleGroupSharedPtr particle_group#
Protected Functions
Protected Attributes
-
std::shared_ptr<BufferDeviceHost<int>> dh_npart_cell#
-
LocalArray<int*> map_ptrs#
-
std::shared_ptr<BufferDevice<INT>> d_npart_cell_es#
-
ParticleLoopSharedPtr loop_0#
-
ParticleLoopSharedPtr loop_1#
Friends
- friend class NESO::Particles::ParticleSubGroup
-
class SYCLTarget#
- #include <compute_target.hpp>
Container for SYCL devices and queues such that they can be easily passed around.
Public Functions
-
SYCLTarget(const SYCLTarget &st) = delete#
Disable (implicit) copies.
-
SYCLTarget &operator=(SYCLTarget const &a) = delete#
Disable (implicit) copies.
-
inline SYCLTarget(const int gpu_device, MPI_Comm comm, int local_rank = -1)#
Create a new SYCLTarget using a flag to specifiy device type and a parent MPI communicator.
- Parameters:
gpu_device – Specify how to search for SYCL device. 0 uses default selector, 1 explicitly use a GPU selector and -1 use an explicit CPU selector.
comm – MPI Communicator on which the SYCLTarget is based.
local_rank – (optional) Explicitly pass the local rank used to assign devices to MPI ranks.
-
inline ~SYCLTarget()#
-
inline void print_device_info()#
Print information to stdout about the current SYCL device (on MPI rank 0).
-
inline void free()#
Free the SYCLTarget and underlying CommPair.
-
inline void *malloc_device(size_t size_bytes)#
Allocate memory on device using sycl::malloc_device.
- Parameters:
size_bytes – Number of bytes to allocate.
-
inline void *malloc_host(size_t size_bytes)#
Allocate memory on the host using sycl::malloc_host.
- Parameters:
size_bytes – Number of bytes to allocate.
-
template<typename T>
inline void free(T *ptr_in)# Free a pointer allocated with malloc_device.
- Parameters:
ptr_in – Pointer to free.
-
inline void check_ptrs()#
-
inline void check_ptr(unsigned char *ptr_user, const size_t size_bytes)#
Public Members
-
sycl::device device#
SYCL device in use.
-
sycl::queue queue#
Main SYCL queue to use.
-
MPI_Comm comm#
Parent MPI communicator to use.
-
CommPair comm_pair#
CommPair to pass around inter and intra communicators for shared memory regions.
-
ProfileMap profile_map#
ProfileMap to log profiling data related to this SYCLTarget.
-
SYCLTarget(const SYCLTarget &st) = delete#
-
template<typename U>
class Sym# - #include <particle_spec.hpp>
Symbol describing a type of data and a name.
Public Functions
-
Sym() = default#
-
inline Sym(const std::string name)#
Construct a new Sym object.
- Parameters:
name – Name of new symbol.
-
Sym() = default#
-
class SymStore#
- #include <particle_spec.hpp>
Helper class to hold a collection of Sym instances for ParticleGroup::print.
Public Functions
-
template<typename ...T>
inline SymStore(T... args)# Constructor for SymStore should be called with a list of arguments which are Sym instances.
-
inline SymStore()#
-
inline ~SymStore()#
Public Members
-
template<typename ...T>
-
template<typename T>
class SymVector# - #include <sym_vector.hpp>
Enables ParticleDats to be accessed in ParticleLoops with a number of ParticleDats determined at runtime.
Public Functions
-
SymVector() = default#
Create a SymVector using a ParticleGroup and a std::vector of Syms.
- Parameters:
particle_group – ParticleGroup to use.
syms – Vector of Syms to use from particle_group.
Create a SymVector using a ParticleGroup and an initialiser list of syms, e.g.
SymVector(particle_group, {Sym<INT>(“a”), Sym<INT>(“b”)});
- Parameters:
particle_group – ParticleGroup to use.
syms – Syms to use from particle_group.
-
inline std::vector<ParticleDatSharedPtr<T>> const &get_particle_dats()#
- Returns:
The ParticleDats that form the SymVector.
Protected Functions
-
inline SymVectorImplGetT<T> impl_get()#
-
inline SymVectorImplGetConstT<T> impl_get_const()#
Protected Attributes
-
std::vector<ParticleDatSharedPtr<T>> dats#
The ParticleDats referenced by the SymVector.
-
std::shared_ptr<BufferDeviceHost<T***>> dh_root_ptrs#
-
std::shared_ptr<BufferDeviceHost<T*const*const*>> dh_root_const_ptrs#
-
SymVector() = default#
-
template<typename U, typename ...V>
struct Tuple : public NESO::Particles::Tuple::TupleBaseRec<0, U, V...># - #include <tuple.hpp>
Public Functions
-
Tuple() = default#
-
Tuple() = default#
-
template<size_t INDEX, typename ...V>
struct TupleBaseRec# - #include <tuple.hpp>
Public Functions
-
TupleBaseRec() = default#
-
TupleBaseRec() = default#
-
template<size_t INDEX, typename U, typename ...V>
struct TupleBaseRec<INDEX, U, V...> : public NESO::Particles::Tuple::TupleImpl<INDEX, U>, public NESO::Particles::Tuple::TupleBaseRec<INDEX + 1, V...># - #include <tuple.hpp>
Public Functions
-
TupleBaseRec() = default
-
TupleBaseRec() = default
-
template<std::size_t INDEX, typename U>
struct TupleImpl# - #include <tuple.hpp>
Subclassed by NESO::Particles::Tuple::TupleBaseRec< INDEX, U, V… >
-
class VTKMeshHierarchyCellsWriter#
- #include <utility_mesh_hierarchy_plotting.hpp>
Class to write MeshHierarchy cells to a vtk file as a collection of vertices and edges for visualisation in Paraview.
Public Functions
Create new instance of the writer.
- Parameters:
mesh_hierarchy – [in] MeshHierarchy instance to use as source for cells.
-
inline void push_back(const INT linear_index)#
Add a cell to the list of cells to be written to the output file.
- Parameters:
linear_index – [in] Index of cell.
-
inline void write(std::string filename)#
Write the output vtk file.
- Parameters:
filename – [in] Filename to write output to. Should end in .vtk.
-
template<typename T>
struct Write# - #include <cell_dat.hpp>
Access:CellDat::Add<T> write access cellwise.
Public Functions
-
Write() = default#
Pointer to underlying data for the array.
-
Write() = default#
-
struct Write#
- #include <descendant_products.hpp>
ParticleLoop access type for DescendantProducts Write access.
Public Functions
-
Write() = default#
Pointer to underlying data for the array.
-
inline REAL &at_real(const LoopIndex::Read &particle_index, const int product, const int property, const int component)#
Write access to REAL particle property.
- Parameters:
particle_index – The index of the particle creating this product.
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering REAL ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
- Returns:
Modifiable reference to property value.
-
inline INT &at_int(const LoopIndex::Read &particle_index, const int product, const int property, const int component)#
Write access to INT particle property.
- Parameters:
particle_index – The index of the particle creating this product.
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering INT ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
- Returns:
Modifiable reference to property value.
-
Write() = default#
-
template<typename T>
struct Write# - #include <local_array.hpp>
ParticleLoop access type for LocalArray Write access.
Public Functions
-
Write() = default#
Pointer to underlying data for the array.
-
Write() = default#
-
template<typename T>
struct Write# - #include <pli_particle_dat.hpp>
-
struct Write#
- #include <product_matrix.hpp>
ParticleLoop access type for ProductMatrix Write access.
Public Functions
-
Write() = default#
Pointer to underlying data for the array.
-
inline REAL &at_real(const int product, const int property, const int component)#
Write access to REAL particle property.
- Parameters:
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering REAL ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
- Returns:
Modifiable reference to property value.
-
inline INT &at_int(const int product, const int property, const int component)#
Write access to INT particle property.
- Parameters:
product – The index of the product to access, i.e. the row in the product matrix.
property – The particle property to access using the ordering INT ParticleProp instances were passed to the ProductMatrixSpec
component – The component of the property to access.
- Returns:
Modifiable reference to property value.
-
Write() = default#
-
template<typename T>
struct Write# - #include <sym_vector.hpp>
-
template<typename T>
struct Write : public NESO::Particles::Access::AccessGeneric<T># - #include <access_descriptors.hpp>
Write access descriptor.
-
namespace cl#
-
namespace NESO#
-
namespace Particles#
-
Functions
-
template<typename T>
inline MPI_Datatype map_ctype_mpi_type()# For an input data type T get the matching MPI Datatype.
- Parameters:
i – Input argument of type T.
- Returns:
MPI_Datatype that matches the input type T.
-
inline int get_local_mpi_rank(MPI_Comm comm, int default_rank = -1)#
Determine a local MPI rank based on environment variables and shared memory splitting.
- Parameters:
comm – MPI_Comm to try and deduce local rank from.
default_rank – (optional) MPI rank to use if one cannot be determined from environment variables or SHM intra comm.
-
template<template<typename> typename D, template<typename> typename S, typename T>
inline sycl::event buffer_memcpy(D<T> &dst, S<T> &src)# Copy the contents of a buffer, e.g. BufferDevice, BufferHost, into another buffer.
- Parameters:
dst – Destination buffer.
src – Source buffer.
-
inline sycl::nd_range<1> get_nd_range_1d(const std::size_t size, const std::size_t local_size)#
Get an 1D nd_range for a given iteration set global size and local size.
- Parameters:
size – Global iteration set size.
local_size – Local iteration set size (work group size).
- Returns:
nd_range large enough to cover global iteration set. May be larger than size.
-
inline NDRangePeel1D get_nd_range_peel_1d(const std::size_t size, const std::size_t local_size)#
Create two nd_ranges that cover a 1D iteration set. The first is a main iteration set that does not need a mask. The second is an iteration set that requires 1) the offset adding to the iteration index and 2) a conditional to test the resulting index is less than the loop bound.
- Parameters:
size – Global iteration set size.
local_size – Local iteration set size (SYCL workgroup size).
- Returns:
NDRangePeel1D instance describing loop iteration sets.
-
inline std::shared_ptr<ProductMatrixSpec> product_matrix_spec(ParticleSpec particle_spec)#
Helper function to create ProductMatrixSpec instances.
- Parameters:
particle_spec – Specification for product particle properties.
Helper function to create ProductMatrix shared pointer.
- Parameters:
sycl_target – Device on which particle loops will be executed using the product matrix.
spec – A specification for the output particle properties.
Helper function to create a SymVector.
- Parameters:
particle_group – ParticleGroup to use.
syms – Vector of Syms to use from particle_group.
Helper function to create a SymVector.
- Parameters:
particle_group – ParticleGroup to use.
syms – Syms to use from particle_group.
Set all components 0 and 1 of particles to -1 in the passed ParticleDat.
- Parameters:
mpi_rank_dat – ParticleDat containing MPI ranks to reset.
-
inline std::shared_ptr<DummyLocalMapperT> DummyLocalMapper()#
Create a ParticleLoop that executes a kernel for all particles in the ParticleGroup.
- Parameters:
particle_group – ParticleGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleGroup.
- Parameters:
name – Identifier for particle loop.
particle_group – ParticleGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleDat.
- Parameters:
particle_dat – ParticleDat to define the iteration set.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleDat.
- Parameters:
name – Identifier for particle loop.
particle_dat – ParticleDat to define the iteration set.
kernel – Kernel to execute for all particles in the ParticleGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Initialisation utility to aid parallel creation of particle distributions. This function performs the all-to-all movement that occurs when a ParticleGroup contains particles with positions (far) outside the owned region of space. For example consider if each MPI rank creates N particles uniformly distributed over the entire simulation domain then the call to
hybrid_move
would have a cost equal to the number of MPI ranks squared.This function gives each particle a temporary position in the owned subdomain then moves the particles in a straight line to the original positions in the positions ParticleDat. It is assumed that the simulation domain is convex.
This function is used by adding particles with
ParticleGroup.add_particles_local
on each rank then collectively calling this function.- Parameters:
particle_group – ParticleGroup to initialise by moving particles to the positions in the position ParticleDat.
num_steps – optional number of steps to move particles over.
Create a ParticleSubGroup based on a kernel and arguments. The selector kernel must be a lambda which returns true for particles which are in the sub group and false for particles which are not in the sub group. The arguments for the selector kernel must be read access Syms, i.e. Access::read(Sym<T>(“name”)).
For example if A is a ParticleGroup with an INT ParticleProp “ID” that holds particle ids then the following line creates a ParticleSubGroup from the particles with even ids.
auto A_even = std::make_shared<ParticleSubGroup>( A, [=](auto ID) { return ((ID[0] % 2) == 0); }, Access::read(Sym<INT>(“ID”)));
- Parameters:
parent – Parent ParticleGroup or ParticleSubGroup from which to form ParticleSubGroup.
kernel – Lambda function (like a ParticleLoop kernel) that returns true for the particles which should be in the ParticleSubGroup.
args – Arguments in the form of access descriptors wrapping objects to pass to the kernel.
Create a ParticleSubGroup which is simply a reference/view into an entire ParticleGroup. This constructor creates a sub-group which is equivalent to
auto A_all = std::make_shared<ParticleSubGroup>( A, [=]() { return true; } );
but can make additional optimisations.
- Parameters:
parent – Parent ParticleGroup or ParticleSubGroup from which to form ParticleSubGroup.
Create a static ParticleSubGroup based on a kernel and arguments. The selector kernel must be a lambda which returns true for particles which are in the sub group and false for particles which are not in the sub group. The arguments for the selector kernel must be read access Syms, i.e. Access::read(Sym<T>(“name”)).
For example if A is a ParticleGroup with an INT ParticleProp “ID” that holds particle ids then the following line creates a ParticleSubGroup from the particles with even ids.
auto A_even = std::make_shared<ParticleSubGroup>( A, [=](auto ID) { return ((ID[0] % 2) == 0); }, Access::read(Sym<INT>(“ID”)));
- Parameters:
parent – Parent ParticleGroup or ParticleSubGroup from which to form ParticleSubGroup.
kernel – Lambda function (like a ParticleLoop kernel) that returns true for the particles which should be in the ParticleSubGroup.
args – Arguments in the form of access descriptors wrapping objects to pass to the kernel.
Create a static ParticleSubGroup which is simply a reference/view into an entire ParticleGroup. This constructor creates a sub-group which is equivalent to
auto A_all = std::make_shared<ParticleSubGroup>( A, [=]() { return true; } );
but can make additional optimisations.
- Parameters:
parent – Parent ParticleGroup or ParticleSubGroup from which to form ParticleSubGroup.
Create a ParticleLoop that executes a kernel for all particles in the ParticleSubGroup.
- Parameters:
particle_group – ParticleSubGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleSubGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
Create a ParticleLoop that executes a kernel for all particles in the ParticleSubGroup.
- Parameters:
name – Identifier for particle loop.
particle_group – ParticleSubGroup to execute kernel for all particles.
kernel – Kernel to execute for all particles in the ParticleSubGroup.
args – The remaining arguments are arguments to be passed to the kernel. All arguments must be wrapped in an access descriptor type.
-
inline std::chrono::high_resolution_clock::time_point profile_timestamp()#
Get a time stamp that can be used with profile_elapsed.
- Returns:
Time stamp.
-
inline double profile_elapsed(std::chrono::high_resolution_clock::time_point time_start, std::chrono::high_resolution_clock::time_point time_end)#
Compute and return the time in seconds between two time stamps created with profile_timestamp.
- Parameters:
time_start – Start time stamp.
time_end – End time stamp.
- Returns:
Elapsed time in seconds between time stamps.
-
inline void neso_particles_assert(const char *expr_str, bool expr, const char *file, int line, const char *msg)#
This is a helper function to assert conditions are satisfied and terminate execution if not. An error is output on stderr and MPI_Abort is called if MPI is initialised. Users should call the corresponding helper macro NESOASSERT like
NESOASSERT(conditional, message);
To check conditionals within their code.
- Parameters:
expr_str – A string identifying the conditional to check.
expr – Bool resulting from the evaluation of the expression.
file – Filename containing the call to neso_particles_assert.
line – Line number for the call to neso_particles assert.
msg – Message to print to stderr on evaluation of conditional to false.
-
inline void neso_particles_warn(const char *expr_str, bool expr, const char *file, int line, const char *msg)#
This is a helper function to assert conditions are satisfied and print to stderr if not. A warning is output on stderr. Users should call the corresponding helper macro NESOWARN like
NESOWARN(conditional, message);
To check conditionals within their code.
- Parameters:
expr_str – A string identifying the conditional to check.
expr – Bool resulting from the evaluation of the expression.
file – Filename containing the call to neso_particles_assert.
line – Line number for the call to neso_particles assert.
msg – Message to print to stderr on evaluation of conditional to false.
-
template<typename T>
void get_decomp_1d(const T N_compute_units, const T N_work_items, const T work_unit, T *rstart, T *rend)#
-
inline int get_required_mpi_thread_level()#
Get the MPI thread level required by NESO-Particles. MPI should be initialised by calling MPI_Init_thread with a required thread level greater than or equal to the value returned by this function.
- Returns:
MPI thread level.
-
inline void test_provided_thread_level(const int level)#
Test that a provided MPI thread level is sufficient for NESO-Particles.
- Parameters:
level – Provided thread level.
-
inline void initialise_mpi(int *argc, char ***argv)#
Helper function to initialise MPI and check that the provided thread level is sufficient. Calling this function is equivalent to calling MPI_Init_thread with the required thread level from get_required_mpi_thread_level and checking the provided thread level is equal to or greater than this required level.
- Parameters:
argc – Pointer to the number of arguments.
argv – Argument vector.
-
template<typename RNG>
inline std::vector<std::vector<double>> uniform_within_extents(const int N, const int ndim, const double *extents, RNG &rng)# Create a uniform distribution of particle positions within a set of extents.
- Parameters:
N – Number of points to generate.
ndim – Number of dimensions.
extents – Extent of each of the dimensions.
rng – RNG to use.
- Returns:
(N)x(ndim) set of positions stored for each column.
-
template<typename RNG>
inline std::vector<std::vector<double>> normal_distribution(const int N, const int ndim, const double mu, const double sigma, RNG &rng)# Create (N)x(ndim) set of samples from a Gaussian distribution.
- Parameters:
N – Number of points to generate.
ndim – Number of dimensions.
mu – Mean to use for Gaussian distribution.
sigma – Sigma to use for Gaussian distribution.
rng – RNG to use.
- Returns:
(N)x(ndim) set of samples stored per column.
-
inline std::vector<std::vector<double>> uniform_within_extents(const int N, const int ndim, const double *extents)#
Create a uniform distribution of particle positions within a set of extents.
- Parameters:
N – Number of points to generate.
ndim – Number of dimensions.
extents – Extent of each of the dimensions.
- Returns:
(N)x(ndim) set of positions stored for each column.
-
inline std::vector<std::vector<double>> normal_distribution(const int N, const int ndim, const double mu, const double sigma)#
Create (N)x(ndim) set of samples from a Gaussian distribution.
- Parameters:
N – Number of points to generate.
ndim – Number of dimensions.
mu – Mean to use for Gaussian distribution.
sigma – Sigma to use for Gaussian distribution.
- Returns:
(N)x(ndim) set of samples stored per column.
Helper function to quickly initialise a uniform distribution of particles on a CartesianHMesh.
- Parameters:
mesh – [in] CartesianHMesh on which to spawn particles.
npart_per_cell – [in] Number of particle positions to sample for each mesh cell.
positions – [inout] Ouput particle positions indexed by dimension then particle.
cells – [inout] Ouput particle cell ids indexed by dimension then particle.
rng_in – [in] Optional input RNG to use.
-
template<typename T>
-
namespace Particles
-
namespace Particles
-
namespace Particles
-
namespace Access#
Types and functions relating to access descriptors for loops.
Functions
-
template<typename T>
inline Read<T> read(T t)# Helper function that allows a loop to be constructed with a read-only parameter passed like:
Access::read(object)
- Parameters:
t – Object to pass with read-only access.
- Returns:
Access::Read object that wraps passed object.
-
template<typename T>
inline Write<T> write(T t)# Helper function that allows a loop to be constructed with a write parameter passed like:
Access::write(object)
- Parameters:
t – Object to pass with write access.
- Returns:
Access::Write object that wraps passed object.
-
template<typename T>
inline Add<T> add(T t)# Helper function that allows a loop to be constructed with a write parameter which is atomic addition passed like:
Access::add(object)
- Parameters:
t – Object to pass with atomic add access.
- Returns:
Access::Add object that wraps passed object.
-
template<typename T>
inline Min<T> min(T t)# Helper function that allows a loop to be constructed with a write parameter which is atomic minimum passed like:
Access::min(object)
- Parameters:
t – Object to pass with atomic min access.
- Returns:
Access::Min object that wraps passed object.
-
template<typename T>
inline Max<T> max(T t)# Helper function that allows a loop to be constructed with a write parameter which is atomic maximum passed like:
Access::max(object)
- Parameters:
t – Object to pass with atomic max access.
- Returns:
Access::Max object that wraps passed object.
-
template<typename T>
-
namespace CellDatConst#
Defines the access implementations and types for CellDatConst objects.
-
namespace DescendantProducts#
Defines the access implementations and types for DescendantProducts objects.
-
namespace GlobalArray#
Defines the access implementations and types for GlobalArray objects.
-
namespace LocalArray#
Defines the access implementations and types for LocalArray objects.
-
namespace LoopIndex#
Defines the access type for the cell, layer indexing.
-
namespace ParticleDat#
Defines the access implementations and types for ParticleDat objects.
-
namespace ProductMatrix#
Defines the access implementations and types for ProductMatrix objects.
-
namespace SymVector#
Defines the access implementations and types for ParticleDat objects.
-
namespace ParticleLoopImplementation#
Functions
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T *const *const *&rhs, Access::CellDat::Read<T> &lhs)#
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T ***&rhs, Access::CellDat::Write<T> &lhs)#
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T ***&rhs, Access::CellDat::Add<T> &lhs)#
-
template<typename T>
inline T *const *const *create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<CellDat<T>*> &a)#
-
template<typename T>
inline T ***create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<CellDat<T>*> &a)#
-
template<typename T>
inline T ***create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<CellDat<T>*> &a)#
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, CellDatConstDeviceTypeConst<T> &rhs, Access::CellDatConst::Read<T> &lhs)# Function to create the kernel argument for CellDatConst read access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, CellDatConstDeviceType<T> &rhs, Access::CellDatConst::Add<T> &lhs)# Function to create the kernel argument for CellDatConst add access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, CellDatConstDeviceType<T> &rhs, Access::CellDatConst::Min<T> &lhs)# Function to create the kernel argument for CellDatConst min access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, CellDatConstDeviceType<T> &rhs, Access::CellDatConst::Max<T> &lhs)# Function to create the kernel argument for CellDatConst max access.
-
template<typename T>
inline CellDatConstDeviceTypeConst<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<CellDatConst<T>*> &a)# Method to compute access to a CellDatConst (read)
-
template<typename T>
inline CellDatConstDeviceType<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<CellDatConst<T>*> &a)# Method to compute access to a CellDatConst (add)
-
template<typename T>
inline CellDatConstDeviceType<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Min<CellDatConst<T>*> &a)# Method to compute access to a CellDatConst (min)
-
template<typename T>
inline CellDatConstDeviceType<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Max<CellDatConst<T>*> &a)# Method to compute access to a CellDatConst (max)
-
inline void create_kernel_arg(ParticleLoopIteration &iterationx, DescendantProductsGet &rhs, Access::DescendantProducts::Write &lhs)#
Function to create the kernel argument for DescendantProducts write access.
-
inline DescendantProductsGet create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<DescendantProducts*> &a)#
Method to compute access to a DescendantProducts (write)
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T const *rhs, Access::GlobalArray::Read<T> &lhs)# Function to create the kernel argument for GlobalArray read access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T *rhs, Access::GlobalArray::Add<T> &lhs)# Function to create the kernel argument for GlobalArray add access.
-
template<typename T>
inline void post_loop(ParticleLoopGlobalInfo *global_info, Access::Add<GlobalArray<T>*> &arg)# Post loop execution function for GlobalArray write.
-
template<typename T>
inline GlobalArrayImplGetConstT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<GlobalArray<T>*> &a)# Method to compute access to a GlobalArray (read)
-
template<typename T>
inline GlobalArrayImplGetT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<GlobalArray<T>*> &a)# Method to compute access to a GlobalArray (add)
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T const *rhs, Access::LocalArray::Read<T> &lhs)# Function to create the kernel argument for LocalArray read access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T *rhs, Access::LocalArray::Write<T> &lhs)# Function to create the kernel argument for LocalArray write access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T *rhs, Access::LocalArray::Add<T> &lhs)# Function to create the kernel argument for LocalArray add access.
-
template<typename T>
inline LocalArrayImplGetConstT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<LocalArray<T>*> &a)# Method to compute access to a LocalArray (read)
-
template<typename T>
inline LocalArrayImplGetT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<LocalArray<T>*> &a)# Method to compute access to a LocalArray (write)
-
template<typename T>
inline LocalArrayImplGetT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<LocalArray<T>*> &a)# Method to compute access to a LocalArray (add)
-
inline void create_kernel_arg(ParticleLoopIteration &iterationx, ProductMatrixGetConst &rhs, Access::ProductMatrix::Read &lhs)#
Function to create the kernel argument for ProductMatrix read access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, ProductMatrixGet &rhs, T &lhs)# Function to create the kernel argument for ProductMatrix write/add access.
-
inline ProductMatrixGetConst create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<ProductMatrix*> &a)#
Method to compute access to a ProductMatrix (read)
-
inline ProductMatrixGet create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<ProductMatrix*> &a)#
Method to compute access to a ProductMatrix (write)
-
inline ProductMatrixGet create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Add<ProductMatrix*> &a)#
Method to compute access to a ProductMatrix (add)
-
template<typename T>
inline SymVectorImplGetConstT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<SymVector<T>*> &a)# Method to compute access to a SymVector (read).
-
template<typename T>
inline SymVectorImplGetT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<SymVector<T>*> &a)# Method to compute access to a SymVector (write).
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T *const *const **rhs, Access::SymVector::Read<T> &lhs)# Function to create the kernel argument for SymVector read access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T ****rhs, Access::SymVector::Write<T> &lhs)# Function to create the kernel argument for SymVector write access.
-
template<typename T>
inline void post_loop(ParticleLoopGlobalInfo *global_info, T &arg)# The functions to run for each argument to the kernel post loop completion. Default post loop execution function.
-
inline ParticleLoopIndexKernelT create_loop_arg(ParticleLoopImplementation::ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<ParticleLoopIndex*> &a)#
Method to compute access to a ParticleLoopIndex (read)
-
inline void create_kernel_arg(ParticleLoopIteration &iterationx, ParticleLoopIndexKernelT &rhs, Access::LoopIndex::Read &lhs)#
Function to create the kernel argument for ParticleLoopIndex read access.
-
template<typename T>
inline ParticleDatImplGetConstT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<Sym<T>*> &a)# Method to compute access to a particle dat (read) - via Sym.
-
template<typename T>
inline ParticleDatImplGetT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<Sym<T>*> &a)# Method to compute access to a particle dat (write) - via Sym
-
template<typename T>
inline ParticleDatImplGetConstT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Read<ParticleDatT<T>*> &a)# Method to compute access to a particle dat (read).
-
template<typename T>
inline ParticleDatImplGetT<T> create_loop_arg(ParticleLoopGlobalInfo *global_info, sycl::handler &cgh, Access::Write<ParticleDatT<T>*> &a)# Method to compute access to a particle dat (write).
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T *const *const *rhs, Access::ParticleDat::Read<T> &lhs)# Function to create the kernel argument for ParticleDat read access.
-
template<typename T>
inline void create_kernel_arg(ParticleLoopIteration &iterationx, T ***rhs, Access::ParticleDat::Write<T> &lhs)# Function to create the kernel argument for ParticleDat write access.
-
template<typename T>
-
namespace ParticleSubGroupImplementation#
-
namespace Tuple#
-
namespace std#
- file access.hpp
- #include “typedefs.hpp”
- file boundary_conditions.hpp
- #include <CL/sycl.hpp>#include <cmath>#include “domain.hpp”#include “loop/particle_loop.hpp”#include “particle_dat.hpp”#include “profiling.hpp”#include “typedefs.hpp”#include <memory>
- file cartesian_mesh.hpp
- #include <CL/sycl.hpp>#include <memory>#include <mpi.h>#include “compute_target.hpp”#include “local_mapping.hpp”#include “loop/particle_loop.hpp”#include “particle_dat.hpp”#include “particle_group.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file cell_binning.hpp
- #include <CL/sycl.hpp>#include <cmath>#include “domain.hpp”#include “loop/particle_loop.hpp”#include “particle_dat.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file cell_dat.hpp
- #include “containers/cell_dat.hpp”#include “containers/cell_dat_const.hpp”#include “containers/cell_data.hpp”
- file cell_dat.hpp
- #include “../loop/particle_loop_base.hpp”#include “cell_data.hpp”
- file cell_dat_compression.hpp
- #include <CL/sycl.hpp>#include <cstdint>#include <map>#include <memory>#include <mpi.h>#include <string>#include “cell_dat.hpp”#include “compute_target.hpp”#include “particle_dat.hpp”#include “particle_set.hpp”#include “particle_spec.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file cell_dat_move.hpp
- #include <CL/sycl.hpp>#include <cstdint>#include <map>#include <memory>#include <mpi.h>#include <string>#include “cell_dat.hpp”#include “cell_dat_compression.hpp”#include “compute_target.hpp”#include “error_propagate.hpp”#include “particle_dat.hpp”#include “particle_set.hpp”#include “particle_spec.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file cell_dat_move_impl.hpp
- #include “cell_dat_move.hpp”#include “loop/particle_loop.hpp”
- file communication.hpp
- #include “typedefs.hpp”#include <mpi.h>
- file compute_target.hpp
- #include <cstdlib>#include <CL/sycl.hpp>#include <array>#include <map>#include <mpi.h>#include <stack>#include <string>#include <vector>#include “communication.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file blocked_binary_tree.hpp
- #include “compute_target.hpp”#include <map>#include <set>#include <type_traits>
- file cell_dat_const.hpp
- #include “../loop/particle_loop_base.hpp”#include “cell_data.hpp”
- file cell_data.hpp
- #include “../compute_target.hpp”
- file descendant_products.hpp
- #include “../compute_target.hpp”#include “../loop/access_descriptors.hpp”#include “../loop/particle_loop_base.hpp”#include “../loop/particle_loop_index.hpp”#include “../particle_spec.hpp”#include “product_matrix.hpp”
- file global_array.hpp
- #include “../compute_target.hpp”#include “../typedefs.hpp”#include “../communication.hpp”#include “../loop/access_descriptors.hpp”#include “../loop/particle_loop_base.hpp”#include <memory>#include <mpi.h>#include <optional>#include <vector>
- file local_array.hpp
- #include “../compute_target.hpp”#include “../loop/access_descriptors.hpp”#include “../loop/particle_loop_base.hpp”#include <memory>#include <optional>#include <vector>
- file product_matrix.hpp
- #include “../compute_target.hpp”#include “../loop/access_descriptors.hpp”#include “../loop/particle_loop_base.hpp”#include “../particle_spec.hpp”#include <map>#include <memory>#include <numeric>#include <optional>#include <vector>
- file sym_vector.hpp
- #include “../compute_target.hpp”#include “../loop/access_descriptors.hpp”#include “../loop/particle_loop_base.hpp”#include “../loop/particle_loop_index.hpp”#include “../particle_group.hpp”#include “../particle_spec.hpp”#include <initializer_list>#include <memory>#include <vector>
- file tuple.hpp
- #include <cstdlib>
- file departing_particle_identification.hpp
- #include <CL/sycl.hpp>#include <mpi.h>#include “communication.hpp”#include “compute_target.hpp”#include “particle_dat.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file departing_particle_identification_impl.hpp
- #include “departing_particle_identification.hpp”#include “loop/particle_loop.hpp”
- file domain.hpp
- #include “compute_target.hpp”#include “local_mapping.hpp”#include “mesh_hierarchy.hpp”#include “mesh_interface.hpp”#include “particle_dat.hpp”#include “typedefs.hpp”#include <cstdint>#include <cstdlib>#include <mpi.h>#include <set>#include <vector>
- file error_propagate.hpp
- #include “compute_target.hpp”
Defines
-
NESO_KERNEL_ASSERT(expr, ep_ptr)#
-
NESO_KERNEL_ASSERT(expr, ep_ptr)#
- file global_mapping.hpp
- #include <CL/sycl.hpp>#include <mpi.h>#include “domain.hpp”#include “error_propagate.hpp”#include “particle_dat.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file global_mapping_impl.hpp
- #include “global_mapping.hpp”#include “loop/particle_loop.hpp”
- file global_move.hpp
- #include <CL/sycl.hpp>#include <mpi.h>#include “cell_dat_compression.hpp”#include “communication.hpp”#include “compute_target.hpp”#include “departing_particle_identification.hpp”#include “global_move_exchange.hpp”#include “packing_unpacking.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file global_move_exchange.hpp
- #include <CL/sycl.hpp>#include <mpi.h>#include “communication.hpp”#include “compute_target.hpp”#include “packing_unpacking.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file local_mapping.hpp
- #include <CL/sycl.hpp>#include <memory>#include <mpi.h>#include “compute_target.hpp”#include “particle_dat.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file local_move.hpp
- #include <CL/sycl.hpp>#include <mpi.h>#include <set>#include <vector>#include “cell_dat_compression.hpp”#include “communication.hpp”#include “compute_target.hpp”#include “departing_particle_identification.hpp”#include “packing_unpacking.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file access_descriptors.hpp
- file particle_loop.hpp
- #include “../cell_dat.hpp”#include “../compute_target.hpp”#include “../containers/descendant_products.hpp”#include “../containers/global_array.hpp”#include “../containers/local_array.hpp”#include “../containers/product_matrix.hpp”#include “../containers/sym_vector.hpp”#include “../containers/tuple.hpp”#include “../particle_dat.hpp”#include “../particle_spec.hpp”#include “particle_loop_base.hpp”#include “particle_loop_index.hpp”#include “pli_particle_dat.hpp”#include <CL/sycl.hpp>#include <cstdlib>#include <optional>#include <string>#include <tuple>#include <typeinfo>#include <vector>
- file particle_loop_base.hpp
- #include “../compute_target.hpp”#include “access_descriptors.hpp”#include <memory>#include <optional>
- file particle_loop_index.hpp
- #include “../particle_group.hpp”#include “particle_loop_base.hpp”
- file pli_particle_dat.hpp
- #include “../loop/particle_loop_base.hpp”#include “../particle_group.hpp”
- file mesh_hierarchy.hpp
- #include “communication.hpp”#include “compute_target.hpp”#include “profiling.hpp”#include “typedefs.hpp”#include <cmath>#include <cstdint>#include <cstdlib>#include <memory>#include <mpi.h>#include <stack>#include <utility>#include <vector>
- file mesh_interface.hpp
- #include “mesh_hierarchy.hpp”#include “typedefs.hpp”#include <array>#include <cstdint>#include <cstdlib>#include <memory>#include <mpi.h>#include <set>#include <vector>
- file mesh_interface_local_decomp.hpp
- #include “mesh_interface.hpp”#include “typedefs.hpp”#include <cstdint>#include <cstdlib>#include <memory>#include <mpi.h>#include <set>#include <vector>
- file neso_particles.hpp
- #include <memory>#include “access.hpp”#include “boundary_conditions.hpp”#include “cartesian_mesh.hpp”#include “cell_binning.hpp”#include “cell_dat.hpp”#include “compute_target.hpp”#include “containers/blocked_binary_tree.hpp”#include “containers/descendant_products.hpp”#include “containers/global_array.hpp”#include “containers/local_array.hpp”#include “containers/product_matrix.hpp”#include “containers/sym_vector.hpp”#include “containers/tuple.hpp”#include “domain.hpp”#include “error_propagate.hpp”#include “global_mapping.hpp”#include “local_mapping.hpp”#include “local_move.hpp”#include “loop/particle_loop.hpp”#include “mesh_hierarchy.hpp”#include “mesh_interface.hpp”#include “mesh_interface_local_decomp.hpp”#include “parallel_initialisation.hpp”#include “particle_dat.hpp”#include “particle_group.hpp”#include “particle_io.hpp”#include “particle_remover.hpp”#include “particle_set.hpp”#include “particle_spec.hpp”#include “particle_sub_group.hpp”#include “profiling.hpp”#include “typedefs.hpp”#include “utility.hpp”#include “utility_mesh_hierarchy_plotting.hpp”#include “cell_dat_move_impl.hpp”#include “departing_particle_identification_impl.hpp”#include “global_mapping_impl.hpp”#include “particle_group_impl.hpp”
- file packing_unpacking.hpp
- #include <CL/sycl.hpp>#include <cstdint>#include <map>#include <memory>#include <mpi.h>#include <stack>#include <string>#include “compute_target.hpp”#include “particle_dat.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file parallel_initialisation.hpp
- #include “loop/particle_loop.hpp”#include “particle_group.hpp”#include <memory>
- file particle_dat.hpp
- #include <CL/sycl.hpp>#include <cmath>#include <functional>#include <limits>#include <memory>#include “access.hpp”#include “cell_dat.hpp”#include “compute_target.hpp”#include “loop/access_descriptors.hpp”#include “particle_set.hpp”#include “particle_spec.hpp”#include “typedefs.hpp”
- file particle_group.hpp
- #include <CL/sycl.hpp>#include <cstdint>#include <map>#include <memory>#include <mpi.h>#include <string>#include “access.hpp”#include “cell_dat.hpp”#include “cell_dat_compression.hpp”#include “cell_dat_move.hpp”#include “compute_target.hpp”#include “containers/product_matrix.hpp”#include “domain.hpp”#include “global_mapping.hpp”#include “global_move.hpp”#include “local_move.hpp”#include “packing_unpacking.hpp”#include “particle_dat.hpp”#include “particle_set.hpp”#include “particle_spec.hpp”#include “profiling.hpp”#include “typedefs.hpp”
- file particle_group_impl.hpp
- #include “containers/descendant_products.hpp”#include “global_mapping.hpp”#include “particle_group.hpp”#include “particle_sub_group.hpp”
- file particle_io.hpp
- #include “particle_group.hpp”#include “particle_spec.hpp”#include “typedefs.hpp”#include <algorithm>#include <cstdint>#include <cstring>#include <mpi.h>#include <string>
- file particle_remover.hpp
- #include “compute_target.hpp”#include “loop/particle_loop.hpp”#include “particle_dat.hpp”#include “particle_group.hpp”#include “typedefs.hpp”
- file particle_set.hpp
- #include <cstdint>#include <map>#include <string>#include <vector>#include “access.hpp”#include “compute_target.hpp”#include “particle_spec.hpp”#include “typedefs.hpp”
- file particle_spec.hpp
- #include <cstdint>#include <map>#include <mpi.h>#include <string>#include <vector>#include “typedefs.hpp”
- file particle_sub_group.hpp
- #include “compute_target.hpp”#include “loop/particle_loop.hpp”#include “particle_group.hpp”#include “typedefs.hpp”#include <map>#include <numeric>#include <random>#include <tuple>#include <type_traits>
- file profiling.hpp
- #include <CL/sycl.hpp>#include <chrono>#include <cstdint>#include <fstream>#include <list>#include <map>#include <mpi.h>#include <string>#include “typedefs.hpp”
- file typedefs.hpp
- #include <algorithm>#include <cmath>#include <cstdint>#include <cstdlib>#include <iostream>#include <mpi.h>#include <numeric>#include <vector>
Defines
-
NESOASSERT(expr, msg)#
This is a helper macro to call the function neso_particles_assert. Users should call this helper macro NESOASSERT like
NESOASSERT(conditional, message);
To check conditionals within their code.
-
NESOWARN(expr, msg)#
This is a helper macro to call the function neso_particles_warn. Users should call this helper macro NESOWARN like
NESOWARN(conditional, message);
To check conditionals within their code.
-
MIN(x, y)#
-
MAX(x, y)#
-
ABS(x)#
-
NESO_PARTICLES_BLOCK_SIZE#
-
NESO_PARTICLES_DEVICE_LABEL#
-
NESO_PARTICLES_ITER_PARTICLES#
-
NESO_PARTICLES_KERNEL_START#
-
NESO_PARTICLES_KERNEL_END#
-
NESO_PARTICLES_KERNEL_CELL#
-
NESO_PARTICLES_KERNEL_LAYER#
-
DEBUG_OOB_WIDTH#
-
NESOASSERT(expr, msg)#
- file utility.hpp
- #include <cstdint>#include <map>#include <random>#include <string>#include <vector>#include “access.hpp”#include “compute_target.hpp”#include “mesh_interface.hpp”#include “particle_spec.hpp”#include “typedefs.hpp”
- file utility_mesh_hierarchy_plotting.hpp
- #include “mesh_hierarchy.hpp”#include “typedefs.hpp”#include <cstdint>#include <fstream>#include <iostream>#include <map>#include <string>#include <tuple>#include <vector>
- dir /tmp/repo-checkout/NESO-Particles/include/containers
- dir /tmp/repo-checkout/NESO-Particles/include
- dir /tmp/repo-checkout/NESO-Particles/include/loop