1cdb0f33dSPierre Jolivet-include ../../../petscdir.mk 2f97672e5SBarry Smith 349762cbcSSatish BalayEXAMPLESMATLAB = ex5m.m ex29view.m 407c315cfSMartin DiehlCLEANFILES = ex5f90t 5c4762a1bSJed Brown 6c4762a1bSJed Browninclude ${PETSC_DIR}/lib/petsc/conf/variables 7c4762a1bSJed Browninclude ${PETSC_DIR}/lib/petsc/conf/rules 8c4762a1bSJed Brown 9a03c4107SJunchao ZhangV ?= 0 10a03c4107SJunchao ZhangQUIET = $(shell [ "$(V)" = "0" ] && echo @) 11a03c4107SJunchao Zhang 12da4996e5SSatish Balayex55: ex55k.o 13337d88fcSJunchao Zhang 14c4762a1bSJed Brown#------------------------------------------------------------------------- 15a3626c83SSatish Balayifeq ($(PETSC_PRECISION),__fp16) 16a3626c83SSatish Balay TESTEX19OUT = output/ex19_fp16.testout 17a3626c83SSatish Balayelse 18a3626c83SSatish Balay TESTEX19OUT = output/ex19_1.testout 19a3626c83SSatish Balayendif 20c4762a1bSJed Brown 21c4762a1bSJed Brown# these tests are used by the makefile in PETSC_DIR for basic tests of the install and should not be removed 22c4762a1bSJed Browntestex5f: ex5f.PETSc 23a03c4107SJunchao Zhang -${QUIET}${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex5f -snes_rtol 1e-4 > ex5f.tmp 2>&1; 24a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex5f_1.testout ex5f.tmp > ex5f.dtmp; 25a03c4107SJunchao Zhang -@if [ ! -s ex5f.dtmp ]; then \ 26c4762a1bSJed Brown echo "Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process"; \ 2727cb8d94SBarry Smith else \ 2827cb8d94SBarry Smith echo "Possible error running Fortran example src/snes/tutorials/ex5f with 1 MPI process"; \ 29d30b464cSBarry Smith echo "See https://petsc.org/release/faq/";\ 30a03c4107SJunchao Zhang cat ex5f.tmp; \ 3181b9c2c9SBarry Smith touch ../../../check_error;\ 3227cb8d94SBarry Smith fi; \ 33a03c4107SJunchao Zhang ${RM} -f ex5f.tmp ex5f.dtmp; 34c4762a1bSJed Browntestex19: ex19.PETSc 35a03c4107SJunchao Zhang -${QUIET}${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres > ex19.tmp 2>&1; 36*e14e8d21SSatish Balay -${QUIET}${DIFF} ${TESTEX19OUT} ex19.tmp > ex19.dtmp; 37a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 38c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process"; \ 3927cb8d94SBarry Smith else \ 4027cb8d94SBarry Smith echo "Possible error running C/C++ src/snes/tutorials/ex19 with 1 MPI process"; \ 41d30b464cSBarry Smith echo "See https://petsc.org/release/faq/";\ 42a03c4107SJunchao Zhang cat ex19.tmp;\ 4381b9c2c9SBarry Smith touch ../../../check_error;\ 4427cb8d94SBarry Smith fi; \ 45a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 4627cb8d94SBarry Smithtestex19_mpi: 47*e14e8d21SSatish Balay -${QUIET}${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres -snes_type newtontrdc > ex19.tmp 2>&1; 48*e14e8d21SSatish Balay -${QUIET}${DIFF} ${TESTEX19OUT} ex19.tmp > ex19.dtmp; 49a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 50c4762a1bSJed Brown echo "C/C++ example src/snes/tutorials/ex19 run successfully with 2 MPI processes"; \ 5127cb8d94SBarry Smith else \ 5227cb8d94SBarry Smith echo "Possible error running C/C++ src/snes/tutorials/ex19 with 2 MPI processes"; \ 53d30b464cSBarry Smith echo "See https://petsc.org/release/faq/";\ 54a03c4107SJunchao Zhang cat ex19.tmp; \ 5581b9c2c9SBarry Smith touch ../../../check_error;\ 5627cb8d94SBarry Smith fi; \ 57a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 58263f2b91SStefano Zampini#use unpreconditioned norm because HYPRE device installations use different AMG parameters 59c4762a1bSJed Brownrunex19_hypre: 60a03c4107SJunchao Zhang -${QUIET}${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -ksp_norm_type unpreconditioned -pc_type hypre > ex19.tmp 2>&1; 61a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_hypre.out ex19.tmp > ex19.dtmp; 62a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 63b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with HYPRE"; \ 6427cb8d94SBarry Smith else \ 65b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with HYPRE, diffs above\n=========================================\n";\ 6681b9c2c9SBarry Smith touch ../../../check_error;\ 6727cb8d94SBarry Smith fi; \ 68a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 69263f2b91SStefano Zampinirunex19_hypre_cuda: 70a03c4107SJunchao Zhang -${QUIET}${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.tmp; 71a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_hypre.out ex19.tmp > ex19.dtmp; 72a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 73b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with HYPRE/CUDA"; \ 7427cb8d94SBarry Smith else \ 75b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with HYPRE/CUDA, diffs above\n=========================================\n"; \ 7681b9c2c9SBarry Smith touch ../../../check_error;\ 7727cb8d94SBarry Smith fi; \ 78a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 79263f2b91SStefano Zampinirunex19_hypre_hip: 80a03c4107SJunchao Zhang -${QUIET}${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -dm_vec_type hip -dm_mat_type aijhipsparse -da_refine 3 -snes_monitor_short -ksp_norm_type unpreconditioned -pc_type hypre > ex19.tmp; 81a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_hypre.out ex19.tmp > ex19.dtmp; 82a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 83b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with HYPRE/HIP"; \ 8427cb8d94SBarry Smith else \ 85b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with HYPRE/HIP, diffs above\n=========================================\n";\ 8681b9c2c9SBarry Smith touch ../../../check_error;\ 8727cb8d94SBarry Smith fi; \ 88a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 89e57d7714SBarry Smithrunex19_cuda: 90a03c4107SJunchao Zhang -${QUIET}${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.tmp; 91a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_cuda_1.out ex19.tmp > ex19.dtmp; 92a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 93b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with CUDA"; \ 9427cb8d94SBarry Smith else \ 95b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with CUDA, diffs above\n=========================================\n"; \ 9681b9c2c9SBarry Smith touch ../../../check_error;\ 9727cb8d94SBarry Smith fi; \ 98a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 993e0e9f3fSSatish Balayrunex19_hip: 100a03c4107SJunchao Zhang -${QUIET}${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -snes_monitor -dm_mat_type mpiaijhipsparse -dm_vec_type hip -pc_type gamg -ksp_monitor -mg_levels_ksp_max_it 1 > ex19.tmp; 101a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_hip_1.out ex19.tmp > ex19.dtmp; 102a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 1033e0e9f3fSSatish Balay echo "C/C++ example src/snes/tutorials/ex19 run successfully with HIP"; \ 1043e0e9f3fSSatish Balay else \ 1053e0e9f3fSSatish Balay printf "${PWD}\nPossible problem with ex19 running with HIP, diffs above\n=========================================\n"; \ 1063e0e9f3fSSatish Balay touch ../../../check_error;\ 1073e0e9f3fSSatish Balay fi; \ 108a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 109c4762a1bSJed Brownrunex19_ml: 110a03c4107SJunchao Zhang -${QUIET}${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -pc_type ml > ex19.tmp; 111a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_ml.out ex19.tmp > ex19.dtmp; 112a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 113b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with ML"; \ 11427cb8d94SBarry Smith else \ 115b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with ML, diffs above\n=========================================\n"; \ 11681b9c2c9SBarry Smith touch ../../../check_error;\ 11727cb8d94SBarry Smith fi; \ 118a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 119c4762a1bSJed Brownrunex19_fieldsplit_mumps: 120a03c4107SJunchao Zhang -${QUIET}${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.tmp; 121a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_fieldsplit_5.out ex19.tmp > ex19.dtmp; 122a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 123b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with MUMPS"; \ 12427cb8d94SBarry Smith else \ 125b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with MUMPS, diffs above\n=========================================\n";\ 12681b9c2c9SBarry Smith touch ../../../check_error;\ 12727cb8d94SBarry Smith fi; \ 128a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 129c4762a1bSJed Brownrunex19_superlu_dist: 130a03c4107SJunchao Zhang -${QUIET}${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; 131a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_superlu.out ex19.tmp > ex19.dtmp; 132a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 133b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with SuperLU_DIST"; \ 13427cb8d94SBarry Smith else \ 135b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with SuperLU_DIST, diffs above\n=========================================\n"; \ 13681b9c2c9SBarry Smith touch ../../../check_error;\ 13727cb8d94SBarry Smith fi; \ 138a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 139c4762a1bSJed Brownrunex19_suitesparse: 140a03c4107SJunchao Zhang -${QUIET}${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -pc_type lu -pc_factor_mat_solver_type umfpack > ex19.tmp; 141a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex19_suitesparse.out ex19.tmp > ex19.dtmp; 142a03c4107SJunchao Zhang -@if [ ! -s ex19.dtmp ]; then \ 143b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex19 run successfully with SuiteSparse"; \ 14427cb8d94SBarry Smith else \ 145b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex19 running with SuiteSparse, diffs above\n=========================================\n"; \ 14681b9c2c9SBarry Smith touch ../../../check_error;\ 14727cb8d94SBarry Smith fi; \ 148a03c4107SJunchao Zhang ${RM} -f ex19.tmp ex19.dtmp; 149ef9bfa9fSSatish Balayrunex3k_kokkos: ex3k.PETSc 150a03c4107SJunchao Zhang -${QUIET}KOKKOS_DISABLE_WARNINGS=1 ${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex3k -view_initial -dm_vec_type kokkos -dm_mat_type aijkokkos -use_gpu_aware_mpi 0 -snes_monitor > ex3k.tmp; 151a03c4107SJunchao Zhang -${QUIET}${DIFF} output/ex3k_1.out ex3k.tmp > ex3k.dtmp; 152a03c4107SJunchao Zhang -@if [ ! -s ex3k.dtmp ]; then \ 153b3b5ef4dSPierre Jolivet echo "C/C++ example src/snes/tutorials/ex3k run successfully with Kokkos Kernels"; \ 15427cb8d94SBarry Smith else \ 155b3b5ef4dSPierre Jolivet printf "${PWD}\nPossible problem with ex3k running with Kokkos Kernels, diffs above\n=========================================\n"; \ 15681b9c2c9SBarry Smith touch ../../../check_error;\ 15727cb8d94SBarry Smith fi; \ 158a03c4107SJunchao Zhang ${RM} -f ex3k.tmp ex3k.dtmp; 159