1cdb0f33dSPierre Jolivet-include ../../../petscdir.mk 2f97672e5SBarry Smith 3c4762a1bSJed BrownMANSEC = SNES 449762cbcSSatish BalayEXAMPLESMATLAB = ex5m.m ex29view.m 5c4762a1bSJed BrownDIRS = ex10d network 607c315cfSMartin DiehlCLEANFILES = ex5f90t 7c4762a1bSJed Brown 8c4762a1bSJed Browninclude ${PETSC_DIR}/lib/petsc/conf/variables 9c4762a1bSJed Browninclude ${PETSC_DIR}/lib/petsc/conf/rules 10c4762a1bSJed Brown 11c4762a1bSJed Brown#------------------------------------------------------------------------- 12c4762a1bSJed Brown 13c4762a1bSJed Brown# these tests are used by the makefile in PETSC_DIR for basic tests of the install and should not be removed 14c4762a1bSJed Browntestex5f: ex5f.PETSc 1564f7b273SJunchao Zhang -@${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex5f -snes_rtol 1e-4 > ex5f_1.tmp 2>&1; \ 16c4762a1bSJed Brown if (${DIFF} output/ex5f_1.testout ex5f_1.tmp > /dev/null 2>&1) then \ 17c4762a1bSJed Brown echo "Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process"; \ 1827cb8d94SBarry Smith else \ 1927cb8d94SBarry Smith echo "Possible error running Fortran example src/snes/tutorials/ex5f with 1 MPI process"; \ 20d30b464cSBarry Smith echo "See https://petsc.org/release/faq/";\ 2127cb8d94SBarry Smith cat ex5f_1.tmp; \ 2281b9c2c9SBarry Smith touch ../../../check_error;\ 2327cb8d94SBarry Smith fi; \ 24c4762a1bSJed Brown ${RM} -f ex5f_1.tmp ;\ 2527cb8d94SBarry Smith ${MAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ex5f.rm; 26c4762a1bSJed Browntestex19: ex19.PETSc 2764f7b273SJunchao Zhang -@${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres > ex19_1.tmp 2>&1; \ 28c4762a1bSJed Brown if (${DIFF} output/ex19_1.testout ex19_1.tmp > /dev/null 2>&1) then \ 29c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process"; \ 3027cb8d94SBarry Smith else \ 3127cb8d94SBarry Smith echo "Possible error running C/C++ src/snes/tutorials/ex19 with 1 MPI process"; \ 32d30b464cSBarry Smith echo "See https://petsc.org/release/faq/";\ 3327cb8d94SBarry Smith cat ex19_1.tmp;\ 3481b9c2c9SBarry Smith touch ../../../check_error;\ 3527cb8d94SBarry Smith fi;\ 3627cb8d94SBarry Smith ${RM} -f ex19_1.tmp; 3727cb8d94SBarry Smithtestex19_mpi: 3864f7b273SJunchao Zhang -@${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres > ex19_1.tmp 2>&1; \ 39c4762a1bSJed Brown if (${DIFF} output/ex19_1.testout ex19_1.tmp > /dev/null 2>&1) then \ 40c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with 2 MPI processes"; \ 4127cb8d94SBarry Smith else \ 4227cb8d94SBarry Smith echo "Possible error running C/C++ src/snes/tutorials/ex19 with 2 MPI processes"; \ 43d30b464cSBarry Smith echo "See https://petsc.org/release/faq/";\ 4427cb8d94SBarry Smith cat ex19_1.tmp; \ 4581b9c2c9SBarry Smith touch ../../../check_error;\ 4627cb8d94SBarry Smith fi;\ 4727cb8d94SBarry Smith ${RM} -f ex19_1.tmp; 48263f2b91SStefano Zampini#use unpreconditioned norm because HYPRE device installations use different AMG parameters 49c4762a1bSJed Brownrunex19_hypre: 5064f7b273SJunchao Zhang -@${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -ksp_norm_type unpreconditioned -pc_type hypre > ex19_1.tmp 2>&1; \ 51c4762a1bSJed Brown if (${DIFF} output/ex19_hypre.out ex19_1.tmp) then \ 52c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with hypre"; \ 5327cb8d94SBarry Smith else \ 5427cb8d94SBarry Smith printf "${PWD}\nPossible problem with ex19 running with hypre, diffs above\n=========================================\n";\ 5581b9c2c9SBarry Smith touch ../../../check_error;\ 5627cb8d94SBarry Smith fi; \ 57c4762a1bSJed Brown ${RM} -f ex19_1.tmp 58263f2b91SStefano Zampinirunex19_hypre_cuda: 5964f7b273SJunchao Zhang -@${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -dm_vec_type cuda -dm_mat_type aijcusparse -da_refine 3 -snes_monitor_short -ksp_norm_type unpreconditioned -pc_type hypre > ex19_1.tmp 2>&1; \ 60263f2b91SStefano Zampini if (${DIFF} output/ex19_hypre.out ex19_1.tmp) then \ 61263f2b91SStefano Zampini echo "C/C++ example src/snes/tutorials/ex19 run successfully with hypre/cuda"; \ 6227cb8d94SBarry Smith else \ 6347354645SJacob Faibussowitsch printf "${PWD}\nPossible problem with ex19 running with hypre/cuda, diffs above\n=========================================\n"; \ 6481b9c2c9SBarry Smith touch ../../../check_error;\ 6527cb8d94SBarry Smith fi; \ 66263f2b91SStefano Zampini ${RM} -f ex19_1.tmp 67263f2b91SStefano Zampinirunex19_hypre_hip: 6864f7b273SJunchao Zhang -@${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -dm_vec_type hip -da_refine 3 -snes_monitor_short -ksp_norm_type unpreconditioned -pc_type hypre > ex19_1.tmp 2>&1; \ 69263f2b91SStefano Zampini if (${DIFF} output/ex19_hypre.out ex19_1.tmp) then \ 70263f2b91SStefano Zampini echo "C/C++ example src/snes/tutorials/ex19 run successfully with hypre/hip"; \ 7127cb8d94SBarry Smith else \ 7247354645SJacob Faibussowitsch printf "${PWD}\nPossible problem with ex19 running with hypre/hip, diffs above\n=========================================\n";\ 7381b9c2c9SBarry Smith touch ../../../check_error;\ 7427cb8d94SBarry Smith fi; \ 75263f2b91SStefano Zampini ${RM} -f ex19_1.tmp 76e57d7714SBarry Smithrunex19_cuda: 77*d4adc10fSMark Adams -@${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -snes_monitor -dm_mat_type seqaijcusparse -dm_vec_type seqcuda -pc_type gamg -ksp_monitor -mg_levels_ksp_max_it 1 > ex19_1.tmp 2>&1; \ 78e57d7714SBarry Smith if (${DIFF} output/ex19_cuda_1.out ex19_1.tmp) then \ 79e57d7714SBarry Smith echo "C/C++ example src/snes/tutorials/ex19 run successfully with cuda"; \ 8027cb8d94SBarry Smith else \ 8127cb8d94SBarry Smith printf "${PWD}\nPossible problem with ex19 running with cuda, diffs above\n=========================================\n"; \ 8281b9c2c9SBarry Smith touch ../../../check_error;\ 8327cb8d94SBarry Smith fi; \ 84e57d7714SBarry Smith ${RM} -f ex19_1.tmp 85c4762a1bSJed Brownrunex19_ml: 8664f7b273SJunchao Zhang -@${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -pc_type ml > ex19_1.tmp 2>&1; \ 87c4762a1bSJed Brown if (${DIFF} output/ex19_ml.out ex19_1.tmp) then \ 88c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with ml"; \ 8927cb8d94SBarry Smith else \ 9027cb8d94SBarry Smith printf "${PWD}\nPossible problem with ex19 running with ml, diffs above\n=========================================\n"; \ 9181b9c2c9SBarry Smith touch ../../../check_error;\ 9227cb8d94SBarry Smith fi; \ 93c4762a1bSJed Brown ${RM} -f ex19_1.tmp 94c4762a1bSJed Brownrunex19_fieldsplit_mumps: 9564f7b273SJunchao Zhang -@${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -pc_type fieldsplit -pc_fieldsplit_block_size 4 -pc_fieldsplit_type SCHUR -pc_fieldsplit_0_fields 0,1,2 -pc_fieldsplit_1_fields 3 -fieldsplit_0_pc_type lu -fieldsplit_1_pc_type lu -snes_monitor_short -ksp_monitor_short -fieldsplit_0_pc_factor_mat_solver_type mumps -fieldsplit_1_pc_factor_mat_solver_type mumps > ex19_6.tmp 2>&1; \ 96c4762a1bSJed Brown if (${DIFF} output/ex19_fieldsplit_5.out ex19_6.tmp) then \ 97c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with mumps"; \ 9827cb8d94SBarry Smith else \ 9927cb8d94SBarry Smith printf "${PWD}\nPossible problem with ex19 running with mumps, diffs above\n=========================================\n";\ 10081b9c2c9SBarry Smith touch ../../../check_error;\ 10127cb8d94SBarry Smith fi; \ 102c4762a1bSJed Brown ${RM} -f ex19_6.tmp 103c4762a1bSJed Brownrunex19_superlu_dist: 10464f7b273SJunchao Zhang -@${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -da_grid_x 20 -da_grid_y 20 -pc_type lu -pc_factor_mat_solver_type superlu_dist > ex19.tmp 2>&1; \ 105c4762a1bSJed Brown if (${DIFF} output/ex19_superlu.out ex19.tmp) then \ 106c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with superlu_dist"; \ 10727cb8d94SBarry Smith else \ 10827cb8d94SBarry Smith printf "${PWD}\nPossible problem with ex19 running with superlu_dist, diffs above\n=========================================\n"; \ 10981b9c2c9SBarry Smith touch ../../../check_error;\ 11027cb8d94SBarry Smith fi; \ 111c4762a1bSJed Brown ${RM} -f ex19.tmp 112c4762a1bSJed Brownrunex19_suitesparse: 11364f7b273SJunchao Zhang -@${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -pc_type lu -pc_factor_mat_solver_type umfpack > ex19_1.tmp 2>&1; \ 114c4762a1bSJed Brown if (${DIFF} output/ex19_suitesparse.out ex19_1.tmp) then \ 115c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with suitesparse"; \ 11627cb8d94SBarry Smith else \ 11727cb8d94SBarry Smith printf "${PWD}\nPossible problem with ex19 running with suitesparse, diffs above\n=========================================\n"; \ 11881b9c2c9SBarry Smith touch ../../../check_error;\ 11927cb8d94SBarry Smith fi; \ 120c4762a1bSJed Brown ${RM} -f ex19_1.tmp 121ef9bfa9fSSatish Balayrunex3k_kokkos: ex3k.PETSc 12264f7b273SJunchao Zhang -@OMP_PROC_BIND=false ${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex3k -view_initial -dm_vec_type kokkos -dm_mat_type aijkokkos -use_gpu_aware_mpi 0 -snes_monitor > ex3k_1.tmp 2>&1 ;\ 123b37f3694SRichard Tran Mills if (${DIFF} output/ex3k_1.out ex3k_1.tmp) then \ 124ef9bfa9fSSatish Balay echo "C/C++ example src/snes/tutorials/ex3k run successfully with kokkos-kernels"; \ 12527cb8d94SBarry Smith else \ 12627cb8d94SBarry Smith printf "${PWD}\nPossible problem with ex3k running with kokkos-kernels, diffs above\n=========================================\n"; \ 12781b9c2c9SBarry Smith touch ../../../check_error;\ 12827cb8d94SBarry Smith fi; \ 129b37f3694SRichard Tran Mills ${RM} -f ex3k_1.tmp 130c4762a1bSJed Brown 131