this repo has no description
1#
2# Simulation of rainwater flooding
3#
4#
5
6# Compilers
7CC=gcc
8CUDACC=nvcc
9
10# Flags for optimization and libs
11FLAGS=-O3 -Wall
12CUFLAGS=-O3
13LIBS=-lm
14CULIBS=-lm rng.c
15
16# Targets to build
17OBJS=flood_seq flood_cuda
18
19# Rules. By default show help
20help:
21 @echo
22 @echo "Simulation of rainwater flooding"
23 @echo
24 @echo "make flood_seq Build only the sequential version"
25 @echo "make flood_cuda Build only the CUDA version"
26 @echo
27 @echo "make all Build all versions (Sequential & CUDA)"
28 @echo "make debug Build sequential version with demo output for small surfaces"
29 @echo "make animation Build the sequential version to produce the animation data"
30 @echo "make clean Remove targets"
31 @echo "make test_seq Build and run the sequential version with a simple input sequence (not suitable for DAS5)"
32 @echo "make test_seq_remote Build and run the sequential version with a simple input sequence on a compute node"
33 @echo "make test_cuda Build and run the CUDA version with a simple input sequence on a compute node"
34 @echo
35
36all: $(OBJS)
37
38flood.o: flood.c
39 $(CC) $(FLAGS) $(DEBUG) -c $< -o $@
40
41flood_seq.o: flood_seq.c
42 $(CC) $(FLAGS) $(DEBUG) -c $< -o $@
43
44flood_seq: flood.o flood_seq.o
45 $(CC) $(DEBUG) $^ $(LIBS) -o $@
46
47flood_cuda.o: flood_cuda.cu
48 $(CUDACC) $(CUFLAGS) $(DEBUG) -c $< -o $@
49
50flood_cuda: flood.o flood_cuda.o
51 $(CUDACC) $(DEBUG) $^ $(CULIBS) -o $@
52
53# Remove the target files
54clean:
55 rm -rf $(OBJS) *.o
56
57# Compile in debug mode (currently sequential version only)
58debug:
59 make FLAGS="$(FLAGS) -DDEBUG -g" flood_seq
60
61# Compile to generate animation (currently sequential version only)
62animation:
63 make FLAGS="$(FLAGS) -DDEBUG -DANIMATION -g" flood_seq
64
65animation_cuda:
66 make CUFLAGS="$(CUFLAGS) -DDEBUG -DANIMATION -g" FLAGS="$(FLAGS) -DDEBUG -DANIMATION -g" flood_cuda
67
68test_seq: flood_seq
69 ./flood_seq $(cat test_files/debug.in)
70
71test_seq_remote: flood_seq
72 prun -t 15:00 -np 1 -native '-C gpunode' ./flood_seq $$(cat test_files/debug.in)
73
74test_cuda: flood_cuda
75 prun -t 15:00 -np 1 -native '-C gpunode' ./flood_cuda $$(cat test_files/debug.in)