Changeset 13336
- Timestamp:
- 09/12/12 09:01:36 (13 years ago)
- Location:
- issm/trunk-jpl/test/NightlyRun
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/runme.m
r13258 r13336 35 35 36 36 %Check inputs 37 % {{{ 137 % {{{ 38 38 if nargout>1 39 39 help runme … … 46 46 47 47 %Process options 48 %GET benchmark {{{ 148 %GET benchmark {{{ 49 49 benchmark=getfieldvalue(options,'benchmark','nightly'); 50 50 if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc'}) … … 53 53 end 54 54 % }}} 55 %GET procedure {{{ 155 %GET procedure {{{ 56 56 procedure=getfieldvalue(options,'procedure','check'); 57 57 if ~ismember(procedure,{'check','update'}) … … 60 60 end 61 61 % }}} 62 %GET output {{{ 162 %GET output {{{ 63 63 output=getfieldvalue(options,'output','none'); 64 64 if ~ismember(output,{'nightly','daily','none'}) … … 67 67 end 68 68 % }}} 69 %GET RANK and NUMPROCS for mutlithreaded runs {{{ 169 %GET RANK and NUMPROCS for mutlithreaded runs {{{ 70 70 rank=getfieldvalue(options,'rank',1); 71 71 numprocs=getfieldvalue(options,'numprocs',1); 72 72 if (numprocs<rank), numprocs=1; end 73 73 % }}} 74 %GET ids {{{ 174 %GET ids {{{ 75 75 flist=dir;%use dir, as it seems to act OS independent 76 76 list_ids=[]; … … 88 88 test_ids=intersect(test_ids,list_ids); 89 89 % }}} 90 %GET exclude {{{ 190 %GET exclude {{{ 91 91 exclude_ids=getfieldvalue(options,'exclude',[]); 92 92 exclude_ids=[exclude_ids]; … … 94 94 test_ids(pos)=[]; 95 95 % }}} 96 %Process Ids according to benchmarks{{{ 196 %Process Ids according to benchmarks{{{ 97 97 if strcmpi(benchmark,'nightly'), 98 98 test_ids=intersect(test_ids,[1:999]); -
issm/trunk-jpl/test/NightlyRun/runme.py
r13108 r13336 42 42 from parallelrange import parallelrange 43 43 from IdToName import IdToName 44 from MatlabFuncs import * 44 from MatlabFuncs import strcmpi 45 from MatlabFuncs import ismember 45 46 46 47 #Get ISSM_DIR variable 47 48 ISSM_DIR=os.environ['ISSM_DIR'] 48 print 'ISSM_DIR =',ISSM_DIR49 49 50 50 #Process options 51 #GET benchmark {{{ 151 #GET benchmark {{{ 52 52 if not ismember(benchmark,['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']): 53 53 print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark 54 54 benchmark='nightly' 55 55 # }}} 56 #GET procedure {{{ 156 #GET procedure {{{ 57 57 if not ismember(procedure,['check','update']): 58 58 print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure 59 59 procedure='check' 60 60 # }}} 61 #GET output {{{ 161 #GET output {{{ 62 62 if not ismember(output,['nightly','daily','none']): 63 63 print "runme warning: output '%s' not supported, defaulting to test 'none'." % output 64 64 output='none' 65 65 # }}} 66 #GET RANK and NUMPROCS for multithreaded runs {{{ 166 #GET RANK and NUMPROCS for multithreaded runs {{{ 67 67 if (numprocs<rank): 68 68 numprocs=1 69 69 # }}} 70 71 print 'id =',id 72 print 'exclude =',exclude 73 print 'benchmark =',benchmark 74 print 'procedure =',procedure 75 print 'output =',output 76 print 'rank =',rank 77 print 'numprocs =',numprocs 78 79 #GET ids {{{1 70 #GET ids {{{ 80 71 flist=glob.glob('test*.py') #File name must start with 'test' and must end by '.py' and must be different than 'test.py' 81 72 list_ids=[int(file[4:-3]) for file in flist if not file == 'test.py'] #Keep test id only (skip 'test' and '.py') 82 print 'list_ids =',list_ids73 #print 'list_ids =',list_ids 83 74 84 75 i1,i2=parallelrange(rank,numprocs,len(list_ids)) #Get tests for this cpu only 85 76 list_ids=list_ids[i1:i2+1] 86 print 'list_ids after parallelrange =',list_ids77 #print 'list_ids after parallelrange =',list_ids 87 78 88 79 if id: … … 94 85 else: 95 86 test_ids=set(list_ids) 96 # print 'test_ids after list =',test_ids 97 # }}} 98 99 #GET exclude {{{1 87 #print 'test_ids after list =',test_ids 88 # }}} 89 #GET exclude {{{ 100 90 if exclude: 101 91 if isinstance(exclude,list): … … 106 96 # print 'test_ids after exclude =',test_ids 107 97 # }}} 108 109 #Process Ids according to benchmarks {{{1 98 #Process Ids according to benchmarks {{{ 110 99 if strcmpi(benchmark,'nightly'): 111 100 test_ids=test_ids.intersection(set(range(1,1000))) … … 122 111 elif strcmpi(benchmark,'tranforcing'): 123 112 test_ids=test_ids.intersection(set(range(1501,1503))) 124 #print 'test_ids after benchmark =',test_ids113 #print 'test_ids after benchmark =',test_ids 125 114 test_ids=list(test_ids) 126 115 test_ids.sort() 127 print 'test_ids after sort =',test_ids116 #print 'test_ids after sort =',test_ids 128 117 # }}} 129 118 … … 248 237 return 249 238 239 import argparse 250 240 if __name__ == '__main__': 251 241 if 'PYTHONSTARTUP' in os.environ: 252 242 PYTHONSTARTUP=os.environ['PYTHONSTARTUP'] 253 print 'PYTHONSTARTUP =',PYTHONSTARTUP243 #print 'PYTHONSTARTUP =',PYTHONSTARTUP 254 244 if os.path.exists(PYTHONSTARTUP): 255 245 try: … … 260 250 print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP 261 251 262 import argparse263 252 parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs') 264 253 parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
Note:
See TracChangeset
for help on using the changeset viewer.