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