xref: /petsc/src/snes/tutorials/makefile (revision efbe7e8a80d07327753dbe0b33efee01e046af3f)
1-include ../../../petscdir.mk
2CFLAGS           =
3FFLAGS		 =
4CPPFLAGS         =
5FPPFLAGS         =
6LOCDIR		 = src/snes/tutorials/
7MANSEC           = SNES
8EXAMPLESC	 = ex1.c ex2.c ex3.c  ex5.c ex9.c \
9                   ex12.c ex14.c ex15.c ex18.c ex19.c ex21.c ex22.c \
10                   ex25.c ex28.c ex30.c ex33.c \
11                   ex35.c ex42.c ex46.c ex48.c \
12                   ex56.c ex58.c ex59.c \
13                   ex62.c ex70.c ex77.c ex78.c \
14                   ex47cu.cu
15EXAMPLESF	 = ex1f.F90 ex5f.F90 ex5f90.F90 ex5f90t.F90 ex40f90.F90 ex73f90t.F90
16EXAMPLESCH	 =
17EXAMPLESFH       = ex5f.h
18EXAMPLESMATLAB   = ex5m.m  ex61genm.m ex61m.m
19DIRS		 = ex10d network
20
21include ${PETSC_DIR}/lib/petsc/conf/variables
22include ${PETSC_DIR}/lib/petsc/conf/rules
23
24#-------------------------------------------------------------------------
25
26#  these tests are used by the makefile in PETSC_DIR for basic tests of the install and should not be removed
27testex5f: ex5f.PETSc
28	@if [ "${PETSC_WITH_BATCH}" != "" ]; then \
29           echo "Running with batch filesystem; to test run src/snes/tutorials/ex5f with" ; \
30           echo "your systems batch system"; \
31        elif [ "${MPIEXEC}" = "/bin/false" ]; then \
32           echo "*mpiexec not found*. Please run src/snes/tutorials/ex5f manually"; \
33        elif [ -f ex5f ]; then \
34	   ${MPIEXEC} -n 1 ./ex5f > ex5f_1.tmp 2>&1; \
35	   if (${DIFF} output/ex5f_1.testout ex5f_1.tmp > /dev/null 2>&1) then \
36           echo "Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process"; \
37	   else echo "Possible error running Fortran example src/snes/tutorials/ex5f with 1 MPI process"; \
38           echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
39           cat ex5f_1.tmp; fi;  \
40         ${RM} -f ex5f_1.tmp ;\
41         ${MAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ex5f.rm; fi
42
43testex19: ex19.PETSc
44	-@if [ "${PETSC_WITH_BATCH}" != "" ]; then \
45           echo "Running with batch filesystem; to test run src/snes/tutorials/ex19 with" ; \
46           echo "your systems batch system"; \
47        elif [ "${MPIEXEC}" = "/bin/false" ]; then \
48           echo "*mpiexec not found*. Please run src/snes/tutorials/ex19 manually"; \
49	elif [ -f ex19 ]; then \
50           ${MPIEXEC} -n 1 ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres  > ex19_1.tmp 2>&1; \
51	   if (${DIFF} output/ex19_1.testout ex19_1.tmp > /dev/null 2>&1) then \
52           echo "C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process"; \
53	   else echo "Possible error running C/C++ src/snes/tutorials/ex19 with 1 MPI process"; \
54           echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
55           cat ex19_1.tmp; fi; \
56	if [ ! "${MPI_IS_MPIUNI}" ]; then \
57           ${MPIEXEC} -n 2 ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres  > ex19_1.tmp 2>&1; \
58	   if (${DIFF} output/ex19_1.testout ex19_1.tmp > /dev/null 2>&1) then \
59           echo "C/C++ example src/snes/tutorials/ex19 run successfully with 2 MPI processes"; \
60	   else echo "Possible error running C/C++ src/snes/tutorials/ex19 with 2 MPI processes"; \
61           echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
62           cat ex19_1.tmp; fi; fi; \
63        ${RM} -f ex19_1.tmp; fi
64runex19_hypre:
65	-@${MPIEXEC} -n 2 ./ex19 -da_refine 3 -snes_monitor_short -pc_type hypre > ex19_1.tmp 2>&1; \
66	   if (${DIFF} output/ex19_hypre.out ex19_1.tmp) then \
67           echo "C/C++ example src/snes/tutorials/ex19 run successfully with hypre"; \
68           else  printf "${PWD}\nPossible problem with ex19 running with hypre, diffs above\n=========================================\n"; fi; \
69	   ${RM} -f ex19_1.tmp
70runex19_cuda:
71	-@${MPIEXEC} -n 1 ./ex19 -snes_monitor -dm_mat_type seqaijcusparse -dm_vec_type seqcuda -pc_type gamg -ksp_monitor -mg_levels_ksp_max_it 3  > ex19_1.tmp 2>&1; \
72	   if (${DIFF} output/ex19_cuda_1.out ex19_1.tmp) then \
73           echo "C/C++ example src/snes/tutorials/ex19 run successfully with cuda"; \
74           else  printf "${PWD}\nPossible problem with ex19 running with cuda, diffs above\n=========================================\n"; fi; \
75	   ${RM} -f ex19_1.tmp
76runex19_ml:
77	-@${MPIEXEC} -n 2 ./ex19 -da_refine 3 -snes_monitor_short -pc_type ml > ex19_1.tmp 2>&1; \
78	   if (${DIFF} output/ex19_ml.out ex19_1.tmp) then  \
79           echo "C/C++ example src/snes/tutorials/ex19 run successfully with ml"; \
80           else  printf "${PWD}\nPossible problem with ex19 running with ml, diffs above\n=========================================\n"; fi; \
81           ${RM} -f ex19_1.tmp
82runex19_fieldsplit_mumps:
83	-@${MPIEXEC} -n 2 ./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; \
84	   if (${DIFF} output/ex19_fieldsplit_5.out ex19_6.tmp) then  \
85           echo "C/C++ example src/snes/tutorials/ex19 run successfully with mumps"; \
86           else  printf "${PWD}\nPossible problem with ex19 running with mumps, diffs above\n=========================================\n"; fi; \
87           ${RM} -f ex19_6.tmp
88runex19_superlu_dist:
89	-@${MPIEXEC} -n 1 ./ex19 -da_grid_x 20 -da_grid_y 20 -pc_type lu -pc_factor_mat_solver_type superlu_dist > ex19.tmp 2>&1; \
90	   if (${DIFF} output/ex19_superlu.out ex19.tmp) then \
91           echo "C/C++ example src/snes/tutorials/ex19 run successfully with superlu_dist"; \
92           else  printf "${PWD}\nPossible problem with ex19 running with superlu_dist, diffs above\n=========================================\n"; fi; \
93	   ${RM} -f ex19.tmp
94runex19_suitesparse:
95	-@${MPIEXEC} -n 1 ./ex19 -da_refine 3 -snes_monitor_short -pc_type lu -pc_factor_mat_solver_type umfpack > ex19_1.tmp 2>&1; \
96	   if (${DIFF} output/ex19_suitesparse.out ex19_1.tmp) then \
97           echo "C/C++ example src/snes/tutorials/ex19 run successfully with suitesparse"; \
98           else  printf "${PWD}\nPossible problem with ex19 running with suitesparse, diffs above\n=========================================\n"; fi; \
99	   ${RM} -f ex19_1.tmp
100runex3_kokkos: ex3k.PETSc
101ifneq ($(KOKKOS_BIN),)
102	-@${MPIEXEC} -n 1 ./ex3k -view_initial -view_kokkos_configuration false -dm_vec_type cuda -vec_pinned_memory_min 0 -use_gpu_aware_mpi 0 -snes_monitor | grep -v "type:" > ex3k_1.tmp 2>&1
103else
104	-@${MPIEXEC} -n 1 ./ex3k -view_initial -view_kokkos_configuration false -snes_monitor | grep -v "type:"  > ex3k_1.tmp 2>&1
105endif
106	-@if (${DIFF} output/ex3k_1.out ex3k_1.tmp) then \
107           echo "C/C++ example src/snes/tutorials/ex3k run successfully with kokkos"; \
108           else  printf "${PWD}\nPossible problem with ex3k running with kokkos, diffs above\n=========================================\n"; \
109        fi; \
110	${RM} -f ex3k_1.tm
111
112include ${PETSC_DIR}/lib/petsc/conf/test
113