source:
branches/2016/dev_HPC_Gyre_benchmark_test/NEMOGCM/BENCHMARK/perf_regions_instrumentation.py
@
7230
Last change on this file since 7230 was 7230, checked in by timgraham, 7 years ago | |
---|---|
|
|
File size: 933 bytes |
Line | |
---|---|
1 | #!/usr/bin/env python2.7 |
2 | |
3 | |
4 | import sys |
5 | import os |
6 | path = os.path.expandvars('$PERF_REGIONS_HOME')+'/scripts' |
7 | sys.path.append(path) |
8 | import perf_regions |
9 | |
10 | pf = perf_regions.perf_regions( |
11 | ["../NEMO/OPA_SRC"], # list with source directories |
12 | [ |
13 | ".*timing_init.*", # initialization of timing |
14 | ".*timing_finalize.*", # shutdown of timing |
15 | |
16 | ".*USE timing.*", # include part |
17 | |
18 | ".*timing_start\(\'(.*)\'\)", # start of timing |
19 | ".*timing_stop\(\'(.*)\'\)", # end of timing |
20 | ".*timing_reset.*" # reset of timing |
21 | ], |
22 | # '../../', # perf region root directory |
23 | './', # output directory of perf region tools |
24 | 'fortran', |
25 | '../NEMO/OPA_SRC/timing.F90' # Don't modify timing.F90 |
26 | ) |
27 | |
28 | |
29 | |
30 | if len(sys.argv) > 1: |
31 | if sys.argv[1] == 'preprocess': |
32 | print("PREPROCESS") |
33 | pf.preprocessor() |
34 | |
35 | elif sys.argv[1] == 'cleanup': |
36 | print("CLEANUP") |
37 | pf.cleanup() |
38 | |
39 | else: |
40 | print("Unsupported argument "+sys.argv[1]) |
41 | |
42 | else: |
43 | pf.preprocessor() |
Note: See TracBrowser
for help on using the repository browser.