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