xref: /petsc/src/benchmarks/streams/makefile (revision 3f02e49b19195914bf17f317a25cb39636853415)
1-include ../../../petscdir.mk
2
3MANSEC        = Sys
4#CFLAGS        = -mcmodel=large
5# The CFLAGS above allows very large global arrays
6
7include ${PETSC_DIR}/lib/petsc/conf/variables
8include ${PETSC_DIR}/lib/petsc/conf/rules
9
10BasicVersion: BasicVersion.o
11	-@${CLINKER} -o BasicVersion BasicVersion.o ${PETSC_LIB}
12	@${RM} -f BasicVersion.o
13
14MPIVersion: MPIVersion.o
15	-@${CLINKER} -o MPIVersion MPIVersion.o ${PETSC_LIB}
16	@${RM} -f MPIVersion.o
17
18CUDAVersion: CUDAVersion.o
19	-@${CLINKER} -o CUDAVersion CUDAVersion.o ${PETSC_LIB}
20	@${RM} -f CUDAVersion.o
21
22OpenMPVersion: OpenMPVersion.o
23	-@${CLINKER} -o OpenMPVersion OpenMPVersion.o
24	@${RM} -f OpenMPVersion.o
25
26OpenMPVersionLikeMPI: OpenMPVersionLikeMPI.o
27	-@${CLINKER} -o OpenMPVersionLikeMPI OpenMPVersionLikeMPI.o
28	@${RM} -f OpenMPVersionLikeMPI.o
29
30SSEVersion: SSEVersion.o
31	-${CLINKER} -o $@ $< ${PETSC_LIB}
32	${RM} -f $<
33
34PthreadVersion: PthreadVersion.o
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']
39mpistream:  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}' \n"
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 MPI fileoutput
48
49# Works on SUMMIT
50cudastreamjsrun:  CUDAVersion
51	@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
52	-@printf "" > scaling.log
53	-@printf "Running streams with '${MPIEXEC} ${MPI_BINDING}' using 'NPMAX=${NPMAX}' \n"
54	-@i=0; while [ $${i} -lt ${NPMAX} ] && [ $${i} -lt 7 ]; do i=`expr $${i} + 1`; \
55	  ${MPIEXEC} ${MPI_BINDING} -n 1 -c$${i} -a$${i} -g1 ./CUDAVersion | tee -a scaling.log; \
56        done
57	-@n=1; i=7; while [ $${i} -lt ${NPMAX} ]; do i=`expr $${i} + 7`; n=`expr $${n} + 1`; \
58	       c=5; while [ $${c} -lt 7 ]; do c=`expr $${c} + 1`; \
59	  ${MPIEXEC} ${MPI_BINDING} -n $${n} -c$${c} -a$${c} -g1 ./CUDAVersion | tee -a scaling.log; \
60        done; done
61	-@echo "------------------------------------------------"
62	-@${PYTHON} process.py CUDA fileoutput
63
64openmpstream:  OpenMPVersion
65	@if [ "${NPMAX}foo" = "foo" ]; then echo "---------"; printf " Run with make openmpstream NPMAX=<integer number of threads>\n"; exit 1 ; fi
66	-@printf "" > scaling.log
67	@-@printf "Running openmpstreams using 'NPMAX=${NPMAX}'\n"
68	-@i=0; while [ $${i} -lt ${NPMAX} ]; do i=`expr $${i} + 1`; \
69	  OMP_NUM_THREADS=$${i} ./OpenMPVersion  | tee -a scaling.log;\
70        done
71	-@${PYTHON} process.py OpenMP fileoutput
72
73openmplikempistream:  OpenMPVersionLikeMPI
74	@if [ "${NPMAX}foo" = "foo" ]; then echo "---------"; printf " Run with make openmplikempistream NPMAX=<integer number of threads>\n"; exit 1 ; fi
75	-@printf "" > scaling.log
76	@-@printf "Running openmplikempistreams using 'NPMAX=${NPMAX}'\n"
77	-@i=0; while [ $${i} -lt ${NPMAX} ]; do i=`expr $${i} + 1`; \
78	  OMP_NUM_THREADS=$${i} ./OpenMPVersionLikeMPI  | tee -a scaling.log;\
79        done
80	-@${PYTHON} process.py OpenMPLikeMPI fileoutput
81
82hwloc:
83	-@if [ "${LSTOPO}foo" != "foo" ]; then ${MPIEXEC} ${MPI_BINDING} -n 1 ${LSTOPO} --no-icaches --no-io --ignore PU ; fi
84
85mpistreams: mpistream hwloc
86	-@${PYTHON} process.py MPI
87
88openmpstreams: openmpstream hwloc
89	-@${PYTHON} process.py OpenMP
90