This repository has been archived by the owner on Nov 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
executable file
·196 lines (144 loc) · 7.3 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
########################################################################
# This is the makefile for NetPIPE
# Simply type make with one of the following choices for environments:
#
# The 2-sided modules below use mpicc to compile and MPI to handshake/bcast/gather/sync
# mpi : Test MPI between/within nodes for 1 or more pairs
# ibverbs : Test ibverbs RC or UD, 2-sided or RDMA, inline
# tcp : Test TCP sockets
#
# memcpy : measure memcpy(), memset(), dcopy, dread, dwrite
# disk : measure read/write IO rates and file cp
# theo : create a theoretical performance curve
#
# If you don't have MPI installed you can use a research version MP_Lite that
# runs on top of TCP
#
# make ibverbs_mplite
# ./bin/mprun -np 2 -h host1 host2 NPibverbs ...
# make memcpy_mplite
#
# There are also built in debug funtions dbprintf()
#
# make mpi_debug
#
# I don't know if the modules below work anymore
# shmem : Measure SHMEM using shmem.c
# ntcopy : measure the memory copy rate of ntcopy
# amdcopy :
#
# For more information, see the function printusage() in netpipe.c
########################################################################
CC = gcc
ifdef MACOSX_DEPLOYMENT_TARGET
CFLAGS = -g -O3 -Wall
else
CFLAGS = -g -O3 -Wall -lrt
endif
SRC = ./src
# Set -DNOCOLOR if you want to live in a dull and boring world
DEFS =
#DEFS = -DNOCOLOR
HOME = /homes/daveturner
# mpicc will set up the proper include and library paths
MPICC = mpicc
MPICHCC = $(HOME)/libs/mpich/bin/mpicc
MVAPICHCC = $(HOME)/libs/mvapich/bin/mpicc
OPENMPICC = $(HOME)/libs/openmpi/bin/mpicc
all:mpi
clean distclean:
rm -f *.o NP* np.out MP_Lite/*.o
(cd MP_Lite; make clean)
clear:
rm -f netpipe.o* netpipe.po*
# This section of the Makefile is for compiling the binaries
mpi: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmpi -I$(SRC)
mpi_debug: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmpi -I$(SRC) -DDEBUG
openmpi: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(OPENMPICC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmpi -I$(SRC)
mpich: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICHCC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmpich -I$(SRC)
mvapich: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MVAPICHCC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmvapich -I$(SRC)
# TCP compilating
tcp: $(SRC)/tcp.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/tcp.c -DTCP $(DEFS) -o NPtcp -I$(SRC)
tcp_debug: $(SRC)/tcp.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/tcp.c -DTCP $(DEFS) -o NPtcp -I$(SRC) -DDEBUG
tcp_mplite: $(SRC)/tcp.c $(SRC)/netpipe.c $(SRC)/netpipe.h
( cd ./MP_Lite; make; )
$(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/tcp.c -DTCP $(DEFS) -o NPtcp -I$(SRC) \
-I./MP_Lite ./MP_Lite/libmplite.a
# IB verbs
ibverbs: $(SRC)/ibverbs.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/ibverbs.c $(SRC)/netpipe.c -o NPibverbs -DIBVERBS $(DEFS) -libverbs
ibverbs_debug: $(SRC)/ibverbs.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/ibverbs.c $(SRC)/netpipe.c -o NPibverbs -DIBVERBS $(DEFS) -libverbs -DDEBUG
ibverbs_mplite: $(SRC)/ibverbs.c $(SRC)/netpipe.c $(SRC)/netpipe.h
( cd ./MP_Lite; make; )
$(CC) $(CFLAGS) $(SRC)/ibverbs.c $(SRC)/netpipe.c -o NPibverbs -DIBVERBS $(DEFS) -libverbs \
-I./MP_Lite ./MP_Lite/libmplite.a
# IO module
disk: $(SRC)/disk.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/disk.c -DDISK $(DEFS) -o NPdisk -I$(SRC)
disk_debug: $(SRC)/disk.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/disk.c -DDISK $(DEFS) -o NPdisk -I$(SRC) -DDEBUG
# Theoretical model
theo: $(SRC)/theo.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/theo.c -o NPtheo -DTHEO -I$(SRC)
# memcpy module
memcpy: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/memcpy.c $(DEFS) -o NPmemcpy -I$(SRC)
memcpy.icc: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h
export OMPI_CC=icc; mpicc --version; $(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/memcpy.c $(DEFS) -o NPmemcpy.icc -I$(SRC)
memcpy_debug: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/memcpy.c $(DEFS) -o NPmemcpy -I$(SRC) -DDEBUG
memcpy_mplite: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h
( cd ./MP_Lite; make; )
$(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/memcpy.c $(DEFS) -o NPmemcpy -I$(SRC) \
-I./MP_Lite ./MP_Lite/libmplite.a
# Everything below probably doesn't work
ntcopy: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h $(SRC)/opt_memcpy.c
$(CC) $(CFLAGS) -mmmx -msse $(SRC)/netpipe.c $(SRC)/memcpy.c \
$(SRC)/opt_memcpy.c -DUSE_OPT_MEMCPY -DNTCOPY $(DEFS) \
-o NPntcopy -I$(SRC)
amdcopy: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h $(SRC)/opt_memcpy.c
$(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/memcpy.c \
$(SRC)/opt_memcpy.c $(SRC)/mmx_copy.s -DUSE_OPT_MEMCPY \
-DAMDCOPY $(DEFS) -o NPamdcopy -I$(SRC)
pagecopy: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h $(SRC)/opt_memcpy.c
$(CC) $(CFLAGS) -mmmx -msse $(SRC)/netpipe.c $(SRC)/memcpy.c \
$(SRC)/opt_memcpy.c -DUSE_OPT_MEMCPY \
-DPAGECOPY $(DEFS) -o NPpagecopy -I$(SRC)
mmxcopy: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h $(SRC)/opt_memcpy.c
$(CC) $(CFLAGS) -mmmx -msse $(SRC)/netpipe.c $(SRC)/memcpy.c \
$(SRC)/opt_memcpy.c -DUSE_OPT_MEMCPY \
-DMMXCOPY $(DEFS) -o NPmmxcopy -I$(SRC)
shmem: $(SRC)/shmem.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/shmem.c \
-DSHMEM $(DEFS) -o NPshmem -I$(SRC) -lshmem
sync: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h
( cd ~/mplite; make clean; make sync; )
$(CC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmplite \
-I$(SRC) -I$(MP_Lite_home) $(MP_Lite_home)/libmplite.a
mpi3: $(SRC)/mpi3_shm.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi3_shm.c -o NPmpi3 -I$(SRC)
mpi2: $(SRC)/mpi2.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(MPICC) $(CFLAGS) -DMPI -DMPI2 $(DEFS) $(SRC)/netpipe.c \
$(SRC)/mpi2.c -o NPmpi2 -I$(SRC)
mplite MP_Lite sigio: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h
( cd $(MP_Lite_home); make; )
$(CC) $(CFLAGS) -DMPI $(DEFS) $(SRC)/netpipe.c $(SRC)/mpi.c \
-o NPmplite -I$(SRC) -I$(MP_Lite_home) $(MP_Lite_home)/libmplite.a
kput kcopy_put: $(SRC)/kcopy_put.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(CC) $(CFLAGS) -DKCOPY $(DEFS) $(SRC)/netpipe.c \
$(SRC)/kcopy_put.c -o NPkput
kpost kcopy_post: $(SRC)/kcopy_post.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(CC) $(CFLAGS) -DKCOPY $(DEFS) $(SRC)/netpipe.c \
$(SRC)/kcopy_post.c -o NPkpost
sisci: $(SRC)/sisci.c $(SRC)/netpipe.c $(SRC)/netpipe.h
$(CC) $(CFLAGS) -DSISCI $(SRC)/netpipe.c \
$(SRC)/sisci.c -o NPsisci -I$(SRC) \
-I/opt/DIS/include -I/opt/DIS/src/SCI_SOCKET/scilib/SISCI -L/opt/DIS/