Changeset 27337
- Timestamp:
- 10/26/22 10:30:12 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/runme.py
r27209 r27337 1 #!/usr/bin/env python 1 #!/usr/bin/env python3 2 2 # 3 3 # NOTE: Switch to, … … 8 8 # 9 9 import argparse 10 from glob import glob11 10 import os 12 from re import search, split 11 import re 13 12 from sys import float_info 14 13 from traceback import format_exc … … 90 89 exception'; see also jenkins/jenkins.sh). These should be counted as 91 90 failures. 91 - Figure out why the following changes allow for correct partitioning of 92 test set, but cause an error with ADOL-C build (some test logs are parsed 93 twice). 92 94 """ 93 95 … … 116 118 # }}} 117 119 #GET ids {{{ 118 flist = glob('test*.py') #File name must start with 'test' and must end by '.py' and must be different than 'test.py' 119 list_ids = [int(search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] # Keep test id only (skip 'test' and '.py') 120 121 i1, i2 = parallelrange(rank, numprocs, len(list_ids)) #Get tests for this cpu only 120 flist = [f for f in os.listdir('.') if re.match('test[0-9]+.py', f)] # File name must follow the format "test<integer>.py" 121 list_ids = [int(re.search(r'\d+',f.split('.')[0]).group()) for f in flist] # Retrieve test IDs 122 i1, i2 = parallelrange(rank, numprocs, len(list_ids)) # Get tests for this CPU only 122 123 list_ids = list_ids[i1:i2 + 1] 123 124 if np.size(id) > 0 and id is not None: … … 172 173 test_ids = list(test_ids) 173 174 test_ids.sort() 175 print(test_ids) 176 exit() 174 177 # }}} 175 178 … … 213 216 for key in mdl.results.__dict__.keys(): 214 217 if 'Solution' in key: 215 solvetype = split('Solution', key)[0]218 solvetype = re.split('Solution', key)[0] 216 219 217 220 #we save the results, scrap them and solve. … … 224 227 try: 225 228 #first look for indexing 226 if search(r'\d+$', fieldname):227 index = int( search(r'\d+$', fieldname).group()) - 1228 fieldname = fieldname[: search(r'\d+$', fieldname).start()]229 if re.search(r'\d+$', fieldname): 230 index = int(re.search(r'\d+$', fieldname).group()) - 1 231 fieldname = fieldname[:re.search(r'\d+$', fieldname).start()] 229 232 elif 'FirstStep' in fieldname: 230 233 index = 0 231 fieldname = fieldname[: search('FirstStep', fieldname).start()]234 fieldname = fieldname[:re.search('FirstStep', fieldname).start()] 232 235 elif 'SecondStep' in fieldname: 233 236 index = 1 234 fieldname = fieldname[: search('SecondStep', fieldname).start()]237 fieldname = fieldname[:re.search('SecondStep', fieldname).start()] 235 238 elif 'ThirdStep' in fieldname: 236 239 index = 2 237 fieldname = fieldname[: search('ThirdStep', fieldname).start()]240 fieldname = fieldname[:re.search('ThirdStep', fieldname).start()] 238 241 else: 239 242 index = 0 … … 270 273 #probably severalmatches, we take the last one which should be the good one (Needs to be controled in the list above) 271 274 sufix = sufixes[np.squeeze(np.where([suf in fieldname for suf in sufixes]))[-1]] 272 fieldname = fieldname[: search(sufix, fieldname).start()]275 fieldname = fieldname[:re.search(sufix, fieldname).start()] 273 276 elif fieldname.endswith("P") and index == 1: 274 277 #we are looking for P2 but 2 as been considered as an index and so shifted by -1
Note:
See TracChangeset
for help on using the changeset viewer.