Ignore:
Timestamp:
12/22/21 10:39:44 (3 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 26742

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/test

  • issm/trunk/test/NightlyRun/runme.py

    r25836 r26744  
    11#!/usr/bin/env python
     2#
     3# NOTE: Switch to,
     4#
     5#   #!/usr/bin/python3
     6#
     7# when making Python 3 default
     8#
    29import argparse
    310from glob import glob
    411import os
     12import re
    513from sys import float_info
    614from traceback import format_exc
     
    917
    1018try:
    11     from parallelrange import parallelrange
    12 except ImportError:  #we don't have issm code in path, just get it
     19    from arch import archread
     20except: # ISSM_DIR is not on path
    1321    import devpath
    14     from parallelrange import parallelrange
     22
    1523from arch import archread
    1624from arch import archwrite
    1725from GetIds import *
    1826from IdToName import IdToName
     27from parallelrange import parallelrange
    1928
    2029
     
    2231    """RUNME - test deck for ISSM nightly runs
    2332
    24     In a test deck directory (test/NightlyRun for example), the following
    25     command will launch all the existing tests,
     33    In a test deck directory (for example, test/NightlyRun) the following
     34    command will launch all existing tests,
    2635
    2736        ./runme.py
    2837
    29     To run tests 101 and 102:
     38    To run tests 101 and 102,
    3039
    3140        ./runme.py -i [101, 102]
    3241
    3342    Options:
    34         -i/--id             followed by the list of ids or (parts of) test names requested
    35                             NOTE: runs all tests by default
    36 
    37         -e/--exclude        ids or (parts of) test names to be excluded (same format as id)
    38                             NOTE: exclude does nothing if 'id' is specified with different values
    39 
    40         -b/--benchmark      'all'           : (all of the tests)
    41                             'nightly'       : (nightly run/daily run)
    42                             'validation'    : (validation)
    43                             'adolc'         : validation of adolc tests
    44                             'eismint'       : validation of eismint tests
    45                             'ismip'         : validation of ismip-hom tests
    46                             'mesh'          : validation of mesh tests
    47                             'qmu'           : validation of qmu tests
    48                             'referential'   : validation of referential tests
    49                             'slr'           : validation of slr tests
    50                             'thermal'       : validation of thermal tests
    51                             'tranforcing'   : validation of transient forcing tests
    52 
    53         -p/--procedure      'check'         : run the test (default)
    54                             'update'        : update the archive
     43        -i/--id         Followed by the list of ids or (parts of) test names
     44                        requested
     45        -e/--exclude    Ids or (parts of) test names to be excluded (same
     46                        format as id). Does nothing if 'id' is specified with
     47                        different values.
     48        -b/--benchmark  'all'           : (all of the tests)
     49                        'nightly'       : (nightly run/daily run)
     50                        'validation'    : (validation)
     51                        'adolc'         : validation of adolc tests
     52                        'eismint'       : validation of eismint tests
     53                        'ismip'         : validation of ismip-hom tests
     54                        'mesh'          : validation of mesh tests
     55                        'qmu'           : validation of qmu tests
     56                        'referential'   : validation of referential tests
     57                        'slc'           : validation of slc tests
     58                        'thermal'       : validation of thermal tests
     59                        'tranforcing'   : validation of transient forcing tests
     60        -p/--procedure  'check'         : run the test (default)
     61                        'update'        : update the archive
    5562
    5663    Usage:
     
    6370        ./runme.py -e 2001
    6471        ./runme.py -e 'Dakota' --benchmark 'all'
    65         ./runme.py -i [[101, 102], ['Dakota', 'Slr']]
     72        ./runme.py -i [[101, 102], ['Dakota', 'Slc']]
     73
     74    NOTE:
     75    - Will only run test scripts whose names explicitly follow the convention,
     76
     77        test<id>.py
     78
     79    where <id> is any integer.
    6680
    6781    TODO:
    6882    - At '#disp test result', make sure precision of output matches that of
    69         MATLAB.
    70     - Check for failures that do not raise exceptions (for example, 'Standard exception'; see also jenkins/jenkins.sh). These should be counted as failures.
     83    MATLAB.
     84    - Check for failures that do not raise exceptions (for example, 'Standard
     85    exception'; see also jenkins/jenkins.sh). These should be counted as
     86    failures.
    7187    """
    7288
     
    7692    #Process options
    7793    #GET benchmark {{{
    78     if benchmark not in ['all', 'nightly', 'validation', 'adolc', 'eismint', 'ismip', 'mesh', 'slr', 'thermal', 'tranforcing', 'qmu']:
     94    if benchmark not in ['all', 'nightly', 'validation', 'adolc', 'eismint', 'ismip', 'mesh', 'slc', 'thermal', 'tranforcing', 'qmu']:
    7995        print(("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark)))
    8096        benchmark = 'nightly'
     
    96112    #GET ids  {{{
    97113    flist = glob('test*.py')  #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
    98     list_ids = [int(file[4:-3]) for file in flist if not file == 'test.py']  #Keep test id only (skip 'test' and '.py')
     114    list_ids = [int(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] # Keep test id only (skip 'test' and '.py')
    99115
    100116    i1, i2 = parallelrange(rank, numprocs, len(list_ids))  #Get tests for this cpu only
     
    129145    elif benchmark == 'referential':
    130146        test_ids = test_ids.intersection(set(range(1601, 1603)))
    131     elif benchmark == 'slr':
     147    elif benchmark == 'slc':
    132148        test_ids = test_ids.intersection(set(range(2001, 2500)))
    133149    elif benchmark == 'adolc':
Note: See TracChangeset for help on using the changeset viewer.