hpc-patterns

Optimize C++20 HPC workloads with cache-friendly layouts, SIMD, and NUMA-aware memory.

40|8|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/ysyecust/everything-claude-code --skill hpc-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hpc-patterns
Source: https://github.com/ysyecust/everything-claude-code/tree/main/skills/hpc-patterns
Command: npx skills add https://github.com/ysyecust/everything-claude-code --skill hpc-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

High-performance computing applications often suffer from poor data locality and underutilized hardware. This Skill provides proven patterns to improve cache efficiency, vectorization, threading, and NUMA awareness.

Core Features & Use Cases

  • Cache-Friendly Data Structures: SoA vs AoS, layout-driven performance improvements for particle systems, matrices, and graphs.
  • SIMD Vectorization: Guidance on compiler hints, intrinsics, and portable SIMD strategies for uniform workloads.
  • Memory Management: Aligned allocators and memory pools to reduce fragmentation and improve bandwidth.
  • Thread Parallelism: Thread pools, parallel for patterns, and work-stealing strategies for scalable performance.
  • NUMA-Aware Allocation: Techniques to maximize memory locality on multi-socket systems.
  • Performance Measurement: Simple profiling and benchmarking guidance to quantify improvements.

Quick Start

Apply these patterns to a C++20 HPC project by converting a kernel to a Structure-of-Arrays layout, enabling SIMD pragmas, and integrating a 64-byte aligned allocator and a NUMA-aware allocation strategy.

Frequently Asked Questions about hpc-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve cache efficiency for particle systems in C++20?

To improve cache efficiency for particle systems in C++20, convert Array-of-Structs (AoS) layouts to Structure-of-Arrays (SoA) layouts. This cache-friendly data structure maximizes memory locality and significantly boosts computational kernel performance.

What's the best way to enable SIMD vectorization for uniform workloads?

The best way to enable SIMD vectorization is by applying compiler hints, utilizing intrinsics, and adopting portable SIMD strategies. These techniques optimize uniform workloads by allowing parallel processing of data elements.

Why does memory fragmentation reduce bandwidth in high-performance computing?

Memory fragmentation reduces bandwidth in high-performance computing by scattering memory allocations across non-contiguous blocks. Integrating 64-byte aligned allocators and memory pools resolves this, reducing fragmentation and improving bandwidth.

How do I maximize memory locality on multi-socket NUMA systems?

To maximize memory locality on multi-socket NUMA systems, apply NUMA-aware allocation techniques. This ensures memory is allocated on the same physical CPU socket as the accessing thread, preventing cross-socket latency.

Can I use thread pools and work-stealing strategies for scalable parallel performance?

Yes, you can achieve scalable parallel performance using thread pools, parallel for patterns, and work-stealing strategies. These thread parallelism techniques distribute computational workloads efficiently across available CPU cores.

How do I quantify performance improvements in physics simulations?

To quantify performance improvements in physics simulations, utilize simple profiling and benchmarking guidance. This measures the impact of cache-friendly layouts and vectorization, proving the effectiveness of the applied optimizations.