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] = {"", ""};
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: const char *deft = MATAIJ;
39: char A_mattype[256], B_mattype[256];
40: PetscInt mcheck = 10;
42: PetscFunctionBeginUser;
43: PetscCall(PetscInitialize(&argc, &args, NULL, help));
44: PetscCallMPI(MPI_Comm_size(PETSC_COMM_WORLD, &size));
45: PetscCallMPI(MPI_Comm_rank(PETSC_COMM_WORLD, &rank));
47: /* Load the matrices A_save and B */
48: PetscOptionsBegin(PETSC_COMM_WORLD, "", "", "");
49: PetscCall(PetscOptionsBool("-test_rart", "Test MatRARt", "", Test_MatRARt, &Test_MatRARt, NULL));
50: PetscCall(PetscOptionsInt("-PN", "Number of columns of P", "", PN, &PN, NULL));
51: PetscCall(PetscOptionsInt("-mcheck", "Number of matmult checks", "", mcheck, &mcheck, NULL));
52: PetscCall(PetscOptionsString("-fA", "Path for matrix A", "", file[0], file[0], sizeof(file[0]), &flg));
53: PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_USER_INPUT, "Must indicate a file name for matrix A with the -fA option.");
54: PetscCall(PetscOptionsString("-fB", "Path for matrix B", "", file[1], file[1], sizeof(file[1]), &flg));
55: PetscCall(PetscOptionsFList("-A_mat_type", "Matrix type", "MatSetType", MatList, deft, A_mattype, 256, &flgA));
56: PetscCall(PetscOptionsFList("-B_mat_type", "Matrix type", "MatSetType", MatList, deft, B_mattype, 256, &flgB));
57: PetscOptionsEnd();
59: PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, file[0], FILE_MODE_READ, &viewer));
60: PetscCall(MatCreate(PETSC_COMM_WORLD, &A_save));
61: PetscCall(MatLoad(A_save, viewer));
62: PetscCall(PetscViewerDestroy(&viewer));
64: if (flg) {
65: PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, file[1], FILE_MODE_READ, &viewer));
66: PetscCall(MatCreate(PETSC_COMM_WORLD, &B));
67: PetscCall(MatLoad(B, viewer));
68: PetscCall(PetscViewerDestroy(&viewer));
69: } else {
70: PetscCall(PetscObjectReference((PetscObject)A_save));
71: B = A_save;
72: }
74: if (flgA) PetscCall(MatConvert(A_save, A_mattype, MAT_INPLACE_MATRIX, &A_save));
75: if (flgB) PetscCall(MatConvert(B, B_mattype, MAT_INPLACE_MATRIX, &B));
76: PetscCall(MatSetFromOptions(A_save));
77: PetscCall(MatSetFromOptions(B));
79: PetscCall(MatGetType(B, &mattype));
81: PetscCall(PetscMalloc2(nzp, &idxn, nzp, &a));
83: PetscCall(PetscRandomCreate(PETSC_COMM_WORLD, &rdm));
84: PetscCall(PetscRandomSetFromOptions(rdm));
86: /* 1) MatMatMult() */
87: /* ----------------*/
88: if (Test_MatMatMult) {
89: PetscCall(MatDuplicate(A_save, MAT_COPY_VALUES, &A));
91: /* (1.1) Test developer API */
92: PetscCall(MatProductCreate(A, B, NULL, &C));
93: PetscCall(MatSetOptionsPrefix(C, "AB_"));
94: PetscCall(MatProductSetType(C, MATPRODUCT_AB));
95: PetscCall(MatProductSetAlgorithm(C, MATPRODUCTALGORITHMDEFAULT));
96: PetscCall(MatProductSetFill(C, PETSC_DETERMINE));
97: PetscCall(MatProductSetFromOptions(C));
98: /* we can inquire about MATOP_PRODUCTSYMBOLIC even if the destination matrix type has not been set yet */
99: PetscCall(MatHasOperation(C, MATOP_PRODUCTSYMBOLIC, &flg));
100: PetscCall(MatProductSymbolic(C));
101: PetscCall(MatProductNumeric(C));
102: PetscCall(MatMatMultEqual(A, B, C, mcheck, &flg));
103: PetscCheck(flg, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in C=A*B");
105: /* Test reuse symbolic C */
106: alpha = 0.9;
107: PetscCall(MatScale(A, alpha));
108: PetscCall(MatProductNumeric(C));
110: PetscCall(MatMatMultEqual(A, B, C, mcheck, &flg));
111: PetscCheck(flg, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error in C=A*B");
112: PetscCall(MatDestroy(&C));
114: /* (1.2) Test user driver */
115: PetscCall(MatMatMult(A, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
117: /* Test MAT_REUSE_MATRIX - reuse symbolic C */
118: alpha = 1.0;
119: for (i = 0; i < 2; i++) {
120: alpha -= 0.1;
121: PetscCall(MatScale(A, alpha));
122: PetscCall(MatMatMult(A, B, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));
123: }
124: PetscCall(MatMatMultEqual(A, B, C, mcheck, &flg));
125: PetscCheck(flg, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Error: MatMatMult()");
126: PetscCall(MatDestroy(&A));
128: /* Test MatProductClear() */
129: PetscCall(MatProductClear(C));
130: PetscCall(MatDestroy(&C));
132: /* Test MatMatMult() for dense and aij matrices */
133: PetscCall(PetscObjectTypeCompareAny((PetscObject)A, &flg, MATSEQAIJ, MATMPIAIJ, ""));
134: if (flg) {
135: PetscCall(MatConvert(A_save, MATDENSE, MAT_INITIAL_MATRIX, &A));
136: PetscCall(MatMatMult(A, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
137: PetscCall(MatDestroy(&C));
138: PetscCall(MatDestroy(&A));
139: }
140: }
142: /* Create P and R = P^T */
143: /* --------------------- */
144: PetscCall(MatGetSize(B, &PM, NULL));
145: if (PN < 0) PN = PM / 2;
146: PetscCall(MatCreate(PETSC_COMM_WORLD, &P));
147: PetscCall(MatSetSizes(P, PETSC_DECIDE, PETSC_DECIDE, PM, PN));
148: PetscCall(MatSetType(P, MATAIJ));
149: PetscCall(MatSeqAIJSetPreallocation(P, nzp, NULL));
150: PetscCall(MatMPIAIJSetPreallocation(P, nzp, NULL, nzp, NULL));
151: PetscCall(MatGetOwnershipRange(P, &rstart, &rend));
152: for (i = 0; i < nzp; i++) PetscCall(PetscRandomGetValue(rdm, &a[i]));
153: for (i = rstart; i < rend; i++) {
154: for (j = 0; j < nzp; j++) {
155: PetscCall(PetscRandomGetValue(rdm, &rval));
156: idxn[j] = (PetscInt)(PetscRealPart(rval) * PN);
157: }
158: PetscCall(MatSetValues(P, 1, &i, nzp, idxn, a, ADD_VALUES));
159: }
160: PetscCall(MatAssemblyBegin(P, MAT_FINAL_ASSEMBLY));
161: PetscCall(MatAssemblyEnd(P, MAT_FINAL_ASSEMBLY));
163: PetscCall(MatTranspose(P, MAT_INITIAL_MATRIX, &R));
164: PetscCall(MatConvert(P, mattype, MAT_INPLACE_MATRIX, &P));
165: PetscCall(MatConvert(R, mattype, MAT_INPLACE_MATRIX, &R));
166: PetscCall(MatSetFromOptions(P));
167: PetscCall(MatSetFromOptions(R));
169: /* 2) MatTransposeMatMult() */
170: /* ------------------------ */
171: if (Test_MatTrMat) {
172: /* (2.1) Test developer driver C = P^T*B */
173: PetscCall(MatProductCreate(P, B, NULL, &C));
174: PetscCall(MatSetOptionsPrefix(C, "AtB_"));
175: PetscCall(MatProductSetType(C, MATPRODUCT_AtB));
176: PetscCall(MatProductSetAlgorithm(C, MATPRODUCTALGORITHMDEFAULT));
177: PetscCall(MatProductSetFill(C, PETSC_DETERMINE));
178: PetscCall(MatProductSetFromOptions(C));
179: PetscCall(MatHasOperation(C, MATOP_PRODUCTSYMBOLIC, &flg));
180: if (flg) { /* run tests if supported */
181: PetscCall(MatProductSymbolic(C)); /* equivalent to MatSetUp() */
182: PetscCall(MatSetOption(C, MAT_USE_INODES, PETSC_FALSE)); /* illustrate how to call MatSetOption() */
183: PetscCall(MatProductNumeric(C));
184: PetscCall(MatProductNumeric(C)); /* test reuse symbolic C */
186: PetscCall(MatTransposeMatMultEqual(P, B, C, mcheck, &flg));
187: PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error: developer driver C = P^T*B");
188: PetscCall(MatDestroy(&C));
190: /* (2.2) Test user driver C = P^T*B */
191: PetscCall(MatTransposeMatMult(P, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
192: PetscCall(MatTransposeMatMult(P, B, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));
193: PetscCall(MatGetInfo(C, MAT_GLOBAL_SUM, &info));
194: PetscCall(MatProductClear(C));
196: /* Compare P^T*B and R*B */
197: PetscCall(MatMatMult(R, B, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C1));
198: PetscCall(MatNormDifference(C, C1, &norm));
199: PetscCheck(norm <= PETSC_SMALL, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatTransposeMatMult(): %g", (double)norm);
200: PetscCall(MatDestroy(&C1));
202: /* Test MatDuplicate() of C=P^T*B */
203: PetscCall(MatDuplicate(C, MAT_COPY_VALUES, &C1));
204: PetscCall(MatDestroy(&C1));
205: } else {
206: PetscCall(PetscPrintf(PETSC_COMM_WORLD, "MatTransposeMatMult not supported\n"));
207: }
208: PetscCall(MatDestroy(&C));
209: }
211: /* 3) MatMatTransposeMult() */
212: /* ------------------------ */
213: if (Test_MatMatTr) {
214: /* C = B*R^T */
215: PetscCall(PetscObjectBaseTypeCompare((PetscObject)B, MATSEQAIJ, &seqaij));
216: if (seqaij) {
217: PetscCall(MatMatTransposeMult(B, R, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
218: PetscCall(MatSetOptionsPrefix(C, "ABt_")); /* enable '-ABt_' for matrix C */
219: PetscCall(MatGetInfo(C, MAT_GLOBAL_SUM, &info));
221: /* Test MAT_REUSE_MATRIX - reuse symbolic C */
222: PetscCall(MatMatTransposeMult(B, R, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));
224: /* Check */
225: PetscCall(MatMatMult(B, P, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C1));
226: PetscCall(MatNormDifference(C, C1, &norm));
227: PetscCheck(norm <= PETSC_SMALL, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatMatTransposeMult() %g", (double)norm);
228: PetscCall(MatDestroy(&C1));
229: PetscCall(MatDestroy(&C));
230: }
231: }
233: /* 4) Test MatPtAP() */
234: /*-------------------*/
235: if (Test_MatPtAP) {
236: PetscCall(MatDuplicate(A_save, MAT_COPY_VALUES, &A));
238: /* (4.1) Test developer API */
239: PetscCall(MatProductCreate(A, P, NULL, &C));
240: PetscCall(MatSetOptionsPrefix(C, "PtAP_"));
241: PetscCall(MatProductSetType(C, MATPRODUCT_PtAP));
242: PetscCall(MatProductSetAlgorithm(C, MATPRODUCTALGORITHMDEFAULT));
243: PetscCall(MatProductSetFill(C, PETSC_DETERMINE));
244: PetscCall(MatProductSetFromOptions(C));
245: PetscCall(MatProductSymbolic(C));
246: PetscCall(MatProductNumeric(C));
247: PetscCall(MatPtAPMultEqual(A, P, C, mcheck, &flg));
248: PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatProduct_PtAP");
249: PetscCall(MatProductNumeric(C)); /* reuse symbolic C */
251: PetscCall(MatPtAPMultEqual(A, P, C, mcheck, &flg));
252: PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatProduct_PtAP");
253: PetscCall(MatDestroy(&C));
255: /* (4.2) Test user driver */
256: PetscCall(MatPtAP(A, P, MAT_INITIAL_MATRIX, PETSC_DETERMINE, &C));
258: /* Test MAT_REUSE_MATRIX - reuse symbolic C */
259: alpha = 1.0;
260: for (i = 0; i < 2; i++) {
261: alpha -= 0.1;
262: PetscCall(MatScale(A, alpha));
263: PetscCall(MatPtAP(A, P, MAT_REUSE_MATRIX, PETSC_DETERMINE, &C));
264: }
265: PetscCall(MatPtAPMultEqual(A, P, C, mcheck, &flg));
266: PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Error in MatPtAP");
268: /* 5) Test MatRARt() */
269: /* ----------------- */
270: if (Test_MatRARt) {
271: Mat RARt;
273: /* (5.1) Test developer driver RARt = R*A*Rt */
274: PetscCall(MatProductCreate(A, R, NULL, &RARt));
275: PetscCall(MatSetOptionsPrefix(RARt, "RARt_"));
276: PetscCall(MatProductSetType(RARt, MATPRODUCT_RARt));
277: PetscCall(MatProductSetAlgorithm(RARt, MATPRODUCTALGORITHMDEFAULT));
278: PetscCall(MatProductSetFill(RARt, PETSC_DETERMINE));
279: PetscCall(MatProductSetFromOptions(RARt));
280: PetscCall(MatHasOperation(RARt, MATOP_PRODUCTSYMBOLIC, &flg));
281: if (flg) {
282: PetscCall(MatProductSymbolic(RARt)); /* equivalent to MatSetUp() */
283: PetscCall(MatSetOption(RARt, MAT_USE_INODES, PETSC_FALSE)); /* illustrate how to call MatSetOption() */
284: PetscCall(MatProductNumeric(RARt));
285: PetscCall(MatProductNumeric(RARt)); /* test reuse symbolic RARt */
286: PetscCall(MatDestroy(&RARt));
288: /* (2.2) Test user driver RARt = R*A*Rt */
289: PetscCall(MatRARt(A, R, MAT_INITIAL_MATRIX, 2.0, &RARt));
290: PetscCall(MatRARt(A, R, MAT_REUSE_MATRIX, 2.0, &RARt));
292: PetscCall(MatNormDifference(C, RARt, &norm));
293: PetscCheck(norm <= PETSC_SMALL, PETSC_COMM_SELF, PETSC_ERR_PLIB, "|PtAP - RARt| = %g", (double)norm);
294: } else {
295: PetscCall(PetscPrintf(PETSC_COMM_WORLD, "MatRARt not supported\n"));
296: }
297: PetscCall(MatDestroy(&RARt));
298: }
300: PetscCall(MatDestroy(&A));
301: PetscCall(MatDestroy(&C));
302: }
304: /* Destroy objects */
305: PetscCall(PetscRandomDestroy(&rdm));
306: PetscCall(PetscFree2(idxn, a));
308: PetscCall(MatDestroy(&A_save));
309: PetscCall(MatDestroy(&B));
310: PetscCall(MatDestroy(&P));
311: PetscCall(MatDestroy(&R));
313: PetscCall(PetscFinalize());
314: return 0;
315: }
317: /*TEST
318: test:
319: suffix: 1
320: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
321: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium
322: output_file: output/ex62_1.out
324: test:
325: suffix: 2_ab_scalable
326: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
327: 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
328: output_file: output/ex62_1.out
330: test:
331: suffix: 3_ab_scalable_fast
332: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
333: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm scalable_fast -matmatmult_via scalable_fast -matmattransmult_via color
334: output_file: output/ex62_1.out
336: test:
337: suffix: 4_ab_heap
338: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
339: 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
340: output_file: output/ex62_1.out
342: test:
343: suffix: 5_ab_btheap
344: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
345: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm btheap -matmatmult_via btheap -matrart_via r*art
346: output_file: output/ex62_1.out
348: test:
349: suffix: 6_ab_llcondensed
350: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
351: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm llcondensed -matmatmult_via llcondensed -matrart_via coloring_rart
352: output_file: output/ex62_1.out
354: test:
355: suffix: 7_ab_rowmerge
356: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
357: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -AB_mat_product_algorithm rowmerge -matmatmult_via rowmerge
358: output_file: output/ex62_1.out
360: test:
361: suffix: 8_ab_hypre
362: requires: hypre datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
363: 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
364: output_file: output/ex62_1.out
366: test:
367: suffix: hypre_medium
368: nsize: {{1 3}}
369: requires: hypre datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
370: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -A_mat_type hypre -B_mat_type hypre -test_rart 0
371: output_file: output/ex62_hypre.out
373: test:
374: suffix: hypre_tiny
375: nsize: {{1 3}}
376: requires: hypre !complex double !defined(PETSC_USE_64BIT_INDICES)
377: 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
378: output_file: output/ex62_hypre.out
380: test:
381: suffix: 9_mkl
382: TODO: broken MatScale?
383: requires: mkl_sparse datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
384: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium -A_mat_type aijmkl -B_mat_type aijmkl
385: output_file: output/ex62_1.out
387: test:
388: suffix: 10
389: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
390: nsize: 3
391: args: -fA ${DATAFILESPATH}/matrices/medium -fB ${DATAFILESPATH}/matrices/medium
392: output_file: output/ex62_1.out
394: test:
395: suffix: 10_backend
396: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
397: nsize: 3
398: 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
399: output_file: output/ex62_1.out
401: test:
402: suffix: 11_ab_scalable
403: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
404: nsize: 3
405: 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
406: output_file: output/ex62_1.out
408: test:
409: suffix: 12_ab_seqmpi
410: requires: datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
411: nsize: 3
412: 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
413: output_file: output/ex62_1.out
415: test:
416: suffix: 13_ab_hypre
417: requires: hypre datafilespath !complex double !defined(PETSC_USE_64BIT_INDICES)
418: nsize: 3
419: 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
420: output_file: output/ex62_1.out
422: test:
423: suffix: 14_seqaij
424: requires: !complex double !defined(PETSC_USE_64BIT_INDICES)
425: args: -fA ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system -fB ${wPETSC_DIR}/share/petsc/datafiles/matrices/tiny_system
426: output_file: output/ex62_1.out
428: test:
429: suffix: 14_seqaijcusparse
430: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
431: 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
432: output_file: output/ex62_1.out
434: test:
435: suffix: 14_seqaijcusparse_cpu
436: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
437: 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
438: output_file: output/ex62_1.out
440: test:
441: suffix: 14_mpiaijcusparse_seq
442: nsize: 1
443: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
444: 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
445: output_file: output/ex62_1.out
447: test:
448: suffix: 14_mpiaijcusparse_seq_cpu
449: nsize: 1
450: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
451: 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
452: output_file: output/ex62_1.out
454: test:
455: suffix: 14_mpiaijcusparse
456: nsize: 3
457: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
458: 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
459: output_file: output/ex62_1.out
461: test:
462: suffix: 14_mpiaijcusparse_cpu
463: nsize: 3
464: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES)
465: 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
466: output_file: output/ex62_1.out
468: test:
469: nsize: {{1 3}}
470: suffix: 14_aijkokkos
471: requires: kokkos_kernels !complex double !defined(PETSC_USE_64BIT_INDICES)
472: 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
473: output_file: output/ex62_1.out
475: # these tests use matrices with many zero rows
476: test:
477: suffix: 15_seqaijcusparse
478: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES) datafilespath
479: args: -A_mat_type aijcusparse -mat_form_explicit_transpose -fA ${DATAFILESPATH}/matrices/matmatmult/A4.BGriffith
480: output_file: output/ex62_1.out
482: test:
483: suffix: 15_mpiaijcusparse_seq
484: nsize: 1
485: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES) datafilespath
486: args: -A_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${DATAFILESPATH}/matrices/matmatmult/A4.BGriffith
487: output_file: output/ex62_1.out
489: test:
490: nsize: 3
491: suffix: 15_mpiaijcusparse
492: requires: cuda !complex double !defined(PETSC_USE_64BIT_INDICES) datafilespath
493: args: -A_mat_type mpiaijcusparse -mat_form_explicit_transpose -fA ${DATAFILESPATH}/matrices/matmatmult/A4.BGriffith
494: output_file: output/ex62_1.out
496: TEST*/