-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
114 lines (96 loc) · 3.72 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
# make cluster-submit-lammps Z=3 p=1 n=-1 c=0.5 d=0.714 a=0.714 i=0.0 S=5000000
# make local-run-lammps Z=3 p=1 n=-1 c=0.5 d=0.714 a=0.714 i=0.0 S=5000000 MPIRUNCMD=mpirun LAMMPSEXE=lmp
#This make file builds the sub folder make files
PROG = md_simulation_confined_ions
JOBSCR = nanoconfinement.pbs
TEST = test.pbs
JOBSCRLMP = nanoconfinement-lammps.pbs
BIN = bin
BASE = src
SCRIPT = scripts
Z=3
p=1
n=-1
c=0.5
d=0.714
a=0.714
i=0.0
S=5000000
NODESIZE=4
MPIRUNCMD = srun
LAMMPSEXE = lmp_mpi
all:
@echo "Starting build of the $(BASE) directory";
ifeq ($(CCF),BigRed2)
+$(MAKE) -C $(BASE) cluster-install
else ifeq ($(CCF),nanoHUB)
+$(MAKE) -C $(BASE) install
else
+$(MAKE) -C $(BASE) local-install
endif
@echo "Ending the build of the $(BASE) directory";
@echo "installing the $(PROG) into $(BIN) directory"; cp -f $(BASE)/$(PROG) $(BIN)
local-install: create-dirs
make CCF=LOCAL all
cluster-install: create-dirs
make CCF=BigRed2 all
nanoHUB-install: create-dirs
make CCF=nanoHUB all
create-dirs:
@echo "Checking and creating needed sub-directories in the $(BIN) directory"
if ! [ -d $(BIN) ]; then mkdir $(BIN); fi
if ! [ -d $(BIN)/outfiles ]; then mkdir $(BIN)/outfiles; fi
if ! [ -d $(BIN)/infiles ]; then mkdir $(BIN)/infiles; fi
if ! [ -d $(BIN)/data ]; then mkdir $(BIN)/data; fi
if ! [ -d $(BIN)/screen ]; then mkdir $(BIN)/screen; fi
@echo "Directory creation is over."
cluster-submit:
@echo "Installing jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(JOBSCR) $(BIN)
+$(MAKE) -C $(BIN) submit
cluster-test-submit:
@echo "Installing test jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(TEST) $(BIN)
+$(MAKE) -C $(BIN) test
cluster-submit-lammps:
@echo "Running the preprocessor to create lammps script and input script."
+$(MAKE) -C $(BIN) run-preprocessor Z=$(Z) p=$(p) n=$(n) c=$(c) d=$(d) a=$(a) i=$(i) S=$(S)
@echo "Running the preprocessor is over."
@echo "Installing jobscript into $(BIN) directory"
cp -f $(SCRIPT)/$(JOBSCRLMP) $(BIN)
+$(MAKE) -C $(BIN) submit-lammps
run-postprocessor:
+$(MAKE) -C $(BIN) run-postprocessor Z=$(Z) p=$(p) n=$(n) c=$(c) d=$(d) a=$(a) i=$(i) S=$(S) MPIRUNCMD=$(MPIRUNCMD)
@echo "Postprocessing is over."
local-run-parallel-lammps:
@echo "Running the preprocessor to create lammps script and input script."
+$(MAKE) -C $(BIN) run-preprocessor Z=$(Z) p=$(p) n=$(n) c=$(c) d=$(d) a=$(a) i=$(i) S=$(S) MPIRUNCMD=$(MPIRUNCMD)
@echo "Running the preprocessor is over."
+$(MAKE) -C $(BIN) run-local-parallel NODESIZE=$(NODESIZE) MPIRUNCMD=$(MPIRUNCMD) LAMMPSEXE=$(LAMMPSEXE)
@echo "Lammps simulation is over."
+$(MAKE) -C $(BIN) run-postprocessor Z=$(Z) p=$(p) n=$(n) c=$(c) d=$(d) a=$(a) i=$(i) S=$(S) MPIRUNCMD=$(MPIRUNCMD)
@echo "Postprocessing is over."
local-run-lammps:
@echo "Running the preprocessor to create lammps script and input script."
+$(MAKE) -C $(BIN) run-preprocessor Z=$(Z) p=$(p) n=$(n) c=$(c) d=$(d) a=$(a) i=$(i) S=$(S) MPIRUNCMD=$(MPIRUNCMD)
@echo "Running the preprocessor is over."
+$(MAKE) -C $(BIN) run-local-serial LAMMPSEXE=$(LAMMPSEXE)
@echo "Lammps simulation is over."
+$(MAKE) -C $(BIN) run-postprocessor Z=$(Z) p=$(p) n=$(n) c=$(c) d=$(d) a=$(a) i=$(i) S=$(S) MPIRUNCMD=$(MPIRUNCMD)
@echo "Postprocessing is over."
clean: dataclean
rm -f $(BASE)/*.o
rm -f $(BASE)/$(PROG)
rm -f $(BIN)/$(PROG)
rm -rf $(BIN)/outfiles
rm -rf $(BIN)/data
rm -rf $(BIN)/screen
rm -f $(BIN)/*.lammps
rm -rf $(BIN)/temp
dataclean:
rm -f $(BIN)/outfiles/*.dat $(BIN)/outfiles/*.xyz $(BIN)/outfiles/*.lammpstrj $(BIN)/temp/* $(BIN)/screen/*
rm -f $(BIN)/data/*.dat $(BIN)/data/*.xyz $(BIN)/data/*.lammpstrj
rm -f $(BIN)/*.log
rm -f $(BIN)/*.pbs
rm -f $(BIN)/*.lammps
.PHONY: all install cluster-install nanoHUB-install create-dirs cluster-submit cluster-test-submit clean dataclean