Actual source code: ex62.c

  1: static char help[] = "Test Matrix products for AIJ matrices\n\
  2: Input arguments are:\n\
  3:   -fA <input_file> -fB <input_file> -fC <input_file>: file to load\n\n";
  4: /* Example of usage:
  5:    ./ex62 -fA <A_binary> -fB <B_binary>
  6:    mpiexec -n 3 ./ex62 -fA medium -fB medium
  7: */

  9: #include <petscmat.h>

 11: /*
 12:      B = A - B
 13:      norm = norm(B)
 14: */
 15: PetscErrorCode MatNormDifference(Mat A, Mat B, PetscReal *norm)
 16: {
 17:   PetscFunctionBegin;
 18:   PetscCall(MatAXPY(B, -1.0, A, DIFFERENT_NONZERO_PATTERN));
 19:   PetscCall(MatNorm(B, NORM_FROBENIUS, norm));
 20:   PetscFunctionReturn(PETSC_SUCCESS);
 21: }

 23: int main(int argc, char **args)
 24: {
 25:   Mat          A, A_save, B, C, P, C1, R;
 26:   PetscViewer  viewer;
 27:   PetscMPIInt  size, rank;
 28:   PetscInt     i, j, *idxn, PM, PN = PETSC_DECIDE, rstart, rend;
 29:   PetscReal    norm;
 30:   PetscRandom  rdm;
 31:   char         file[2][PETSC_MAX_PATH_LEN] = {{0}};
 32:   PetscScalar *a, rval, alpha;
 33:   PetscBool    Test_MatMatMult = PETSC_TRUE, Test_MatTrMat = PETSC_TRUE, Test_MatMatTr = PETSC_TRUE;
 34:   PetscBool    Test_MatPtAP = PETSC_TRUE, Test_MatRARt = PETSC_TRUE, flg, seqaij, flgA, flgB;
 35:   MatInfo      info;
 36:   PetscInt     nzp = 5; /* num of nonzeros in each row of P */
 37:   MatType      mattype;
 38:   char         A_mattype[256], B_mattype[256];
 39:   PetscInt     mcheck = 10;

 41:   PetscFunctionBeginUser;
 42:   PetscCall(PetscInitialize(&argc, &args, NULL, help));
 43:   PetscCallMPI(MPI_Comm_size(PETSC_COMM_WORLD, &size));
 44:   PetscCallMPI(MPI_Comm_rank(PETSC_COMM_WORLD, &rank));

 46:   /*  Load the matrices A_save and B */
 47:   PetscOptionsBegin(PETSC_COMM_WORLD, "", "", "");
 48:   PetscCall(PetscOptionsBool("-test_rart", "Test MatRARt", "", Test_MatRARt, &Test_MatRARt, NULL));
 49:   PetscCall(PetscOptionsInt("-PN", "Number of columns of P", "", PN, &PN, NULL));
 50:   PetscCall(PetscOptionsInt("-mcheck", "Number of matmult checks", "", mcheck, &mcheck, NULL));
 51:   PetscCall(PetscOptionsString("-fA", "Path for matrix A", "", file[0], file[0], sizeof(file[0]), &flg));
 52:   PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_USER_INPUT, "Must indicate a file name for matrix A with the -fA option.");
 53:   PetscCall(PetscOptionsString("-fB", "Path for matrix B", "", file[1], file[1], sizeof(file[1]), &flg));
 54:   PetscCall(PetscOptionsFList("-A_mat_type", "Matrix type", "MatSetType", MatList, MATAIJ, A_mattype, sizeof(A_mattype), &flgA));
 55:   PetscCall(PetscOptionsFList("-B_mat_type", "Matrix type", "MatSetType", MatList, MATAIJ, B_mattype, sizeof(B_mattype), &flgB));
 56:   PetscOptionsEnd();

 58:   PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, file[0], FILE_MODE_READ, &viewer));
 59:   PetscCall(MatCreate(PETSC_COMM_WORLD, &A_save));
 60:   PetscCall(MatLoad(A_save, viewer));
 61:   PetscCall(PetscViewerDestroy(&viewer));

 63:   if (flg) {
 64:     PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, file[1], FILE_MODE_READ, &viewer));
 65:     PetscCall(MatCreate(PETSC_COMM_WORLD, &B));
 66:     PetscCall(MatLoad(B, viewer));
 67:     PetscCall(PetscViewerDestroy(&viewer));
 68:   } else {
 69:     PetscCall(PetscObjectReference((PetscObject)A_save));
 70:     B = A_save;
 71:   }

 73:   if (flgA) PetscCall(MatConvert(A_save, A_mattype, MAT_INPLACE_MATRIX, &A_save));
 74:   if (flgB) PetscCall(MatConvert(B, B_mattype, MAT_INPLACE_MATRIX, &B));
 75:   PetscCall(MatSetFromOptions(A_save));
 76:   PetscCall(MatSetFromOptions(B));

 78:   PetscCall(MatGetType(B, &mattype));

 80:   PetscCall(PetscMalloc2(nzp, &idxn, nzp, &a));

 82:   PetscCall(PetscRandomCreate(PETSC_COMM_WORLD, &rdm));
 83:   PetscCall(PetscRandomSetFromOptions(rdm));

 85:   /* 1) MatMatMult() */
 86:   /* ----------------*/
 87:   if (Test_MatMatMult) {
 88:     PetscCall(MatDuplicate(A_save, MAT_COPY_VALUES, &A));

 90:     /* (1.1) Test developer API */
 91:     PetscCall(MatProductCreate(A, B, NULL, &C));
 92:     PetscCall(MatSetOptionsPrefix(C, "AB_"));
 93:     PetscCall(MatProductSetType(C, MATPRODUCT_AB));
 94:     PetscCall(MatProductSetAlgorithm(C, MATPRODUCTALGORITHMDEFAULT));
 95:     PetscCall(MatProductSetFill(C, PETSC_DETERMINE));
 96:     PetscCall(MatProductSetFromOptions(C));
 97:     /* we can inquire about MATOP_PRODUCTSYMBOLIC even if the destination matrix type has not been set yet */
 98:     PetscCall(MatHasOperation(C, MATOP_PRODUCTSYMBOLIC, &flg));
 99:     PetscCall(MatProductSymbolic(C));
100:     PetscCall(MatProductNumeric(C));
101:     PetscCall(MatMatMultEqual(A, B, C, mcheck, &flg));
102:     PetscCheck(flg, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in C=A*B");

104:     /* Test reuse symbolic C */
105:     alpha = 0.9;
106:     PetscCall(MatScale(A, alpha));
107:     PetscCall(MatProductNumeric(C));

109:     PetscCall(MatMatMultEqual(A, B, C, mcheck, &flg));
110:     PetscCheck(flg, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in C=A*B");
111:     PetscCall(MatDestroy(&C));

113:     /* (1.2) Test user driver */
114:     PetscCall(MatMatMult(A, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));

116:     /* Test MAT_REUSE_MATRIX - reuse symbolic C */
117:     alpha = 1.0;
118:     for (i = 0; i < 2; i++) {
119:       alpha -= 0.1;
120:       PetscCall(MatScale(A, alpha));
121:       PetscCall(MatMatMult(A, B, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));
122:     }
123:     PetscCall(MatMatMultEqual(A, B, C, mcheck, &flg));
124:     PetscCheck(flg, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error: MatMatMult()");
125:     PetscCall(MatDestroy(&A));

127:     /* Test MatProductClear() */
128:     PetscCall(MatProductClear(C));
129:     PetscCall(MatDestroy(&C));

131:     /* Test MatMatMult() for dense and aij matrices */
132:     PetscCall(PetscObjectTypeCompareAny((PetscObject)A, &flg, MATSEQAIJ, MATMPIAIJ, ""));
133:     if (flg) {
134:       PetscCall(MatConvert(A_save, MATDENSE, MAT_INITIAL_MATRIX, &A));
135:       PetscCall(MatMatMult(A, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
136:       PetscCall(MatDestroy(&C));
137:       PetscCall(MatDestroy(&A));
138:     }
139:   }

141:   /* Create P and R = P^T  */
142:   /* --------------------- */
143:   PetscCall(MatGetSize(B, &PM, NULL));
144:   if (PN < 0) PN = PM / 2;
145:   PetscCall(MatCreate(PETSC_COMM_WORLD, &P));
146:   PetscCall(MatSetSizes(P, PETSC_DECIDE, PETSC_DECIDE, PM, PN));
147:   PetscCall(MatSetType(P, MATAIJ));
148:   PetscCall(MatSeqAIJSetPreallocation(P, nzp, NULL));
149:   PetscCall(MatMPIAIJSetPreallocation(P, nzp, NULL, nzp, NULL));
150:   PetscCall(MatGetOwnershipRange(P, &rstart, &rend));
151:   for (i = 0; i < nzp; i++) PetscCall(PetscRandomGetValue(rdm, &a[i]));
152:   for (i = rstart; i < rend; i++) {
153:     for (j = 0; j < nzp; j++) {
154:       PetscCall(PetscRandomGetValue(rdm, &rval));
155:       idxn[j] = (PetscInt)(PetscRealPart(rval) * PN);
156:     }
157:     PetscCall(MatSetValues(P, 1, &i, nzp, idxn, a, ADD_VALUES));
158:   }
159:   PetscCall(MatAssemblyBegin(P, MAT_FINAL_ASSEMBLY));
160:   PetscCall(MatAssemblyEnd(P, MAT_FINAL_ASSEMBLY));

162:   PetscCall(MatTranspose(P, MAT_INITIAL_MATRIX, &R));
163:   PetscCall(MatConvert(P, mattype, MAT_INPLACE_MATRIX, &P));
164:   PetscCall(MatConvert(R, mattype, MAT_INPLACE_MATRIX, &R));
165:   PetscCall(MatSetFromOptions(P));
166:   PetscCall(MatSetFromOptions(R));

168:   /* 2) MatTransposeMatMult() */
169:   /* ------------------------ */
170:   if (Test_MatTrMat) {
171:     /* (2.1) Test developer driver C = P^T*B */
172:     PetscCall(MatProductCreate(P, B, NULL, &C));
173:     PetscCall(MatSetOptionsPrefix(C, "AtB_"));
174:     PetscCall(MatProductSetType(C, MATPRODUCT_AtB));
175:     PetscCall(MatProductSetAlgorithm(C, MATPRODUCTALGORITHMDEFAULT));
176:     PetscCall(MatProductSetFill(C, PETSC_DETERMINE));
177:     PetscCall(MatProductSetFromOptions(C));
178:     PetscCall(MatHasOperation(C, MATOP_PRODUCTSYMBOLIC, &flg));
179:     if (flg) {                                                 /* run tests if supported */
180:       PetscCall(MatProductSymbolic(C));                        /* equivalent to MatSetUp() */
181:       PetscCall(MatSetOption(C, MAT_USE_INODES, PETSC_FALSE)); /* illustrate how to call MatSetOption() */
182:       PetscCall(MatProductNumeric(C));
183:       PetscCall(MatProductNumeric(C)); /* test reuse symbolic C */

185:       PetscCall(MatTransposeMatMultEqual(P, B, C, mcheck, &flg));
186:       PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error: developer driver C = P^T*B");
187:       PetscCall(MatDestroy(&C));

189:       /* (2.2) Test user driver C = P^T*B */
190:       PetscCall(MatTransposeMatMult(P, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
191:       PetscCall(MatTransposeMatMult(P, B, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));
192:       PetscCall(MatGetInfo(C, MAT_GLOBAL_SUM, &info));
193:       PetscCall(MatProductClear(C));

195:       /* Compare P^T*B and R*B */
196:       PetscCall(MatMatMult(R, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C1));
197:       PetscCall(MatNormDifference(C, C1, &norm));
198:       PetscCheck(norm <= PETSC_SMALL, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatTransposeMatMult(): %g", (double)norm);
199:       PetscCall(MatDestroy(&C1));

201:       /* Test MatDuplicate() of C=P^T*B */
202:       PetscCall(MatDuplicate(C, MAT_COPY_VALUES, &C1));
203:       PetscCall(MatDestroy(&C1));
204:     } else {
205:       PetscCall(PetscPrintf(PETSC_COMM_WORLD, "MatTransposeMatMult not supported\n"));
206:     }
207:     PetscCall(MatDestroy(&C));
208:   }

210:   /* 3) MatMatTransposeMult() */
211:   /* ------------------------ */
212:   if (Test_MatMatTr) {
213:     /* C = B*R^T */
214:     PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATSEQAIJ, &seqaij));
215:     if (seqaij) {
216:       PetscCall(MatMatTransposeMult(B, R, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
217:       PetscCall(MatSetOptionsPrefix(C, "ABt_")); /* enable '-ABt_' for matrix C */
218:       PetscCall(MatGetInfo(C, MAT_GLOBAL_SUM, &info));

220:       /* Test MAT_REUSE_MATRIX - reuse symbolic C */
221:       PetscCall(MatMatTransposeMult(B, R, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));

223:       /* Check */
224:       PetscCall(MatMatMult(B, P, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C1));
225:       PetscCall(MatNormDifference(C, C1, &norm));
226:       PetscCheck(norm <= PETSC_SMALL, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatMatTransposeMult() %g", (double)norm);
227:       PetscCall(MatDestroy(&C1));
228:       PetscCall(MatDestroy(&C));
229:     }
230:   }

232:   /* 4) Test MatPtAP() */
233:   /*-------------------*/
234:   if (Test_MatPtAP) {
235:     PetscCall(MatDuplicate(A_save, MAT_COPY_VALUES, &A));

237:     /* (4.1) Test developer API */
238:     PetscCall(MatProductCreate(A, P, NULL, &C));
239:     PetscCall(MatSetOptionsPrefix(C, "PtAP_"));
240:     PetscCall(MatProductSetType(C, MATPRODUCT_PtAP));
241:     PetscCall(MatProductSetAlgorithm(C, MATPRODUCTALGORITHMDEFAULT));
242:     PetscCall(MatProductSetFill(C, PETSC_DETERMINE));
243:     PetscCall(MatProductSetFromOptions(C));
244:     PetscCall(MatProductSymbolic(C));
245:     PetscCall(MatProductNumeric(C));
246:     PetscCall(MatPtAPMultEqual(A, P, C, mcheck, &flg));
247:     PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatProduct_PtAP");
248:     PetscCall(MatProductNumeric(C)); /* reuse symbolic C */

250:     PetscCall(MatPtAPMultEqual(A, P, C, mcheck, &flg));
251:     PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatProduct_PtAP with reused symbolic");
252:     PetscCall(MatDestroy(&C));

254:     /* (4.2) Test user driver */
255:     PetscCall(MatPtAP(A, P, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
256:     PetscCall(MatPtAPMultEqual(A, P, C, mcheck, &flg));
257:     PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatPtAP with MAT_INITIAL_MATRIX");

259:     /* Test MAT_REUSE_MATRIX - reuse symbolic C */
260:     alpha = 1.0;
261:     for (i = 0; i < 2; i++) {
262:       alpha -= 0.1;
263:       PetscCall(MatScale(A, alpha));
264:       PetscCall(MatPtAP(A, P, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));
265:     }
266:     PetscCall(MatPtAPMultEqual(A, P, C, mcheck, &flg));
267:     PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatPtAP with MAT_REUSE_MATRIX");

269:     /* 5) Test MatRARt() */
270:     /* ----------------- */
271:     if (Test_MatRARt) {
272:       Mat RARt;

274:       /* (5.1) Test developer driver RARt = R*A*Rt */
275:       PetscCall(MatProductCreate(A, R, NULL, &RARt));
276:       PetscCall(MatSetOptionsPrefix(RARt, "RARt_"));
277:       PetscCall(MatProductSetType(RARt, MATPRODUCT_RARt));
278:       PetscCall(MatProductSetAlgorithm(RARt, MATPRODUCTALGORITHMDEFAULT));
279:       PetscCall(MatProductSetFill(RARt, PETSC_DETERMINE));
280:       PetscCall(MatProductSetFromOptions(RARt));
281:       PetscCall(MatHasOperation(RARt, MATOP_PRODUCTSYMBOLIC, &flg));
282:       if (flg) {
283:         PetscCall(MatProductSymbolic(RARt));                        /* equivalent to MatSetUp() */
284:         PetscCall(MatSetOption(RARt, MAT_USE_INODES, PETSC_FALSE)); /* illustrate how to call MatSetOption() */
285:         PetscCall(MatProductNumeric(RARt));
286:         PetscCall(MatProductNumeric(RARt)); /* test reuse symbolic RARt */
287:         PetscCall(MatDestroy(&RARt));

289:         /* (2.2) Test user driver RARt = R*A*Rt */
290:         PetscCall(MatRARt(A, R, MAT_INITIAL_MATRIX, 2.0, &RARt));
291:         PetscCall(MatRARt(A, R, MAT_REUSE_MATRIX, 2.0, &RARt));

293:         PetscCall(MatNormDifference(C, RARt, &norm));
294:         PetscCheck(norm <= PETSC_SMALL, PETSC_COMM_SELF, PETSC_ERR_PLIB, "|PtAP - RARt| = %g", (double)norm);
295:       } else {
296:         PetscCall(PetscPrintf(PETSC_COMM_WORLD, "MatRARt not supported\n"));
297:       }
298:       PetscCall(MatDestroy(&RARt));
299:     }

301:     PetscCall(MatDestroy(&A));
302:     PetscCall(MatDestroy(&C));
303:   }

305:   /* Destroy objects */
306:   PetscCall(PetscRandomDestroy(&rdm));
307:   PetscCall(PetscFree2(idxn, a));

309:   PetscCall(MatDestroy(&A_save));
310:   PetscCall(MatDestroy(&B));
311:   PetscCall(MatDestroy(&P));
312:   PetscCall(MatDestroy(&R));

314:   PetscCall(PetscFinalize());
315:   return 0;
316: }

318: /*TEST
319:    test:
320:      suffix: 1
321:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
322:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium
323:      output_file: output/empty.out

325:    test:
326:      suffix: 2_ab_scalable
327:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
328:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm scalable -matmatmult_via scalable -AtB_mat_product_algorithm outerproduct -mattransposematmult_via outerproduct
329:      output_file: output/empty.out

331:    test:
332:      suffix: 3_ab_scalable_fast
333:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
334:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm scalable_fast -matmatmult_via scalable_fast -matmattransmult_via color
335:      output_file: output/empty.out

337:    test:
338:      suffix: 4_ab_heap
339:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
340:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm heap -matmatmult_via heap -PtAP_mat_product_algorithm rap -matptap_via rap
341:      output_file: output/empty.out

343:    test:
344:      suffix: 5_ab_btheap
345:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
346:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm btheap -matmatmult_via btheap -matrart_via r*art
347:      output_file: output/empty.out

349:    test:
350:      suffix: 6_ab_llcondensed
351:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
352:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm llcondensed -matmatmult_via llcondensed -matrart_via coloring_rart
353:      output_file: output/empty.out

355:    test:
356:      suffix: 7_ab_rowmerge
357:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
358:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm rowmerge -matmatmult_via rowmerge
359:      output_file: output/empty.out

361:    test:
362:      suffix: 8_ab_hypre
363:      requires: hypre datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
364:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm hypre -matmatmult_via hypre -PtAP_mat_product_algorithm hypre -matptap_via hypre
365:      output_file: output/empty.out

367:    test:
368:      suffix: hypre_medium
369:      nsize: {{1 3}}
370:      requires: hypre datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
371:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -A_mat_type hypre -B_mat_type hypre -test_rart 0
372:      output_file: output/ex62_hypre.out

374:    test:
375:      suffix: hypre_tiny
376:      nsize: {{1 3}}
377:      requires: hypre !complex double !defined(PETSC_USE_64BIT_INDICES)
378:      args: -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -A_mat_type hypre -B_mat_type hypre -test_rart 0
379:      output_file: output/ex62_hypre.out

381:    test:
382:      suffix: 9_mkl
383:      TODO: broken MatScale?
384:      requires: mkl_sparse datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
385:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -A_mat_type aijmkl -B_mat_type aijmkl
386:      output_file: output/empty.out

388:    test:
389:      suffix: 10
390:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
391:      nsize: 3
392:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium
393:      output_file: output/empty.out

395:    test:
396:      suffix: 10_backend
397:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
398:      nsize: 3
399:      args: -fA ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm backend -matmatmult_via backend -AtB_mat_product_algorithm backend -mattransposematmult_via backend -PtAP_mat_product_algorithm backend -matptap_via backend
400:      output_file: output/empty.out

402:    test:
403:      suffix: 11_ab_scalable
404:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
405:      nsize: 3
406:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm scalable -matmatmult_via scalable -AtB_mat_product_algorithm scalable -mattransposematmult_via scalable
407:      output_file: output/empty.out

409:    test:
410:      suffix: 12_ab_seqmpi
411:      requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
412:      nsize: 3
413:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm seqmpi -matmatmult_via seqmpi -AtB_mat_product_algorithm at*b -mattransposematmult_via at*b
414:      output_file: output/empty.out

416:    test:
417:      suffix: 13_ab_hypre
418:      requires: hypre datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
419:      nsize: 3
420:      args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm hypre -matmatmult_via hypre -PtAP_mat_product_algorithm hypre -matptap_via hypre
421:      output_file: output/empty.out

423:    test:
424:      suffix: 14_seqaij
425:      requires: !complex double !defined(PETSC_USE_64BIT_INDICES)
426:      args: -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system
427:      output_file: output/empty.out

429:    test:
430:      suffix: 14_seqaijcusparse
431:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
432:      args: -A_mat_type aijcusparse -B_mat_type aijcusparse -mat_form_explicit_transpose -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system
433:      output_file: output/empty.out

435:    test:
436:      suffix: 14_seqaijcusparse_cpu
437:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
438:      args: -A_mat_type aijcusparse -B_mat_type aijcusparse -mat_form_explicit_transpose -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -AB_mat_product_algorithm_backend_cpu -matmatmult_backend_cpu -PtAP_mat_product_algorithm_backend_cpu -matptap_backend_cpu -RARt_mat_product_algorithm_backend_cpu -matrart_backend_cpu
439:      output_file: output/empty.out

441:    test:
442:      suffix: 14_mpiaijcusparse_seq
443:      nsize: 1
444:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
445:      args: -A_mat_type mpiaijcusparse -B_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system
446:      output_file: output/empty.out

448:    test:
449:      suffix: 14_mpiaijcusparse_seq_cpu
450:      nsize: 1
451:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
452:      args: -A_mat_type mpiaijcusparse -B_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -AB_mat_product_algorithm_backend_cpu -matmatmult_backend_cpu -PtAP_mat_product_algorithm_backend_cpu -matptap_backend_cpu -test_rart 0
453:      output_file: output/empty.out

455:    test:
456:      suffix: 14_mpiaijcusparse
457:      nsize: 3
458:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
459:      args: -A_mat_type mpiaijcusparse -B_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system
460:      output_file: output/empty.out

462:    test:
463:      suffix: 14_mpiaijcusparse_cpu
464:      nsize: 3
465:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
466:      args: -A_mat_type mpiaijcusparse -B_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -AB_mat_product_algorithm_backend_cpu -matmatmult_backend_cpu -PtAP_mat_product_algorithm_backend_cpu -matptap_backend_cpu -test_rart 0
467:      output_file: output/empty.out

469:    test:
470:      nsize: {{1 3}}
471:      suffix: 14_aijkokkos
472:      requires: kokkos_kernels !complex double !defined(PETSC_USE_64BIT_INDICES)
473:      args: -A_mat_type aijkokkos -B_mat_type aijkokkos -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system
474:      output_file: output/empty.out

476:    # these tests use matrices with many zero rows
477:    test:
478:      suffix: 15_seqaijcusparse
479:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES) datafilespath
480:      args: -A_mat_type aijcusparse -mat_form_explicit_transpose -fA ${DATAFILESPATH}/matrices/matmatmult/A4.BGriffith
481:      output_file: output/empty.out

483:    test:
484:      suffix: 15_mpiaijcusparse_seq
485:      nsize: 1
486:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES) datafilespath
487:      args: -A_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${DATAFILESPATH}/matrices/matmatmult/A4.BGriffith
488:      output_file: output/empty.out

490:    test:
491:      nsize: 3
492:      suffix: 15_mpiaijcusparse
493:      requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES) datafilespath
494:      args: -A_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${DATAFILESPATH}/matrices/matmatmult/A4.BGriffith
495:      output_file: output/empty.out

497: TEST*/