Changeset 23149 for issm/trunk-jpl/test/NightlyRun/runme.py
- Timestamp:
- 08/21/18 13:06:49 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/runme.py
r23130 r23149 6 6 from glob import glob 7 7 from socket import gethostname 8 from IdFromString import * 8 9 9 10 def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1): … … 20 21 Available options: 21 22 'id' followed by the list of ids requested 22 'exclude' ids to be excluded from the test23 'exclude' ids or (parts of) test names to be excluded from the test 23 24 'benchmark' 'all' (all of the tests) 24 25 'nightly' (nightly run/ daily run) … … 39 40 runme() 40 41 runme(exclude=101) 42 runme(exclude='Dakota') 43 runme(exclude=[[101,102],['Dakota','Slr']]) 41 44 runme(id=102,procedure='update') 42 45 """ … … 92 95 # }}} 93 96 #GET exclude {{{ 94 if exclude: 95 if isinstance(exclude,list): 96 exclude_ids=exclude 97 else: 98 exclude_ids=[exclude] 99 test_ids=test_ids.difference(set(exclude_ids)) 100 # print 'test_ids after exclude =',test_ids 101 # }}} 97 exclude_ids = [] 98 if 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 print exclude 125 raise RuntimeError('''runme.py: exclude (-e/-exclude) and exclude-name (-en/-exclude_name) options must appear as one of the following: 126 127 exclude=101 OR -e 101 128 exclude=\'Dakota\' OR -en 'Dakota' 129 exclude=[101,102...] OR -e 101 102 ... 130 exclude=[\'Dakota\',\'Slr\'...] OR -en 'Dakota' 'Slr' ... 131 exclude=[[101,102...],[\'Dakota\',\'Slr\'...]] OR -e 101 102 ... -en 'Dakota' 'Slr' ... 132 ''') 133 test_ids=test_ids.difference(exclude_ids) 134 print 'test_ids after exclude =',sorted(test_ids) 135 # }}} 136 return 102 137 #Process Ids according to benchmarks {{{ 103 138 if benchmark=='nightly': … … 248 283 parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[]) 249 284 parser.add_argument('-e','--exclude', nargs='+', type=int, help='ids to be excluded from the test', default=[]) 285 parser.add_argument('-en','--exclude_name', nargs='+', type=str, help='test names to be excluded from the test', default=[]) 250 286 parser.add_argument('-b','--benchmark', help='nightly/ismip/eismint/thermal/mesh/...', default='nightly') 251 287 parser.add_argument('-p','--procedure', help='check/update', default='check') … … 255 291 args = parser.parse_args() 256 292 257 md = runme(args.id, args.exclude, args.benchmark, args.procedure, args.output, args.rank, args.numprocs)293 md = runme(args.id, [args.exclude,args.exclude_name], args.benchmark, args.procedure, args.output, args.rank, args.numprocs) 258 294 259 295 if args.output=='nightly':
Note:
See TracChangeset
for help on using the changeset viewer.