# $Id: makefile,v 1.6 1998/04/23 22:45:25 balay Exp $ 

CFLAGS          =  ${CPPFLAGS} -D__SDIR__='"${LOCDIR}"'
FFLAGS          = 
SOURCEC         = 
SOURCEF         =
SOURCEH         =
OBJSC           =
OBJSF           =
LIBBASE         = 
LOCDIR          = src/dfvec/examples/tests/
TESTEXAMPLES_1  = ex1.PETSc runex1 runex1_2 ex1.rm ex2.PETSc runex2_2 runex2_3 \
	 	 runex2_4 ex2.rm 
TESTEXAMPLES_2  = 
TESTEXAMPLES_3  = 
TESTEXAMPLES_4  = ex1.PETSc runex1 ex1.rm clean
TESTEXAMPLES_5  = 
TESTEXAMPLES_6  = 
TESTEXAMPLES_8  = 
BUILDEXAMPLES_1 = ex1.PETSc ex1.rm ex2.PETSc ex2.rm
BUILDEXAMPLES_2 = 
BUILDEXAMPLES_3 = 
BUILDEXAMPLES_4 = ex1.PETSc ex1.rm clean
BUILDEXAMPLES_8 = 

EXAMPLESC       = ex1.c ex2.c
DIRS            = 

include ${PETSC_DIR}/bmake/${PETSC_ARCH}/base

ex1: ex1.o chkopts
	-${CLINKER} -o ex1 ex1.o ${PETSC_LIB}
	${RM} ex1.o

ex2: ex2.o chkopts
	-${CLINKER} -o ex2 ex2.o ${PETSC_LIB}
	${RM} ex2.o

# Note: ex1_1, ex2_1, ex2_2 have identical output
# Note: ex1_2, ex2_3, ex2_4, ex2_5 have identical output
runex1:
	-@${MPIRUN} -np 1 ex1 -mx 4 -my 4 > ex1_1.tmp 2>&1; \
	   if (diff output/ex1_1.out ex1_1.tmp) then true; \
	   else echo "Possible problem with ex1_1, diffs above"; fi; \
	   ${RM} -f ex1_1.tmp
runex1_2:
	-@${MPIRUN} -np 1 ex1 -mx 4 -my 4 -mz 4 > ex1_2.tmp 2>&1; \
	   if (diff output/ex1_2.out ex1_2.tmp) then true; \
	   else echo "Possible problem with ex1_2, diffs above"; fi; \
	   ${RM} -f ex1_2.tmp
runex2:
	-@${MPIRUN} -np 2 ex2 -nox -Nx 2 -Ny 1 -mx 4 -my 4 > ex2_1.tmp 2>&1;	\
	   if (diff output/ex1_1.out ex2_1.tmp) then true; \
	   else echo "Possible problem with ex2_1, diffs above"; fi; \
	   ${RM} -f ex2_1.tmp
runex2_2:
	-@${MPIRUN} -np 2 ex2 -Nx 1 -Ny 2 -mx 4 -my 4 > ex2_2.tmp 2>&1; \
	   if (diff output/ex1_1.out ex2_2.tmp) then true; \
	   else echo "Possible problem with ex2_2, diffs above"; fi; \
	   ${RM} -f ex2_2.tmp
runex2_3:
	-@${MPIRUN} -np 2 ex2 -Nx 2 -Ny 1 -Nz 1 -mx 4 -my 4 -mz 4 > ex2_3.tmp 2>&1; \
	      if (diff output/ex1_2.out ex2_3.tmp) then true; \
	      else echo "Possible problem with ex2_3, diffs above"; fi; \
	      ${RM} -f ex2_3.tmp;
runex2_4:
	-@${MPIRUN} -np 4 ex2 -Nx 1 -Ny 2 -Nz 2 -mx 4 -my 4 -mz 4 > ex2_4.tmp 2>&1; \
	   if (diff output/ex1_2.out ex2_4.tmp) then true; \
	   else echo "Possible problem with ex2_4, diffs above"; fi; \
	   ${RM} -f ex2_4.tmp
runex2_5:
	-@${MPIRUN} -np 4 ex2 -nox -Nx 2 -Ny 2 -Nz 1 -mx 4 -my 4 -mz 4 > ex2_5.tmp 2>&1; \
	   if (diff output/ex1_2.out ex2_5.tmp) then true; \
	   else echo "Possible problem with ex2_5, diffs above"; fi; \
	   ${RM} -f ex2_5.tmp

