-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
141 lines (115 loc) · 4.47 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
MAKEFLAGS += --no-print-directory
# build options to test dynamic library
#LIB_WEILEI_PATH=/rhome/wzeng002/.local/lib
#LIB_WEILEI_PATH=/home/weileizeng/.local/lib
LIB_WEILEI_PATH=/sharedata01/weileizeng/.local/lib
LIB_WEILEI=-L$(LIB_WEILEI_PATH) -lweilei -Iweilei_lib
INC_DIR=weilei_lib
#INC_DIR=~/working/weilei_lib
CXX=g++ -O3 -Wall -std=c++11 -fopenmp
#CXX=g++ -O3 -Wall -std=c++11
# optimization options -O2 -O5 -Os
#ITPP=`pkg-config --cflags itpp` `pkg-config --libs itpp`
#ITPP=`itpp-config --cflags` `itpp-config --libs`
ITPP=-I/sharedata01/weileizeng/gitrepo/install-itpp-locally/itpp-4.3.1/include -O2 -DNDEBUG -L/sharedata01/weileizeng/gitrepo/install-itpp-locally/itpp-4.3.1/lib -litpp
# $(LIB_WEILEI)
#full command example
#g++ `pkg-config --cflags itpp` -o hello.out hello.cpp `pkg-config --libs itpp` -fopenmp
object_files=$(INC_DIR)/mm_read.o $(INC_DIR)/mmio.o $(INC_DIR)/mm_write.o $(INC_DIR)/lib.o $(INC_DIR)/dist.o $(INC_DIR)/product_lib.o $(INC_DIR)/bp.o
header_files=$(INC_DIR)/mm_read.h $(INC_DIR)/mmio.h $(INC_DIR)/mm_write.h $(INC_DIR)/lib.h $(INC_DIR)/dist.h $(INC_DIR)/product_lib.h $(INC_DIR)/bp.h
#make object file for target file
%.o:%.cpp $(header_files)
# $(CXX) $(START) $(END) -c $<
$(CXX) $(ITPP) -c $<
#compile object files for lib files
lib:
cd weilei_lib && make all
#now link object files
%.out:%.o $(object_files)
$(CXX) $(ITPP) -o $@ $< $(object_files)
# eg: make test.o && make lib && make test.out
product:
$(cmd)
test:
$(cmd)
test_lib:
$(cmd)
generate_css_code:
$(cmd)
simulation:
$(cmd)
verification:
$(cmd)
reshape:
$(cmd)
#if it keep running. clean and rebuild weilei_lib
#because I install it locally, i need to inform where the itpp lib is located
# export LD_LIBRARY_PATH="/home/weileizeng/.local/lib:$LD_LIBRARY_PATH" &&
#This was moved to .bashrc
#add your new files here
clean:
rm *.o
rm *.out
#job management
sbatch-dry-run:
sbatch --test run_prod.sh
sbatch:
sbatch run_prod.sh
srun:
srun -n 1 --cpus-per-task=32 --time=24:00:00 ./generate_css_code.out
short:
srun -n 1 -q short --cpus-per-task=32 --time=1:00:00 ./generate_css_code.out
pkill-product:
pkill .product
#test dynamic lib
dynamic:$(LIB_WEILEI_PATH)/libweilei.so
cd weilei_lib && make libweilei.so
$(CXX) $(ITPP) -o test_dynamic.out test.cpp -lweilei -L$(LIB_WEILEI_PATH)
./test_dynamic.out
run-verification:
srun --unbuffered -p small -n 1 --cpus-per-task=16 ./verification.out num_cores=16 code_folder="" filename_list=filelist-run3.txt
run-verification-full:
srun --unbuffered -p small -n 1 --cpus-per-task=16 ./verification.out num_cores=16 code_folder="" filename_list=filelist-run3-full.txt
# srun -p small -n 1 --cpus-per-task=16 --time=6:00:00 ./verification.out num_cores=16 filename_list=filelist-run2-full.txt
run-simulation:
./run_simulation.sh
run-generate:
sbatch sbatch_generate.sh
#steps to collect code data
#currently takes 1 minutes
#./get-filelist.sh
#./processing-codes.py
run-table:
./get-filelist.sh
python3 processing-codes.py
data-statistics:
du -sh data/
ls data/ |wc -l
show-new-codes:
echo "total number of codes generated in this run"
cat log/generate*.log |grep save|wc -l
show-table:
# tail -n 31 run.log
tail -n 67 run.log
#The use of the -v flag in the command mounts the current working directory on the host (${PWD} in the example command) as /home/jovyan/work in the container. The server logs appear in the terminal.
#Visiting http://<hostname>:4000/?token=<token> in a browser loads JupyterLab.
jupyter:
docker run -it --rm --user 1011 --group-add users -p 4001:8888 -e JUPYTER_TOKEN=passwd -v "${PWD}":/home/jovyan/work jupyter/datascience-notebook:85f615d5cafa
qos:
sacctmgr show qos
sacctmgr show qos format=name%-10,Description%-20,priority,maxwall,UsageFactor,MaxTRESPU,MaxJobsPU,
sacctmgr list qos format==name,priority,preempt
interactive:
salloc -q long --time=1-00:00:00
job-history:
# sacct --starttime 2023-09-01T14:00:00 --format JobID,JobName,Elapsed,ExitCode |grep nkd
# date -d '1 month ago' +%D-%R
# sacct --starttime `date -d '2 days ago' +%D-%R` --format JobID%-15,JobName,Elapsed,ExitCode,Partition,QOS,ReqCPUS,START,TotalCPU |grep nkd
sacct --starttime `date -d '2 weeks ago' +%D-%R` --format JobID%-15,JobName,Elapsed,ExitCode,Partition,ReqCPUS,START,TotalCPU |grep nkd
# sacct -S `date -d '1 month ago' +%D-%R`
usage:
sreport user Top start=1/1/22 end=1/1/23 -t percent
sreport user Top start=1/1/23 -t percent
sreport cluster utilization -T billing start=2021-09-19