forked from wrf-model/WRF
-
Notifications
You must be signed in to change notification settings - Fork 2
/
runcodee
executable file
·121 lines (86 loc) · 4.28 KB
/
runcodee
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
#!/bin/bash
date
ml cpu
#ml use /global/common/software/m4232/modulefiles_test/pm
ml codee
ml -t
RPWD=$(realpath $PWD) # if not in HOME, can use RPWD=$PWD
# (1) All
#codee screening --config compile_commands.json \
# --exclude ${RPWD}/phys/module_sf_noahmplsm.f90 \
# --exclude ${RPWD}/phys/module_shcu_deng.f90 \
# --exclude ${RPWD}/phys/module_cu_kf.f90 \
# --verbose
# (2) show failures
#codee screening --show-failures=all \
# --config compile_commands.json \
# --exclude ${RPWD}/phys/module_sf_noahmplsm.f90 \
# --exclude ${RPWD}/phys/module_shcu_deng.f90 \
# --exclude ${RPWD}/phys/module_cu_kf.f90 \
# --verbose
# (3) Screening report of the entire phys directory
#codee screening --config compile_commands.json \
## --brief ${RPWD}/phys/ \
## --exclude ${RPWD}/phys/module_sf_noahmplsm.f90 \
## --exclude ${RPWD}/phys/module_shcu_deng.f90 \
## --exclude ${RPWD}/phys/module_cu_kf.f90 \
## --verbose
#codee screening --config compile_commands.json --brief ${RPWD}/phys/ \
# --exclude ${RPWD}/phys/module_sf_noahmplsm.f90 \
# --exclude ${RPWD}/phys/module_shcu_deng.f90 \
# --exclude ${RPWD}/phys/module_cu_kf.f90
#
#codee screening --config compile_commands.json \
## --exclude ${RPWD}/phys/module_sf_noahmplsm.f90 \
## --exclude ${RPWD}/phys/module_shcu_deng.f90 \
## --exclude ${RPWD}/phys/module_cu_kf.f90 \
## --verbose
# (4) screeing report of Thompson
#codee screening --config compile_commands.json \
# --brief ${RPWD}/phys/module_mp_thompson.f90
#codee screening --config compile_commands.json \
# --brief ${RPWD}/phys/module_mp_thompson.f90 --target-arch gpu
# Checks report of Thompson (add --verbose to see more detals)
#codee checks --config compile_commands.json \
# --brief ${RPWD}/phys/module_mp_thompson.f90
#codee checks --config compile_commands.json \
# --brief ${RPWD}/phys/module_mp_thompson.f90 --target-arch gpu
# Codee diagnose report of Thompson
#codee diagnose --summary \
# --config compile_commands.json \
# --brief ${RPWD}/phys/module_mp_thompson.f90
#codee diagnose --summary \
# --config compile_commands.json \
# --brief ${RPWD}/phys/module_mp_thompson.f90 --target-arch gpu
# (5) Focus on a single function, e.g., Kernals_KS
#codee screening --config compile_commands.json \
# ${RPWD}/phys/module_mp_fast_sbm.f90:Kernals_KS --target-arch gpu
# (6) Check the lines
#codee checks --verbose \
# --config compile_commands.json \
# ${RPWD}/phys/module_mp_fast_sbm.f90:Kernals_KS --target-arch gpu
# (7) Apply fix with codee: loop interchange
#codee rewrite --memory loop-interchange --in-place \
# --config compile_commands.json \
# ${RPWD}/phys/module_mp_fast_sbm.f90:6225:3
# (8) Check again with the modified file:
codee checks --verbose \
--config compile_commands.json \
${RPWD}/phys/module_mp_fast_sbm.f90:Kernals_KS --target-arch gpu
# (8) Apply the fix with codee: OpenMP offloading
#codee rewrite --offload omp-teams --in-place \
# --config compile_commands.json \
# ${RPWD}/phys/module_mp_fast_sbm.f90:6293:4
#codee rewrite --offload omp-teams --in-place \
# --config compile_commands.json \
# ${RPWD}/phys/module_mp_fast_sbm.f90:6225:3,6236:4,6263:4,6291:4,6379:7
# (9) Check again with the modified file:
#codee checks --verbose \
# --config compile_commands.json \
# ${RPWD}/phys/module_mp_fast_sbm.f90:Kernals_KS --target-arch gpu
# (9) Apply fix with codee: OpenMP offloading
#codee rewrite --offload omp-teams --in-place \
# --config compile_commands.json \
# ${RPWD}/phys/module_mp_fast_sbm.f90:6238:4,6265:4,6392:7
#codee rewrite --help
date