github xiaoyeli/superlu_dist v9.3.0

pre-release3 hours ago

Two new features

  1. Variable-size batched solver interface.

    Using the batch feature in EXAMPLE/pddrive3d.c

  • Turn it on from the command line with -b <N>: mpirun -n <P> ./pddrive3d -b <N> <matrix-file>. This sets the local batchCount variable via case 'b': batchCount = atoi(*cpp); in the arg-parsing loop.
  • What "batch" means here: the driver solves batchCount independent sparse linear systems in one call, instead of one. The sizes and sparsity patterns of the systems in the batch can be different.
  • The batch path is a separate branch in main(), guarded by if ( batchCount > 0 ) { ... } else { ...normal path... }. It builds one SuperMatrix handle per batch entry (handle_t *SparseMatrix_handles, size batchCount), then calls a single batched solver, pdgssvx3d_csc_batch(), instead of pdgssvx3d().
  • Every per-system quantity is arrays of length batchCount, not scalars: right-hand sides (RHSptr, ldRHS), solutions (Xptr, ldX), equilibration scale factors (ReqPtr, CeqPtr, DiagScale), row/column pivots (RpivPtr, CpivPtr), and backward errors (Berrs). If you adapt this pattern for your own matrices, you allocate and fill one slot per system in each of these arrays before calling pdgssvx3d_csc_batch().
  • Results come back per-system: after the call, Berrs[d][0] holds the backward error for system d, and the driver prints it in a loop (for (int d = 0; d < batchCount; ++d) printf(...)). Remember to free each per-system allocation (as the driver does) before freeing the outer arrays.
  1. GPU-resident sparse triangular solvers.

    Using the GPU-resident-solve (GPURES) feature in EXAMPLE/pddrive3d.c

  • Turn it on from the command line with -g <0|1>: mpirun -n <P> ./pddrive3d -r <nprow> -c <npcol> -d <npdep> -g 1 <matrix-file>. This sets the local gpures variable via case 'g': gpures = atoi(*cpp); in the arg-parsing loop; the default is -1 (unset).
  • What it changes: normally the right-hand side b lives on the host and is copied to/from the GPU internally on every call. With options.GPURES == YES, the driver instead moves b to the GPU once, up front, and hands pdgssvx3d() the device pointer directly — the whole solve (equilibration, permutation, triangular solve) keeps the vector resident on the GPU instead of round-tripping through the host each step.
  • This needs a build with GPU support: the GPURES code paths are wrapped in #ifdef GPU_ACC. If you request -g 1 on a build compiled without GPU acceleration, the driver aborts: ABORT("GPURES requires GPU_ACC in pddrive3d."); — so make sure SuperLU_DIST was built with TPL_ENABLE_CUDALIB/TPL_ENABLE_HIPLIB (or the equivalent GPU option) turned on.
  • The pattern to follow if you adapt this: before the solve, allocate a device buffer and copy b onto it (gpuMalloc + gpuMemcpy(..., gpuMemcpyHostToDevice)); call pdgssvx3d() passing that device pointer (d_b) instead of the host array; after the solve, copy the result back to the host buffer (gpuMemcpy(..., gpuMemcpyDeviceToHost)) and free the device buffer (gpuFree) — b on the host then holds the solution exactly as it would in the non-GPURES path.
  • Everything else about the run stays the same: the process grid (-r/-c/-d), matrix input, right-hand-side setup, and result checking are unchanged — -g only controls whether the RHS/solution vector is kept resident on the GPU during the solve rather than shuttled back and forth.

What's Changed

  • Merge variable-sized batched branch to master by @SidShi in #213
  • Skip OpenMP taskloop constructs when using the Fujitsu C compiler by @jamtrott in #214
  • ROCm versioning fix by @Heinrich-BR in #215
  • fix compile errors with gcc-16 by @balay in #219
  • Merge master into amd_batch by @xiaoyeli in #221
  • Merge gpures_solve into master (GPU-resident solve) by @xiaoyeli in #222
  • Fix Windows/MSVC build issues by @jhale in #225
  • Fix pkg-config Libs.private using un-flattened, semicolon-joined variables by @jhale in #224

New Contributors

Full Changelog: v9.2.1...v9.3.0

Don't miss a new superlu_dist release

NewReleases is sending notifications on new releases.