Changeset 27360
- Timestamp:
- 11/08/22 10:56:14 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/runme.py
r27355 r27360 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 glob 10 11 import os 11 import re 12 from re import search, split 12 13 from sys import float_info 13 14 from traceback import format_exc … … 89 90 exception'; see also jenkins/jenkins.sh). These should be counted as 90 91 failures. 91 - Figure out why the following changes allow for correct partitioning of92 test set, but cause an error with ADOL-C build (some test logs are parsed93 twice).94 92 """ 95 93 … … 118 116 # }}} 119 117 #GET ids {{{ 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 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 123 122 list_ids = list_ids[i1:i2 + 1] 124 123 if np.size(id) > 0 and id is not None: … … 214 213 for key in mdl.results.__dict__.keys(): 215 214 if 'Solution' in key: 216 solvetype = re.split('Solution', key)[0]215 solvetype = split('Solution', key)[0] 217 216 218 217 #we save the results, scrap them and solve. … … 225 224 try: 226 225 #first look for indexing 227 if re.search(r'\d+$', fieldname):228 index = int( re.search(r'\d+$', fieldname).group()) - 1229 fieldname = fieldname[: re.search(r'\d+$', fieldname).start()]226 if search(r'\d+$', fieldname): 227 index = int(search(r'\d+$', fieldname).group()) - 1 228 fieldname = fieldname[:search(r'\d+$', fieldname).start()] 230 229 elif 'FirstStep' in fieldname: 231 230 index = 0 232 fieldname = fieldname[: re.search('FirstStep', fieldname).start()]231 fieldname = fieldname[:search('FirstStep', fieldname).start()] 233 232 elif 'SecondStep' in fieldname: 234 233 index = 1 235 fieldname = fieldname[: re.search('SecondStep', fieldname).start()]234 fieldname = fieldname[:search('SecondStep', fieldname).start()] 236 235 elif 'ThirdStep' in fieldname: 237 236 index = 2 238 fieldname = fieldname[: re.search('ThirdStep', fieldname).start()]237 fieldname = fieldname[:search('ThirdStep', fieldname).start()] 239 238 else: 240 239 index = 0 … … 271 270 #probably severalmatches, we take the last one which should be the good one (Needs to be controled in the list above) 272 271 sufix = sufixes[np.squeeze(np.where([suf in fieldname for suf in sufixes]))[-1]] 273 fieldname = fieldname[: re.search(sufix, fieldname).start()]272 fieldname = fieldname[:search(sufix, fieldname).start()] 274 273 elif fieldname.endswith("P") and index == 1: 275 274 #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.