-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (42 loc) · 1.16 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
NPROC=$(shell sed -n 25p data/init_data.txt | tr -d -c 0-9)
OUT=/media/sf_Archdata/
#Compiling parameters
CXX = mpic++
FLAGS = -std=c++17 -O3 -g
RUN = mpirun -np $(NPROC) --oversubscribe ./
SOURCES = $(wildcard code/*.cpp)
DEPENDENCIES = $(SOURCES:code/%.cpp=.objects/%.o)
.PHONY: all run graph show send cluster clean oclean
all: main.x
@echo 'Program Compiled.'
run: main.x
@echo -e 'Running program...'
@$(RUN)$<
@echo -e 'Done!'
graph: data/results/system_state.txt
@echo -e 'Ploting system variables... \c'
@gnuplot scripts/plot_system_state.gp
@echo -e 'Done!'
#@gnuplot scripts/analysis.gp
show:
@xpdf data/energy.pdf data/activation_partial.pdf data/activation_total.pdf &
send:
@cp data/*pdf $(OUT)
cluster: main.x
@bash scripts/send.sh
main.x: $(DEPENDENCIES)
@echo -e 'Compiling' $@ '... \c'
@$(CXX) $(FLAGS) $^ -o $@
@echo -e 'Done!\n'
.objects/%.o: code/%.cpp
@echo -e 'Building' $@ '... \c'
@$(CXX) $(FLAGS) -c $< -o $@
@echo -e 'Done!\n'
data/results/system_state.txt:
@bash scripts/print_system.sh
clean:
@rm -f data/results/*.csv data/*.err data/*.out *.x *.log
rclean:
@rm -f data/*.pdf data/results/*.txt
oclean:
@rm -f .objects/*.o *.x