Changeset 23176
- Timestamp:
- 08/24/18 11:00:59 (7 years ago)
- Location:
- issm/trunk-jpl/test/NightlyRun
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/runme.py
r23160 r23176 6 6 from glob import glob 7 7 from socket import gethostname 8 from IdFromStringimport *8 from GetIds import * 9 9 10 10 def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1): … … 20 20 21 21 Available options: 22 'id' followed by the list of ids requested 23 'exclude' ids or (parts of) test names to be excluded from the test 22 'id' followed by the list of ids or (parts of) test names requested 23 Note: runs all tests by default 24 25 'exclude' ids or (parts of) test names to be excluded (same format as id) 26 Note: exclude does nothing if 'id' is specified with different values 27 24 28 'benchmark' 'all' (all of the tests) 25 29 'nightly' (nightly run/ daily run) … … 29 33 'mesh' : validation of mesh tests 30 34 'adolc' : validation of adolc tests 31 'slr' : validation of slr tests35 'slr' : validation of slr tests 32 36 33 37 'procedure' 'check' : run the test (default) … … 39 43 Examples: 40 44 runme() 41 runme(exclude=101) 42 runme(exclude='Dakota') 43 runme(exclude=[[101,102],['Dakota','Slr']]) 44 runme(id=102,procedure='update') 45 runme(101) 46 runme('SquareShelf') 47 runme(exclude=2001) 48 runme(exclude='Dakota',benchmark='all') 49 runme(id=[[101,102],['Dakota','Slr']]) 45 50 """ 46 51 … … 84 89 85 90 if id: 86 if isinstance(id,list): 87 test_ids=id 88 else: 89 test_ids=[id] 90 test_ids=set(test_ids).intersection(set(list_ids)) 91 test_ids = set(GetIds(id)).intersection(set(list_ids)) 91 92 else: 92 test_ids=set(list_ids) 93 # if no tests are specifically provided, do them all 94 test_ids = set(list_ids) 93 95 94 96 #print 'test_ids after list =',test_ids 95 97 # }}} 96 98 #GET exclude {{{ 97 exclude_ids = [] 98 if exclude != None and np.size(exclude) > 0: 99 # 1 exclusion, either an id or a test name 100 if type(exclude) == str: 101 exclude_ids = IdFromString(exclude) 102 if type(exclude) == int: 103 exclude_ids = [exclude] 104 105 # many exclusions of either ids or test names 106 if type(exclude) == list and len(exclude) > 0: 107 # is everything a string or int? 108 if np.array([type(i) == int for i in exclude]).all(): 109 exclude_ids = exclude 110 elif np.array([type(i) == str for i in exclude]).all(): 111 exclude_ids = np.concatenate([IdFromString(i) for i in exclude]) 112 113 # many exclusions of both ids and test names 114 # exclude[0] -> exclude by id 115 # exclude[1] -> exclude by test name 116 if type(exclude) == list and len(exclude) == 2: 117 if type(exclude[0]) == list and len(exclude[0]) > 0 and type(exclude[0][0]) == int: 118 exclude_ids = np.concatenate([exclude_ids,exclude[0]]) 119 if type(exclude[1]) == list and len(exclude[1]) > 0 and type(exclude[1][0]) == str: 120 exclude_ids = np.concatenate([exclude_ids,np.concatenate([IdFromString(i) for i in exclude[1]])]) 121 122 # no recognizable exclusion 123 if np.size(exclude_ids) == 0: 124 raise RuntimeError('''runme.py: exclude (-e/-exclude) and exclude-name (-en/-exclude_name) options must appear as one of the following: 125 126 exclude=101 OR -e 101 127 exclude=\'Dakota\' OR -en 'Dakota' 128 exclude=[101,102...] OR -e 101 102 ... 129 exclude=[\'Dakota\',\'Slr\'...] OR -en 'Dakota' 'Slr' ... 130 exclude=[[101,102...],[\'Dakota\',\'Slr\'...]] OR -e 101 102 ... -en 'Dakota' 'Slr' ... 131 ''') 132 test_ids=test_ids.difference(exclude_ids) 99 exclude_ids = GetIds(exclude) 100 101 test_ids=test_ids.difference(exclude_ids) 133 102 #print 'test_ids after exclude =',sorted(test_ids) 103 #return 134 104 # }}} 135 105 #Process Ids according to benchmarks {{{ … … 280 250 parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs') 281 251 parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[]) 252 parser.add_argument('-in','--include_name', nargs='*', type=str, help='followed by the list of test names requested', default=[]) 282 253 parser.add_argument('-e','--exclude', nargs='+', type=int, help='ids to be excluded from the test', default=[]) 283 254 parser.add_argument('-en','--exclude_name', nargs='+', type=str, help='test names to be excluded from the test', default=[]) … … 289 260 args = parser.parse_args() 290 261 291 md = runme( args.id, [args.exclude,args.exclude_name], args.benchmark, args.procedure, args.output, args.rank, args.numprocs)262 md = runme([args.id,args.include_name], [args.exclude,args.exclude_name], args.benchmark, args.procedure, args.output, args.rank, args.numprocs) 292 263 293 264 if args.output=='nightly':
Note:
See TracChangeset
for help on using the changeset viewer.