xref: /petsc/src/snes/tutorials/makefile (revision 421480d92be24cdb9933c60510b8e175c0a8d034)
1-include ../../../petscdir.mk
2
3EXAMPLESMATLAB   = ex5m.m ex29view.m
4CLEANFILES       = ex5f90t
5
6include ${PETSC_DIR}/lib/petsc/conf/variables
7include ${PETSC_DIR}/lib/petsc/conf/rules
8
9V ?= 0
10QUIET = $(shell [ "$(V)" = "0" ] && echo @)
11
12ex55: ex55k.o
13
14#-------------------------------------------------------------------------
15
16#  these tests are used by the makefile in PETSC_DIR for basic tests of the install and should not be removed
17testex5f: ex5f.PETSc
18	-${QUIET}${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex5f -snes_rtol 1e-4 > ex5f.tmp 2>&1;
19	-${QUIET}${DIFF} output/ex5f_1.testout ex5f.tmp > ex5f.dtmp;
20	-@if [ ! -s ex5f.dtmp ];  then \
21		echo "Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process"; \
22	else \
23		echo "Possible error running Fortran example src/snes/tutorials/ex5f with 1 MPI process"; \
24		echo "See https://petsc.org/release/faq/";\
25		cat ex5f.tmp; \
26		touch ../../../check_error;\
27	fi; \
28	${RM} -f ex5f.tmp ex5f.dtmp;
29testex19: ex19.PETSc
30	-${QUIET}${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres  > ex19.tmp 2>&1;
31	-${QUIET}${DIFF} output/ex19_1.testout ex19.tmp > ex19.dtmp;
32	-@if [ ! -s ex19.dtmp ];  then \
33		echo "C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process"; \
34	else \
35		echo "Possible error running C/C++ src/snes/tutorials/ex19 with 1 MPI process"; \
36		echo "See https://petsc.org/release/faq/";\
37		cat ex19.tmp;\
38		touch ../../../check_error;\
39	fi; \
40	${RM} -f ex19.tmp ex19.dtmp;
41testex19_mpi:
42	-${QUIET}${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres  > ex19.tmp 2>&1;
43	-${QUIET}${DIFF} output/ex19_1.testout ex19.tmp > ex19.dtmp;
44	-@if [ ! -s ex19.dtmp ];  then \
45		echo "C/C++ example src/snes/tutorials/ex19 run successfully with 2 MPI processes"; \
46	else \
47		echo "Possible error running C/C++ src/snes/tutorials/ex19 with 2 MPI processes"; \
48		echo "See https://petsc.org/release/faq/";\
49		cat ex19.tmp; \
50		touch ../../../check_error;\
51	fi; \
52	${RM} -f ex19.tmp ex19.dtmp;
53#use unpreconditioned norm because HYPRE device installations use different AMG parameters
54runex19_hypre:
55	-${QUIET}${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -ksp_norm_type unpreconditioned -pc_type hypre > ex19.tmp 2>&1;
56	-${QUIET}${DIFF} output/ex19_hypre.out ex19.tmp > ex19.dtmp;
57	-@if [ ! -s ex19.dtmp ];  then \
58		echo "C/C++ example src/snes/tutorials/ex19 run successfully with HYPRE"; \
59	else  \
60		printf "${PWD}\nPossible problem with ex19 running with HYPRE, diffs above\n=========================================\n";\
61		touch ../../../check_error;\
62	fi; \
63	${RM} -f ex19.tmp ex19.dtmp;
64runex19_hypre_cuda:
65	-${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;
66	-${QUIET}${DIFF} output/ex19_hypre.out ex19.tmp > ex19.dtmp;
67	-@if [ ! -s ex19.dtmp ];  then \
68		echo "C/C++ example src/snes/tutorials/ex19 run successfully with HYPRE/CUDA"; \
69	else  \
70		printf "${PWD}\nPossible problem with ex19 running with HYPRE/CUDA, diffs above\n=========================================\n"; \
71		touch ../../../check_error;\
72	fi; \
73	${RM} -f ex19.tmp ex19.dtmp;
74runex19_hypre_hip:
75	-${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;
76	-${QUIET}${DIFF} output/ex19_hypre.out ex19.tmp > ex19.dtmp;
77	-@if [ ! -s ex19.dtmp ];  then \
78		echo "C/C++ example src/snes/tutorials/ex19 run successfully with HYPRE/HIP"; \
79	else \
80		printf "${PWD}\nPossible problem with ex19 running with HYPRE/HIP, diffs above\n=========================================\n";\
81		touch ../../../check_error;\
82	fi; \
83	${RM} -f ex19.tmp ex19.dtmp;
84runex19_cuda:
85	-${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;
86	-${QUIET}${DIFF} output/ex19_cuda_1.out ex19.tmp > ex19.dtmp;
87	-@if [ ! -s ex19.dtmp ];  then \
88		echo "C/C++ example src/snes/tutorials/ex19 run successfully with CUDA"; \
89	else  \
90		printf "${PWD}\nPossible problem with ex19 running with CUDA, diffs above\n=========================================\n"; \
91		touch ../../../check_error;\
92	fi; \
93	${RM} -f ex19.tmp ex19.dtmp;
94runex19_hip:
95	-${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;
96	-${QUIET}${DIFF} output/ex19_hip_1.out ex19.tmp > ex19.dtmp;
97	-@if [ ! -s ex19.dtmp ];  then \
98		echo "C/C++ example src/snes/tutorials/ex19 run successfully with HIP"; \
99	else  \
100		printf "${PWD}\nPossible problem with ex19 running with HIP, diffs above\n=========================================\n"; \
101		touch ../../../check_error;\
102	fi; \
103	${RM} -f ex19.tmp ex19.dtmp;
104runex19_ml:
105	-${QUIET}${MPIEXEC} -n 2 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -pc_type ml > ex19.tmp;
106	-${QUIET}${DIFF} output/ex19_ml.out ex19.tmp > ex19.dtmp;
107	-@if [ ! -s ex19.dtmp ];  then \
108		echo "C/C++ example src/snes/tutorials/ex19 run successfully with ML"; \
109	else \
110		printf "${PWD}\nPossible problem with ex19 running with ML, diffs above\n=========================================\n"; \
111		touch ../../../check_error;\
112	fi; \
113	${RM} -f ex19.tmp ex19.dtmp;
114runex19_fieldsplit_mumps:
115	-${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;
116	-${QUIET}${DIFF} output/ex19_fieldsplit_5.out ex19.tmp > ex19.dtmp;
117	-@if [ ! -s ex19.dtmp ];  then \
118		echo "C/C++ example src/snes/tutorials/ex19 run successfully with MUMPS"; \
119	else  \
120		printf "${PWD}\nPossible problem with ex19 running with MUMPS, diffs above\n=========================================\n";\
121		touch ../../../check_error;\
122	fi; \
123	${RM} -f ex19.tmp ex19.dtmp;
124runex19_superlu_dist:
125	-${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;
126	-${QUIET}${DIFF} output/ex19_superlu.out ex19.tmp > ex19.dtmp;
127	-@if [ ! -s ex19.dtmp ];  then \
128		echo "C/C++ example src/snes/tutorials/ex19 run successfully with SuperLU_DIST"; \
129	else  \
130		printf "${PWD}\nPossible problem with ex19 running with SuperLU_DIST, diffs above\n=========================================\n"; \
131		touch ../../../check_error;\
132	fi; \
133	${RM} -f ex19.tmp ex19.dtmp;
134runex19_suitesparse:
135	-${QUIET}${MPIEXEC} -n 1 ${MPIEXEC_TAIL} ./ex19 -da_refine 3 -snes_monitor_short -pc_type lu -pc_factor_mat_solver_type umfpack > ex19.tmp;
136	-${QUIET}${DIFF} output/ex19_suitesparse.out ex19.tmp > ex19.dtmp;
137	-@if [ ! -s ex19.dtmp ];  then \
138		echo "C/C++ example src/snes/tutorials/ex19 run successfully with SuiteSparse"; \
139	else \
140		printf "${PWD}\nPossible problem with ex19 running with SuiteSparse, diffs above\n=========================================\n"; \
141		touch ../../../check_error;\
142	fi; \
143	${RM} -f ex19.tmp ex19.dtmp;
144runex3k_kokkos: ex3k.PETSc
145	-${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;
146	-${QUIET}${DIFF} output/ex3k_1.out ex3k.tmp > ex3k.dtmp;
147	-@if [ ! -s ex3k.dtmp ];  then \
148    echo "C/C++ example src/snes/tutorials/ex3k run successfully with Kokkos Kernels"; \
149  else \
150    printf "${PWD}\nPossible problem with ex3k running with Kokkos Kernels, diffs above\n=========================================\n"; \
151    touch ../../../check_error;\
152  fi; \
153	${RM} -f ex3k.tmp ex3k.dtmp;
154