|
1 | 1 | // CSR data transfered to PETSc Copyright, Atsushi Suzuki 30 Jul.2025 |
2 | 2 | // |
3 | 3 | // A PETSc KSP (GMRES + GAMG algebraic multigrid preconditioner) benchmark: |
4 | | -// load a large sparse SPD matrix, solve Ax = b for a known x, report the |
5 | | -// relative L2 error and solve wall-time. |
| 4 | +// load the stokes2 sparse matrix (a Stokes flow saddle-point system, |
| 5 | +// 4.26M rows, generated via Gmsh/FreeFEM by Atsushi Suzuki), solve Ax = b |
| 6 | +// for a known x, report the relative L2 error and GMRES-iterate wall-time. |
6 | 7 | // |
7 | | -// Loads a pre-converted PETSc binary matrix via MatLoad() against |
8 | | -// PETSC_COMM_WORLD, so rows are properly partitioned across MPI ranks |
9 | | -// (memory per rank scales as O(1/ranks), as a real distributed benchmark |
10 | | -// should). The binary is produced once, offline, from the MatrixMarket |
11 | | -// form of the benchmark matrix (audikw_1, SuiteSparse Matrix Collection, |
12 | | -// GHS_psdef group) -- see this app's README.md for where each target |
13 | | -// system's copy lives and how it was produced. |
| 8 | +// The matrix is written directly to PETSc binary format via FreeFEM's |
| 9 | +// ObjectView (= MatView), so MatLoad() reads it without a conversion step. |
| 10 | +// Rows are partitioned across MPI ranks via MatLoad against |
| 11 | +// PETSC_COMM_WORLD (memory per rank scales as O(1/ranks), as a real |
| 12 | +// distributed benchmark should). See this app's README.md for where each |
| 13 | +// target system's copy of stokes2.dat lives and how it was generated. |
14 | 14 | static char help[] = "load a PETSc binary matrix and call the KSP solver\n"; |
15 | 15 |
|
16 | 16 | #include <petscksp.h> |
@@ -60,7 +60,7 @@ int main(int argc, char **args) |
60 | 60 | PetscCall(PetscOptionsGetString(NULL, NULL, "-f", fname, sizeof(fname), &flg)); |
61 | 61 | if (!flg) { |
62 | 62 | PetscCall(PetscPrintf(PETSC_COMM_WORLD, |
63 | | - "usage: %s -f <matrix.petscbin> [-ksp_monitor] [-pc_type gamg] [-log_view]\n", |
| 63 | + "usage: %s -f <stokes2.dat> [-ksp_monitor] [-pc_type gamg] [-log_view]\n", |
64 | 64 | args[0])); |
65 | 65 | PetscCall(PetscFinalize()); |
66 | 66 | exit(-1); |
|
0 commit comments