pytc.solver.xtc_ccsd._run_tiled_block_pipeline

pytc.solver.xtc_ccsd._run_tiled_block_pipeline(blocks, nvir, panel_blk, nocc, xtc_obj, jastrow_params, devices, writer=None)[source]

Run a single multi-GPU tiled pipeline over one or more ERI blocks.

All blocks are interleaved in one _round_robin_pipeline call so GPUs stay continuously occupied across block boundaries.

Parameters:
  • blocks (list[_TiledBlockSpec]) – Blocks to compute, in the order their tiles should be scheduled.

  • nvir (int) – Virtual dimension size, tile size, and occupied dimension size.

  • panel_blk (int) – Virtual dimension size, tile size, and occupied dimension size.

  • nocc (int) – Virtual dimension size, tile size, and occupied dimension size.

  • xtc_obj (XTC object and parameters) – Passed through to compute_2b_tile.

  • jastrow_params (XTC object and parameters) – Passed through to compute_2b_tile.

  • devices (sequence) – Local devices for round-robin dispatch.

  • writer (_AsyncHDF5Writer, optional) –

    When provided, tile writes are submitted to this background writer instead of running on the pipeline consumer thread under a local lock. This is the desired mode for HDF5-backed write_fn (e.g. ovvv/vovv in _compute_large_blocks) because:

    • a single writer thread inherently serialises HDF5 access (the library is not thread-safe), replacing the previous acc_lock without adding contention;

    • the consume thread returns to the host_sem pool in microseconds, so the dispatch thread never stalls on slot availability, keeping all GPUs continuously fed even when the backing store is slow.

    When writer is None (the default — used by the in-memory medium-blocks path) writes run inline under a per-pipeline lock; for NumPy target arrays this is fast and avoids spawning an unnecessary background thread.