New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
perf_regions_instrumentation.py in branches/2016/dev_HPC_Gyre_benchmark_test/NEMOGCM/BENCHMARK – NEMO

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

Added modifications to instrument code and use perf_regions in GYRE_BENCHMARK

  • Property svn:executable set to *
File size: 933 bytes
Line 
1#!/usr/bin/env python2.7
2
3
4import sys
5import os
6path = os.path.expandvars('$PERF_REGIONS_HOME')+'/scripts'
7sys.path.append(path)
8import perf_regions
9
10pf = 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
30if 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
42else:
43   pf.preprocessor()
Note: See TracBrowser for help on using the repository browser.