xref: /petsc/src/benchmarks/streams/makefile (revision 5b6bfdb9644f185dbf5e5a09b808ec241507e1e7)
1
2ALL:
3
4CFLAGS	      =
5FFLAGS	      =
6CPPFLAGS      =
7FPPFLAGS      =
8LOCDIR        = src/benchmarks/streams/
9EXAMPLESC     = BasicVersion.c MPIVersion.c OpenMPVersion.c SSEVersion.c PthreadVersion.c
10EXAMPLESF     =
11TESTS         = BasicVersion OpenMPVersion
12MANSEC        = Sys
13
14include ${PETSC_DIR}/lib/petsc/conf/variables
15include ${PETSC_DIR}/lib/petsc/conf/rules
16include ${PETSC_DIR}/lib/petsc/conf/test
17
18BasicVersion: BasicVersion.o  chkopts
19	-@${CLINKER} -o BasicVersion BasicVersion.o ${PETSC_LIB}
20	@${RM} -f BasicVersion.o
21
22MPIVersion: MPIVersion.o  chkopts
23	-@${CLINKER} -o MPIVersion MPIVersion.o ${PETSC_LIB}
24	@${RM} -f MPIVersion.o
25
26OpenMPVersion: OpenMPVersion.o  chkopts
27	-@${CLINKER} -o OpenMPVersion OpenMPVersion.o ${PETSC_LIB}
28	@${RM} -f OpenMPVersion.o
29
30SSEVersion: SSEVersion.o chkopts
31	-${CLINKER} -o $@ $< ${PETSC_LIB}
32	${RM} -f $<
33
34PthreadVersion: PthreadVersion.o  chkopts
35	-@${CLINKER} -o PthreadVersion PthreadVersion.o ${PETSC_LIB}
36	@${RM} -f PthreadVersion.o
37
38# make streams [NPMAX=integer_number_of_MPI_processes_to_use] [MPI_BINDING='binding options']
39stream:  MPIVersion
40	@if [ "${NPMAX}foo" = "foo" ]; then echo "---------"; printf " Run with [PETSC_OPTIONS=-process_view] make streams NPMAX=<integer number of MPI processes> [MPI_BINDING='-bind-to core -map-by numa']\n or       [I_MPI_PIN_PROCESSOR_LIST=:map=scatter] [PETSC_OPTIONS=-process_view] make streams NPMAX=<integer number of MPI processes>\n"; exit 1 ; fi
41	-@printf "" > scaling.log
42	-@printf "Running streams with '${MPIEXEC} ${MPI_BINDING}' using 'NPMAX=${NPMAX}' "
43	-@i=0; while [ $${i} -lt ${NPMAX} ]; do i=`expr $${i} + 1`; \
44	  ${MPIEXEC} ${MPI_BINDING} -n $${i} ./MPIVersion | tee -a scaling.log; \
45        done
46	-@echo "------------------------------------------------"
47	-@${PYTHON} process.py createfile
48
49hwloc:
50	-@if [ "${LSTOPO}foo" != "foo" ]; then ${MPIEXEC} ${MPI_BINDING} -n 1 ${LSTOPO} --no-icaches --no-io --ignore PU ; fi
51
52streams: stream hwloc
53	-@${PYTHON} process.py
54
55
56