Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana_Grid_Parallel.hpp File Reference

Logical grid extension of Kokkos parallel iteration. More...

#include <Cabana_Grid_IndexSpace.hpp>
#include <Cabana_Grid_LocalGrid.hpp>
#include <Kokkos_Profiling_ScopedRegion.hpp>
#include <string>
Include dependency graph for Cabana_Grid_Parallel.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Cabana
 Core: particle data structures and algorithms.
 

Functions

template<class FunctorType, class ExecutionSpace, long N>
void Cabana::Grid::grid_parallel_for (const std::string &label, const ExecutionSpace &exec_space, const IndexSpace< N > &index_space, const FunctorType &functor)
 Execute a functor in parallel with a multidimensional execution policy specified by the given index space.
 
template<class FunctorType, class WorkTag, class ExecutionSpace, long N>
void Cabana::Grid::grid_parallel_for (const std::string &label, const ExecutionSpace &exec_space, const IndexSpace< N > &index_space, const WorkTag &work_tag, const FunctorType &functor)
 Execute a functor with a work tag in parallel with a multidimensional execution policy specified by the given index space.
 
template<class FunctorType, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType>
void Cabana::Grid::grid_parallel_for (const std::string &label, const ExecutionSpace &exec_space, const LocalGrid< MeshType > &local_grid, const DecompositionType &decomposition, const EntityType &entity_type, const FunctorType &functor)
 Execute a functor in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.
 
template<class FunctorType, class WorkTag, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType>
void Cabana::Grid::grid_parallel_for (const std::string &label, const ExecutionSpace &exec_space, const LocalGrid< MeshType > &local_grid, const DecompositionType &decomposition, const EntityType &entity_type, const WorkTag &work_tag, const FunctorType &functor)
 Execute a functor with a work tag in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.
 
template<class FunctorType, class ExecutionSpace, std::size_t NumSpace>
void Cabana::Grid::grid_parallel_for (const std::string &label, const ExecutionSpace &exec_space, const Kokkos::Array< IndexSpace< 4 >, NumSpace > &index_spaces, const FunctorType &functor)
 Execute a functor in parallel with a linear execution policy specified by the set of given index spaces. 4D specialization.
 
template<class FunctorType, class ExecutionSpace, std::size_t NumSpace>
void Cabana::Grid::grid_parallel_for (const std::string &label, const ExecutionSpace &exec_space, const Kokkos::Array< IndexSpace< 3 >, NumSpace > &index_spaces, const FunctorType &functor)
 Execute a functor in parallel with a linear execution policy specified by the set of given index spaces. 3D specialization.
 
template<class FunctorType, class ExecutionSpace, std::size_t NumSpace>
void Cabana::Grid::grid_parallel_for (const std::string &label, const ExecutionSpace &exec_space, const Kokkos::Array< IndexSpace< 2 >, NumSpace > &index_spaces, const FunctorType &functor)
 Execute a functor in parallel with a linear execution policy specified by the set of given index spaces. 2D specialization.
 
template<class FunctorType, class ExecutionSpace, long N, class ReduceType>
void Cabana::Grid::grid_parallel_reduce (const std::string &label, const ExecutionSpace &exec_space, const IndexSpace< N > &index_space, const FunctorType &functor, ReduceType &reducer)
 Execute a reduction functor in parallel with a multidimensional execution policy specified by the given index space.
 
template<class FunctorType, class WorkTag, class ExecutionSpace, long N, class ReduceType>
void Cabana::Grid::grid_parallel_reduce (const std::string &label, const ExecutionSpace &exec_space, const IndexSpace< N > &index_space, const WorkTag &work_tag, const FunctorType &functor, ReduceType &reducer)
 Execute a reduction functor with a work tag in parallel with a multidimensional execution policy specified by the given index space.
 
template<class FunctorType, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType, class ReduceType>
void Cabana::Grid::grid_parallel_reduce (const std::string &label, const ExecutionSpace &exec_space, const LocalGrid< MeshType > &local_grid, const DecompositionType &decomposition, const EntityType &entity_type, const FunctorType &functor, ReduceType &reducer)
 Execute a reduction functor in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.
 
template<class FunctorType, class WorkTag, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType, class ReduceType>
void Cabana::Grid::grid_parallel_reduce (const std::string &label, const ExecutionSpace &exec_space, const LocalGrid< MeshType > &local_grid, const DecompositionType &decomposition, const EntityType &entity_type, const WorkTag &work_tag, const FunctorType &functor, ReduceType &reducer)
 Execute a reduction functor with a work tag in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.
 

Detailed Description

Logical grid extension of Kokkos parallel iteration.

Function Documentation

◆ grid_parallel_for() [1/7]

template<class FunctorType, class ExecutionSpace, long N>
void Cabana::Grid::grid_parallel_for ( const std::string & label,
const ExecutionSpace & exec_space,
const IndexSpace< N > & index_space,
const FunctorType & functor )
inline

Execute a functor in parallel with a multidimensional execution policy specified by the given index space.

Template Parameters
FunctorTypeThe functor type to execute.
ExecutionSpaceThe execution space type.
NThe dimension of the index space.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
index_spaceThe index space over which to loop.
functorThe functor to execute.

◆ grid_parallel_for() [2/7]

template<class FunctorType, class WorkTag, class ExecutionSpace, long N>
void Cabana::Grid::grid_parallel_for ( const std::string & label,
const ExecutionSpace & exec_space,
const IndexSpace< N > & index_space,
const WorkTag & work_tag,
const FunctorType & functor )
inline

Execute a functor with a work tag in parallel with a multidimensional execution policy specified by the given index space.

Template Parameters
FunctorTypeThe functor type to execute.
WorkTagThe functor execution tag.
ExecutionSpaceThe execution space type.
NThe dimension of the index space.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
index_spaceThe index space over which to loop.
work_tagThe functor execution tag.
functorThe functor to execute.

◆ grid_parallel_for() [3/7]

template<class FunctorType, class ExecutionSpace, std::size_t NumSpace>
void Cabana::Grid::grid_parallel_for ( const std::string & label,
const ExecutionSpace & exec_space,
const Kokkos::Array< IndexSpace< 2 >, NumSpace > & index_spaces,
const FunctorType & functor )
inline

Execute a functor in parallel with a linear execution policy specified by the set of given index spaces. 2D specialization.

Template Parameters
FunctorTypeThe functor type to execute.
ExecutionSpaceThe execution space type.
NumSpaceThe number of index spaces.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
index_spacesThe set of index spaces over which to loop.
functorThe functor to execute. Signature is f(space_id,i,j) space_id is the index of the index space in index_spaces.

◆ grid_parallel_for() [4/7]

template<class FunctorType, class ExecutionSpace, std::size_t NumSpace>
void Cabana::Grid::grid_parallel_for ( const std::string & label,
const ExecutionSpace & exec_space,
const Kokkos::Array< IndexSpace< 3 >, NumSpace > & index_spaces,
const FunctorType & functor )
inline

Execute a functor in parallel with a linear execution policy specified by the set of given index spaces. 3D specialization.

Template Parameters
FunctorTypeThe functor type to execute.
ExecutionSpaceThe execution space type.
NumSpaceThe number of index spaces.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
index_spacesThe set of index spaces over which to loop.
functorThe functor to execute. Signature is f(space_id,i,j,k) space_id is the index of the index space in index_spaces.

◆ grid_parallel_for() [5/7]

template<class FunctorType, class ExecutionSpace, std::size_t NumSpace>
void Cabana::Grid::grid_parallel_for ( const std::string & label,
const ExecutionSpace & exec_space,
const Kokkos::Array< IndexSpace< 4 >, NumSpace > & index_spaces,
const FunctorType & functor )
inline

Execute a functor in parallel with a linear execution policy specified by the set of given index spaces. 4D specialization.

Template Parameters
FunctorTypeThe functor type to execute.
ExecutionSpaceThe execution space type.
NumSpaceThe number of index spaces.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
index_spacesThe set of index spaces over which to loop.
functorThe functor to execute. Signature is f(space_id,i,j,k,l) space_id is the index of the index space in index_spaces.

◆ grid_parallel_for() [6/7]

template<class FunctorType, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType>
void Cabana::Grid::grid_parallel_for ( const std::string & label,
const ExecutionSpace & exec_space,
const LocalGrid< MeshType > & local_grid,
const DecompositionType & decomposition,
const EntityType & entity_type,
const FunctorType & functor )
inline

Execute a functor in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.

Template Parameters
FunctorTypeThe functor type to execute.
ExecutionSpaceThe execution space type.
MeshTypeThe mesh type of the local grid.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
local_gridThe local grid to iterate over.
decompositionThe decomposition type of the entities (own,ghost).
entity_typeThe entity type over which to loop.
functorThe functor to execute.

◆ grid_parallel_for() [7/7]

template<class FunctorType, class WorkTag, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType>
void Cabana::Grid::grid_parallel_for ( const std::string & label,
const ExecutionSpace & exec_space,
const LocalGrid< MeshType > & local_grid,
const DecompositionType & decomposition,
const EntityType & entity_type,
const WorkTag & work_tag,
const FunctorType & functor )
inline

Execute a functor with a work tag in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.

Template Parameters
FunctorTypeThe functor type to execute.
WorkTagThe functor work tag.
ExecutionSpaceThe execution space type.
MeshTypeThe mesh type of the local grid.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
local_gridThe local grid to iterate over.
decompositionThe decomposition type of the entities (own,ghost).
entity_typeThe entity type over which to loop.
work_tagThe functor execution tag.
functorThe functor to execute.

◆ grid_parallel_reduce() [1/4]

template<class FunctorType, class ExecutionSpace, long N, class ReduceType>
void Cabana::Grid::grid_parallel_reduce ( const std::string & label,
const ExecutionSpace & exec_space,
const IndexSpace< N > & index_space,
const FunctorType & functor,
ReduceType & reducer )
inline

Execute a reduction functor in parallel with a multidimensional execution policy specified by the given index space.

Template Parameters
FunctorTypeThe functor type to execute.
ExecutionSpaceThe execution space type.
NThe dimension of the index space.
ReduceTypeThe reduction type.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
index_spaceThe index space over which to loop.
functorThe functor to execute.
reducerThe parallel reduce result.

◆ grid_parallel_reduce() [2/4]

template<class FunctorType, class WorkTag, class ExecutionSpace, long N, class ReduceType>
void Cabana::Grid::grid_parallel_reduce ( const std::string & label,
const ExecutionSpace & exec_space,
const IndexSpace< N > & index_space,
const WorkTag & work_tag,
const FunctorType & functor,
ReduceType & reducer )
inline

Execute a reduction functor with a work tag in parallel with a multidimensional execution policy specified by the given index space.

Template Parameters
FunctorTypeThe functor type to execute.
WorkTagThe functor execution tag.
ExecutionSpaceThe execution space type.
NThe dimension of the index space.
ReduceTypeThe reduction type.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
index_spaceThe index space over which to loop.
work_tagThe functor execution tag.
functorThe functor to execute.
reducerThe parallel reduce result.

◆ grid_parallel_reduce() [3/4]

template<class FunctorType, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType, class ReduceType>
void Cabana::Grid::grid_parallel_reduce ( const std::string & label,
const ExecutionSpace & exec_space,
const LocalGrid< MeshType > & local_grid,
const DecompositionType & decomposition,
const EntityType & entity_type,
const FunctorType & functor,
ReduceType & reducer )
inline

Execute a reduction functor in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.

Template Parameters
FunctorTypeThe functor type to execute.
ExecutionSpaceThe execution space type.
MeshTypeThe mesh type of the local grid.
ReduceTypeThe reduction type.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
local_gridThe local grid to iterate over.
decompositionThe decomposition type of the entities (own,ghost).
entity_typeThe entity type over which to loop.
functorThe functor to execute.
reducerThe parallel reduce result.

◆ grid_parallel_reduce() [4/4]

template<class FunctorType, class WorkTag, class ExecutionSpace, class MeshType, class DecompositionType, class EntityType, class ReduceType>
void Cabana::Grid::grid_parallel_reduce ( const std::string & label,
const ExecutionSpace & exec_space,
const LocalGrid< MeshType > & local_grid,
const DecompositionType & decomposition,
const EntityType & entity_type,
const WorkTag & work_tag,
const FunctorType & functor,
ReduceType & reducer )
inline

Execute a reduction functor with a work tag in parallel with a multidimensional execution policy specified by the given local grid, decomposition, and entity type. The loop indices are local.

Template Parameters
FunctorTypeThe functor type to execute.
WorkTagThe functor work tag.
ExecutionSpaceThe execution space type.
MeshTypeThe mesh type of the local grid.
ReduceTypeThe reduction type.
Parameters
labelParallel region label.
exec_spaceAn execution space instance.
decompositionThe decomposition type of the entities (own,ghost).
local_gridThe local grid to iterate over.
entity_typeThe entity type over which to loop.
work_tagThe functor execution tag.
functorThe functor to execute.
reducerThe parallel reduce result.