Changeset 23149
- Timestamp:
- 08/21/18 13:06:49 (7 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/jenkins/jenkins.sh
r23060 r23149 245 245 if [ $? -ne 0 ] && [ $NUMCPUS_INSTALL -gt 1 ]; then 246 246 echo " " 247 echo "Compilation failed, trying to compile with only one threa td"247 echo "Compilation failed, trying to compile with only one thread" 248 248 echo " " 249 249 make -
issm/trunk-jpl/jenkins/linux64_ross
r23120 r23149 29 29 30 30 #PYTHON and MATLAB testing 31 MATLAB_TEST= 131 MATLAB_TEST=0 32 32 PYTHON_TEST=1 33 33 … … 37 37 38 38 #List of external packages to be installed and their installation scripts 39 EXTERNALPACKAGES="autotools install.sh 40 cmake install.sh 41 mpich install-3.2-linux64.sh 42 petsc install-3.7-linux64.sh 43 triangle install-linux64.sh 44 chaco install.sh 45 m1qn3 install.sh 46 hdf5 install.sh 47 netcdf install.sh 48 shell2junit install.sh" 39 EXTERNALPACKAGES="" 49 40 50 41 #-----------------# … … 63 54 #by Matlab and runme.m 64 55 #ex: "'id',[101 102 103]" 65 PYTHON_NROPTIONS=" "56 PYTHON_NROPTIONS="--exclude_name 'Dakota'" 66 57 MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]" -
issm/trunk-jpl/test/NightlyRun/IdFromString.py
r20550 r23149 1 1 #! /usr/bin/env python 2 2 from IdToName import IdToName 3 import os 3 4 4 def IdFromString(string): 5 # use verbose=False to print output when this is called by command line 6 def IdFromString(string,verbose=False): 5 7 """ 6 8 IDFROMSTRING - output ids from a given string 7 9 8 10 Usage: 9 11 ids=IdFromString(string) 10 12 11 13 Examples: 12 13 14 14 ids=IdFromString('Parallel') 15 ids=IdFromString('79North') 16 ids=IdFromString('*') 15 17 """ 16 18 … … 18 20 if not isinstance(string,str): 19 21 raise TypeError('IdFromString error message: input argument is not a string.') 22 string = string.replace("'",'') 23 string = string.replace('"','') 20 24 21 #Get the dictionary and scan for matches 22 idnames=IdToName(0) 23 ids=[item[0] for item in idnames.iteritems() if string in item[1]] 25 #Get the test ids and names and scan for matches 26 27 ids = [] 28 idnames = [] 29 for f in os.listdir('.'): 30 if f.endswith('.py') and f.startswith('test'): 31 # all tests look like: "testwxyz.py" so 5th to 3rd to last is always the full id 32 s = int(f[4:-3]) 33 name = IdToName(s) 34 if (string == '*') or (name != None and string in name): 35 ids.append(s) 36 idnames.append(name) 24 37 25 38 #Return if no test found 26 39 if not ids: 27 print "No test matches '%s'." % string 40 if verbose: 41 print "No test matches '%s'." % string 42 #else: 43 #print [] 28 44 return ids 29 45 30 46 #Display names 47 if verbose: 48 idnames = [i for _,i in sorted(zip(ids,idnames), key=lambda pair: pair[0])] 49 31 50 ids.sort() 32 print "%d tests match '%s':" % (len(ids),string) 33 for id in ids: 34 print " %d : %s" % (id,idnames[id]) 51 52 if verbose: 53 print "%s tests match '%s':" % (len(ids),string) 54 for i in range(len(ids)): 55 print " %s : %s" % (ids[i],idnames[i]) 56 #else: 57 #print ids 35 58 36 59 return ids -
issm/trunk-jpl/test/NightlyRun/IdToName.py
r21408 r23149 1 1 #! /usr/bin/env python 2 2 3 def IdToName( id):3 def IdToName(test_id): 4 4 """ 5 5 IDTONAME- return name of test 6 6 7 7 Usage: 8 name=IdToName( id)8 name=IdToName(test_id) 9 9 """ 10 #try: 11 infile = open('test' + str(test_id) + '.py','r') 12 file_text = infile.readline() 10 13 11 infile = open('test' + str(id) + '.py','r') 12 file_text = infile.readlines() 13 14 string='#Test Name:' 15 name=file_text[0] 16 name=name[len(string)+1:-1] 14 string = '#Test Name:' 15 name = file_text[len(string)+1:-1] 17 16 return name 17 #except IOError: 18 # no test with that name, so ignore it 19 #return None -
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.