-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (34 loc) · 1.14 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
# Declare variables
CCP = mpicxx
CXXFLAGS = -std=c++11 -Wall -O2
HDRS = myfunctions.h solvers.h
OBJS = coursework.o myfunctions.o solvers.o
LDLIBSP = -lscalapack-openmpi -lblacs-openmpi -lblacsCinit-openmpi -llapack -lblas -lboost_program_options
# Default target
all: Task4 clean
# This target will compile the files
compile: $(OBJS) $(HDRS)
$(CCP) $(CXXFLAGS) $(OBJS) $(HDRS) $(LDLIBSP) -o run
# This target will run the executable with parameters for task 1
Task1: compile
mpirun -np 1 ./run
python [email protected] &
# This target will run the executable with parameters for task 2
Task2: compile
mpirun -np 1 ./run --time_dependence 1 --scheme 0
# python [email protected] &
# This target will run the executable with parameters for task 3
Task3: compile
mpirun -np 1 ./run --time_dependence 1 --scheme 1
python Task1.py &
Task4: compile
mpirun -np 2 ./run --time_dependence 1 --scheme 0 --parallel 1
python Task1.py &
Task5: compile
mpirun -np 4 ./run --Nx 24 --time_dependence 1 --scheme 1 --parallel 1
python Task1.py &
# This target will remove .o files and compile executable
clean:
-rm -f *.o *.txt run
%.o: %.cpp $(HDRS)
$(CCP) $(CXXFLAGS) -o $@ -c $<