specfem::parallel_configuration

namespace parallel_configuration

Configuration parameters for parallel execution policies.

This namespace provides configuration structures and constants for parallel execution policies, including chunk sizes, tile sizes, and thread counts optimized for different hardware backends.

specfem::parallel_configuration::chunk_config

template<specfem::dimension::type DimensionTag, int ChunkSize, int TileSize, int NumThreads, int VectorLanes, typename SIMD, typename ExecutionSpace>
struct chunk_config

Parallel execution configuration for element chunks.

using config = chunk_config<dim2, 32, 32, 512, 1, simd_type,
Kokkos::DefaultExecutionSpace>;
specfem::execution::ChunkedDomainIterator<config> iterator;

See also

specfem::execution

Template Parameters:
  • DimensionTag – Spatial dimension (dim2/dim3)

  • ChunkSize – Elements per chunk

  • TileSize – Tile size for memory coalescing

  • NumThreads – Team threads count

  • VectorLanes – Vector lane width

  • SIMD – SIMD type for vectorization

Public Types

using simd = SIMD

SIMD type.

using execution_space = ExecutionSpace

Execution space.

Public Static Attributes

static constexpr int num_threads = NumThreads

Number of threads.

static constexpr int vector_lanes = VectorLanes

Number of vector lanes.

static constexpr int tile_size = TileSize

Tile size.

static constexpr int chunk_size = ChunkSize

Chunk size.

static constexpr auto dimension = DimensionTag

Dimension type of the elements within chunk.

specfem::parallel_configuration::edge_config

template<specfem::dimension::type DimensionTag, int NumThreads, int VectorLanes, typename ExecutionSpace>
struct edge_config

Parallel execution configuration for edge operations.

using config = edge_config<dim2, 32, 1, Kokkos::Cuda>;
// Use config in specfem::execution::EdgeIterator<config>

See also

specfem::execution

Template Parameters:
  • DimensionTag – Spatial dimension (dim2/dim3)

  • NumThreads – Thread count per team

  • VectorLanes – Vector lane width

  • ExecutionSpace – Kokkos execution space

Public Types

using execution_space = ExecutionSpace

Execution space.

Public Static Attributes

static constexpr auto dimension = DimensionTag

Dimension type.

static constexpr int num_threads = NumThreads

Number of threads.

static constexpr int vector_lanes = VectorLanes

Vector lanes.

specfem::parallel_configuration::edge_chunk_config

template<specfem::dimension::type DimensionTag, int ChunkSize, typename ExecutionSpace>
struct edge_chunk_config

Parallel configuration for edge chunk processing.

using config = edge_chunk_config<dim2, 32, Kokkos::Cuda>;
// Use config in specfem::execution::ChunkedEdgeIterator<config>

See also

specfem::execution

Template Parameters:
  • DimensionTag – Spatial dimension (dim2/dim3)

  • ChunkSize – Number of edges processed per chunk

  • ExecutionSpace – Kokkos execution space

Public Types

using execution_space = ExecutionSpace

Execution space.

Public Static Attributes

static constexpr auto dimension = DimensionTag

Dimension type.

static constexpr int chunk_size = ChunkSize

Number of edges per chunk.

specfem::parallel_configuration::range_config

template<typename SIMD, typename ExecutionSpace, std::size_t ChunkSize, std::size_t TileSize>
struct range_config

Configuration for parallel range-based operations.

using config = range_config<simd_type, Kokkos::Cuda, 1024, 32>;
specfem::execution::RangeIterator<config> iterator;

Template Parameters:
  • SIMD – SIMD vectorization type

  • ExecutionSpace – Kokkos execution space

  • ChunkSize – Elements per processing chunk

  • TileSize – Memory tiling size

Architecture-specific default configurations

template<specfem::dimension::type DimensionTag, typename SIMD, typename ExecutionSpace>
struct default_chunk_config

Platform-optimized chunk configuration defaults.

Automatically selects optimal chunk parameters based on execution space.

using config = default_chunk_config<dim2, simd_type, Kokkos::Cuda>;
// Automatically uses: chunk_size=32, num_threads=512 for CUDA

Template Parameters:
  • DimensionTag – Spatial dimension

  • SIMD – SIMD vectorization type

  • ExecutionSpace – Kokkos execution space

template<specfem::dimension::type DimensionTag, typename ExecutionSpace>
struct default_edge_config

Platform-optimized edge configuration defaults.

Automatically selects optimal thread and vector lane counts:

  • CUDA/HIP: 32 threads, 1 vector lane

  • OpenMP/Serial: 1 thread, 1 vector lane

using config = default_edge_config<dim2, Kokkos::Cuda>;
// Automatically uses: num_threads=32, vector_lanes=1 for CUDA

Template Parameters:
  • DimensionTag – Spatial dimension

  • ExecutionSpace – Kokkos execution space

template<specfem::dimension::type DimensionTag, typename ExecutionSpace>
struct default_chunk_edge_config

Platform-optimized edge chunk configuration defaults.

Automatically selects optimal edge chunk sizes based on execution space:

  • CUDA: 32 edges per chunk

  • HIP: 64 edges per chunk

  • OpenMP/Serial: 1 edge per chunk

using config = default_chunk_edge_config<dim2, Kokkos::Cuda>;
// Automatically uses chunk_size=32 for CUDA

See also

specfem::execution

Template Parameters:
  • DimensionTag – Spatial dimension

  • ExecutionSpace – Kokkos execution space

template<typename SIMD, typename ExecutionSpace>
using specfem::parallel_configuration::default_range_config = range_config<SIMD, ExecutionSpace, 1, 1>

Default range configuration with minimal chunking.

Uses chunk_size=1 and tile_size=1 for simple point-wise operations.

using config = default_range_config<simd_type, Kokkos::OpenMP>;
// Automatically uses: chunk_size=1, tile_size=1

Template Parameters:
  • SIMD – SIMD vectorization type

  • ExecutionSpace – Kokkos execution space